Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement ::backdrop pseudo-element parsing #103

Merged
merged 1 commit into from
Jan 7, 2025
Merged
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
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
Loading