Skip to content

Commit b6a6bba

Browse files
committed
Bug 1707584 - part5 : implement :volume-locked pseudo class. r=firefox-style-system-reviewers,emilio
This patch only implements the :volume-locked [1] but doesn't implement the matching process for media element, which should be done in bug 2013371. [1] https://html.spec.whatwg.org/multipage/semantics-other.html#selector-volume-locked Differential Revision: https://phabricator.services.mozilla.com/D281101
1 parent 4c0c504 commit b6a6bba

File tree

4 files changed

+3
-6
lines changed

4 files changed

+3
-6
lines changed

servo/components/style/gecko/non_ts_pseudo_class_list.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ macro_rules! apply_non_ts_list {
9999
("buffering", Buffering, BUFFERING, _),
100100
("stalled", Stalled, STALLED, _),
101101
("muted", Muted, MUTED, _),
102+
("volume-locked", VolumeLocked, _, _),
102103

103104

104105
// NOTE(emilio): Pseudo-classes below only depend on document state, and thus

servo/components/style/gecko/selector_parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ impl NonTSPseudoClass {
229229
}
230230
if matches!(
231231
*self,
232-
Self::Playing | Self::Paused | Self::Seeking | Self::Buffering | Self::Stalled | Self::Muted
232+
Self::Playing | Self::Paused | Self::Seeking | Self::Buffering | Self::Stalled | Self::Muted | Self::VolumeLocked
233233
) {
234234
return static_prefs::pref!("dom.media.pseudo-classes.enabled");
235235
}

servo/components/style/gecko/wrapper.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2094,6 +2094,7 @@ impl<'le> ::selectors::Element for GeckoElement<'le> {
20942094
},
20952095
NonTSPseudoClass::Paused => self.is_html_media_element() && self.state().intersects(ElementState::PAUSED),
20962096
NonTSPseudoClass::Playing => self.is_html_media_element() && !self.state().intersects(ElementState::PAUSED),
2097+
NonTSPseudoClass::VolumeLocked => false, // Bug 2013371
20972098
NonTSPseudoClass::Dir(ref dir) => self.state().intersects(dir.element_state()),
20982099
NonTSPseudoClass::ActiveViewTransitionType(ref types) => {
20992100
self.state().intersects(pseudo_class.state_flag())

testing/web-platform/meta/css/selectors/media/sound-state.html.ini

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)