Skip to content

navigator.mediaCapabilities wrapper should not become GC-collectable …#1687

Open
pgorszkowski-igalia wants to merge 1 commit into
wpe-2.46from
pgorszkowski/2.46/navigator-mediaCapabilities-wrapper-should-not-become-GC-collectable-before-its-navigator-object
Open

navigator.mediaCapabilities wrapper should not become GC-collectable …#1687
pgorszkowski-igalia wants to merge 1 commit into
wpe-2.46from
pgorszkowski/2.46/navigator-mediaCapabilities-wrapper-should-not-become-GC-collectable-before-its-navigator-object

Conversation

@pgorszkowski-igalia

@pgorszkowski-igalia pgorszkowski-igalia commented Jun 12, 2026

Copy link
Copy Markdown

…before its navigator object

https://bugs.webkit.org/show_bug.cgi?id=315684

Reviewed by Ryosuke Niwa.

navigator.mediaCapabilities wrapper should not become GC-collectable before its navigator object. The MediaCapabilities interface is annotated [SameObject] in the spec: https://www.w3.org/TR/media-capabilities/#idl-index It means that navigator.mediaCapabilities must return the same object on every access.

See: #1678

Original author: Andrzej Surdej (https://github.com/asurdej-comcast)

Updated existing LayoutTest with mediaCapabilities case.

  • LayoutTests/fast/dom/navigator-property-gc-after-frame-detach-expected.txt:
  • LayoutTests/fast/dom/navigator-property-gc-after-frame-detach.html:
  • Source/WebCore/Modules/mediacapabilities/MediaCapabilities.cpp: (WebCore::MediaCapabilities::MediaCapabilities):
    (WebCore::MediaCapabilities::navigator):
  • Source/WebCore/Modules/mediacapabilities/MediaCapabilities.h: (WebCore::MediaCapabilities::create):
  • Source/WebCore/Modules/mediacapabilities/MediaCapabilities.idl:
  • Source/WebCore/Modules/mediacapabilities/NavigatorMediaCapabilities.cpp: (WebCore::NavigatorMediaCapabilities::NavigatorMediaCapabilities): (WebCore::NavigatorMediaCapabilities::from):
  • Source/WebCore/Modules/mediacapabilities/NavigatorMediaCapabilities.h:
  • Source/WebCore/Modules/mediacapabilities/WorkerNavigatorMediaCapabilities.cpp: (WebCore::WorkerNavigatorMediaCapabilities::WorkerNavigatorMediaCapabilities): (WebCore::WorkerNavigatorMediaCapabilities::from):
  • Source/WebCore/Modules/mediacapabilities/WorkerNavigatorMediaCapabilities.h:

Canonical link: https://commits.webkit.org/315088@main
4d0202a

Build-Tests Layout-Tests
✅ 🛠 wpe-246-amd64-build ✅ 🧪 wpe-246-amd64-layout
✅ 🛠 wpe-246-arm32-build ✅ 🧪 wpe-246-arm32-layout

…before its navigator object

https://bugs.webkit.org/show_bug.cgi?id=315684

Reviewed by Ryosuke Niwa.

navigator.mediaCapabilities wrapper should not become GC-collectable before its navigator object.
The MediaCapabilities interface is annotated [SameObject] in the spec:
https://www.w3.org/TR/media-capabilities/#idl-index
It means that navigator.mediaCapabilities must return the same object on every access.

See: #1678

Original author: Andrzej Surdej (https://github.com/asurdej-comcast)

Updated existing LayoutTest with mediaCapabilities case.

* LayoutTests/fast/dom/navigator-property-gc-after-frame-detach-expected.txt:
* LayoutTests/fast/dom/navigator-property-gc-after-frame-detach.html:
* Source/WebCore/Modules/mediacapabilities/MediaCapabilities.cpp:
(WebCore::MediaCapabilities::MediaCapabilities):
(WebCore::MediaCapabilities::navigator):
* Source/WebCore/Modules/mediacapabilities/MediaCapabilities.h:
(WebCore::MediaCapabilities::create):
* Source/WebCore/Modules/mediacapabilities/MediaCapabilities.idl:
* Source/WebCore/Modules/mediacapabilities/NavigatorMediaCapabilities.cpp:
(WebCore::NavigatorMediaCapabilities::NavigatorMediaCapabilities):
(WebCore::NavigatorMediaCapabilities::from):
* Source/WebCore/Modules/mediacapabilities/NavigatorMediaCapabilities.h:
* Source/WebCore/Modules/mediacapabilities/WorkerNavigatorMediaCapabilities.cpp:
(WebCore::WorkerNavigatorMediaCapabilities::WorkerNavigatorMediaCapabilities):
(WebCore::WorkerNavigatorMediaCapabilities::from):
* Source/WebCore/Modules/mediacapabilities/WorkerNavigatorMediaCapabilities.h:

Canonical link: https://commits.webkit.org/315088@main
@pgorszkowski-igalia pgorszkowski-igalia force-pushed the pgorszkowski/2.46/navigator-mediaCapabilities-wrapper-should-not-become-GC-collectable-before-its-navigator-object branch from 8739601 to 4d0202a Compare June 12, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

1 participant