Skip to content

Commit

Permalink
Implement ::backdrop parsing (#103)
Browse files Browse the repository at this point in the history
Signed-off-by: Nico Burns <[email protected]>
  • Loading branch information
nicoburns authored Jan 7, 2025
1 parent 95ee4c3 commit aab832f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion style/servo/selector_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ pub enum PseudoElement {
// them. Also, make sure the UA sheet has the !important rules some of the
// APPLIES_TO_PLACEHOLDER properties expect!

Backdrop,

// Non-eager pseudos.
DetailsSummary,
DetailsContent,
Expand Down Expand Up @@ -82,6 +84,7 @@ impl ToCss for PseudoElement {
After => "::after",
Before => "::before",
Selection => "::selection",
Backdrop => "::backdrop",
DetailsSummary => "::-servo-details-summary",
DetailsContent => "::-servo-details-content",
ServoAnonymousBox => "::-servo-anonymous-box",
Expand Down Expand Up @@ -232,7 +235,7 @@ impl PseudoElement {
PseudoElement::After | PseudoElement::Before | PseudoElement::Selection => {
PseudoElementCascadeType::Eager
},
PseudoElement::DetailsSummary => PseudoElementCascadeType::Lazy,
PseudoElement::Backdrop | PseudoElement::DetailsSummary => PseudoElementCascadeType::Lazy,
PseudoElement::DetailsContent |
PseudoElement::ServoAnonymousBox |
PseudoElement::ServoAnonymousTable |
Expand Down Expand Up @@ -594,6 +597,7 @@ impl<'a, 'i> ::selectors::Parser<'i> for SelectorParser<'a> {
"before" => Before,
"after" => After,
"selection" => Selection,
"backdrop" => Backdrop,
"-servo-details-summary" => {
if !self.in_user_agent_stylesheet() {
return Err(location.new_custom_error(SelectorParseErrorKind::UnexpectedIdent(name.clone())))
Expand Down

0 comments on commit aab832f

Please sign in to comment.