Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: dda914a43403e3e7806c40b6cb377c53d35721bc
https://github.com/WebKit/WebKit/commit/dda914a43403e3e7806c40b6cb377c53d35721bc
Author: Dana Estra <[email protected]>
Date: 2026-04-29 (Wed, 29 Apr 2026)
Changed paths:
M LayoutTests/TestExpectations
A LayoutTests/media/track/vtt-cue-root-selector-expected.txt
A LayoutTests/media/track/vtt-cue-root-selector.html
A LayoutTests/media/track/vtt-cue-root-viewtransitionname-expected.txt
A LayoutTests/media/track/vtt-cue-root-viewtransitionname.html
M LayoutTests/platform/gtk/TestExpectations
M LayoutTests/platform/wpe/TestExpectations
M Source/WebCore/css/SelectorChecker.cpp
M Source/WebCore/style/ElementRuleCollector.cpp
Log Message:
-----------
::cue(selector) should be able to match WebVTT root object
rdar://175550173
https://bugs.webkit.org/show_bug.cgi?id=313274
Reviewed by Jer Noble.
Previously, ::cue(selector) rules were only matched against WebVTT
internal node objects (e.g., bold, italic, voice elements). This meant
selectors like ::cue(#foo) could never match, since the cue ID is set
on the TextTrackCueBox (useragentpart="cue"), not on any child
WebVTTElement.
Extend cuePseudoRules collection to also include elements with
userAgentPart="cue", so that ::cue(selector) can match the root cue
element in addition to its children.
To make the case ::cue(:root) work, treat the TextTrackCueBox as matching
:root, per the WebVTT spec.
Added new test media/track/vtt-cue-root-selector.html that tests that
::cue(:root)
but not :root targets the cue, and
media/track/vtt-cue-root-viewtransitionname.html,
which tests that the user agent styles applied on :root elements do not get
applied
on the cue.
* LayoutTests/TestExpectations:
* LayoutTests/media/track/vtt-cue-root-selector-expected.txt: Added.
* LayoutTests/media/track/vtt-cue-root-selector.html: Added.
* LayoutTests/media/track/vtt-cue-root-viewtransitionname-expected.txt: Added.
* LayoutTests/media/track/vtt-cue-root-viewtransitionname.html: Added.
* LayoutTests/platform/gtk/TestExpectations:
* LayoutTests/platform/wpe/TestExpectations:
* Source/WebCore/css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne const):
* Source/WebCore/style/ElementRuleCollector.cpp:
(WebCore::Style::ElementRuleCollector::collectMatchingUserAgentPartRules):
Canonical link: https://commits.webkit.org/312292@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications