Skip to content

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

Merged
magomez merged 1 commit into
wpe-2.46from
pgorszkowski/2.46/navigator-mediaCapabilities-wrapper-should-not-become-GC-collectable-before-its-navigator-object
Jun 15, 2026
Merged

navigator.mediaCapabilities wrapper should not become GC-collectable …#1687
magomez merged 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-igaliapgorszkowski-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-TestsLayout-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-igaliaforce-pushed the pgorszkowski/2.46/navigator-mediaCapabilities-wrapper-should-not-become-GC-collectable-before-its-navigator-object branch from 8739601 to 4d0202aCompareJune 12, 2026 13:47
@magomez
magomez merged commit e1bc585 into wpe-2.46Jun 15, 2026
@magomez
magomez deleted the pgorszkowski/2.46/navigator-mediaCapabilities-wrapper-should-not-become-GC-collectable-before-its-navigator-object branch June 15, 2026 09:05
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants

@pgorszkowski-igalia@magomez