Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions style/servo/selector_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ pub enum NonTSPseudoClass {
ReadOnly,
ReadWrite,
Required,
ServoListBox,
ServoNonZeroBorder,
Target,
UserInvalid,
Expand Down Expand Up @@ -413,6 +414,7 @@ impl ToCss for NonTSPseudoClass {
Self::ReadOnly => ":read-only",
Self::ReadWrite => ":read-write",
Self::Required => ":required",
Self::ServoListBox => ":-servo-list-box",
Self::ServoNonZeroBorder => ":-servo-nonzero-border",
Self::Target => ":target",
Self::UserInvalid => ":user-invalid",
Expand Down Expand Up @@ -457,6 +459,7 @@ impl NonTSPseudoClass {
Self::ReadOnly => ElementState::READONLY,
Self::ReadWrite => ElementState::READWRITE,
Self::Required => ElementState::REQUIRED,
Self::ServoListBox => ElementState::LIST_BOX,
Self::Target => ElementState::URLTARGET,
Self::UserInvalid => ElementState::USER_INVALID,
Self::UserValid => ElementState::USER_VALID,
Expand Down Expand Up @@ -594,6 +597,14 @@ impl<'a, 'i> ::selectors::Parser<'i> for SelectorParser<'a> {
}
NonTSPseudoClass::ServoNonZeroBorder
},
"-servo-list-box" => {
if !self.in_user_agent_stylesheet() {
return Err(location.new_custom_error(
SelectorParseErrorKind::UnexpectedIdent("-servo-list-box".into())
))
}
NonTSPseudoClass::ServoListBox
},
_ => return Err(location.new_custom_error(SelectorParseErrorKind::UnexpectedIdent(name.clone()))),
};

Expand Down
2 changes: 2 additions & 0 deletions stylo_dom/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ bitflags! {
const ACTIVE_VIEW_TRANSITION = 1u64 << 50;
/// For :-moz-suppress-for-print-selection.
const SUPPRESS_FOR_PRINT_SELECTION = 1u64 << 51;
/// Non-standard & undocumented.
const LIST_BOX = 1u64 << 52;
/// https://drafts.csswg.org/selectors-5/#headings
/// These 4 bits are used to pack the elements heading level into the element state
/// Heading levels can be from 1-9 so 4 bits allows us to express the full range.
Expand Down