Skip to content

Commit aab832f

Browse files
authored
Implement ::backdrop parsing (#103)
Signed-off-by: Nico Burns <nico@nicoburns.com>
1 parent 95ee4c3 commit aab832f

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

style/servo/selector_parser.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ pub enum PseudoElement {
5050
// them. Also, make sure the UA sheet has the !important rules some of the
5151
// APPLIES_TO_PLACEHOLDER properties expect!
5252

53+
Backdrop,
54+
5355
// Non-eager pseudos.
5456
DetailsSummary,
5557
DetailsContent,
@@ -82,6 +84,7 @@ impl ToCss for PseudoElement {
8284
After => "::after",
8385
Before => "::before",
8486
Selection => "::selection",
87+
Backdrop => "::backdrop",
8588
DetailsSummary => "::-servo-details-summary",
8689
DetailsContent => "::-servo-details-content",
8790
ServoAnonymousBox => "::-servo-anonymous-box",
@@ -232,7 +235,7 @@ impl PseudoElement {
232235
PseudoElement::After | PseudoElement::Before | PseudoElement::Selection => {
233236
PseudoElementCascadeType::Eager
234237
},
235-
PseudoElement::DetailsSummary => PseudoElementCascadeType::Lazy,
238+
PseudoElement::Backdrop | PseudoElement::DetailsSummary => PseudoElementCascadeType::Lazy,
236239
PseudoElement::DetailsContent |
237240
PseudoElement::ServoAnonymousBox |
238241
PseudoElement::ServoAnonymousTable |
@@ -594,6 +597,7 @@ impl<'a, 'i> ::selectors::Parser<'i> for SelectorParser<'a> {
594597
"before" => Before,
595598
"after" => After,
596599
"selection" => Selection,
600+
"backdrop" => Backdrop,
597601
"-servo-details-summary" => {
598602
if !self.in_user_agent_stylesheet() {
599603
return Err(location.new_custom_error(SelectorParseErrorKind::UnexpectedIdent(name.clone())))

0 commit comments

Comments
 (0)