Bug 1936113 - Parse :open pseudo-class in the style system. r=dshin

This enables us to parse the pseudo, but it's not yet connected to anything.

Differential Revision: https://phabricator.services.mozilla.com/D234092
This commit is contained in:
Jonathan Kew
2025-01-17 13:49:55 +00:00
parent 8fb88eaa7d
commit fcdf5ee488
3 changed files with 5 additions and 0 deletions

View File

@@ -134,6 +134,9 @@ bitflags! {
/// https://drafts.csswg.org/css-scoping-1/#the-has-slotted-pseudo
/// Match whether a slot element has assigned nodes
const HAS_SLOTTED = 1u64 << 48;
/// https://drafts.csswg.org/selectors-4/#open-state
/// Match whether an openable element is currently open
const OPEN = 1u64 << 49;
/// Some convenience unions.
const DIR_STATES = Self::LTR.bits() | Self::RTL.bits();

View File

@@ -53,6 +53,7 @@ macro_rules! apply_non_ts_list {
("-moz-styleeditor-transitioning", MozStyleeditorTransitioning, STYLEEDITOR_TRANSITIONING, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS),
("fullscreen", Fullscreen, FULLSCREEN, _),
("modal", Modal, MODAL, _),
("open", Open, OPEN, _),
("-moz-topmost-modal", MozTopmostModal, TOPMOST_MODAL, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS),
("-moz-broken", MozBroken, BROKEN, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS_AND_CHROME),
("-moz-has-dir-attr", MozHasDirAttr, HAS_DIR_ATTR, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS),

View File

@@ -2088,6 +2088,7 @@ impl<'le> ::selectors::Element for GeckoElement<'le> {
NonTSPseudoClass::MozDirAttrLikeAuto |
NonTSPseudoClass::Modal |
NonTSPseudoClass::MozTopmostModal |
NonTSPseudoClass::Open |
NonTSPseudoClass::Active |
NonTSPseudoClass::Hover |
NonTSPseudoClass::HasSlotted |