From ca5648ca155a7cfc23dfd7fec61befe82f866879 Mon Sep 17 00:00:00 2001 From: Martin Robinson Date: Fri, 8 Mar 2024 09:26:38 +0100 Subject: [PATCH] Add `servo-anonymous-table` (#16) This goes along with the existing `servo-anonymous-table-cell` and `servo-anonymous-table-row`. --- style/servo/selector_parser.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/style/servo/selector_parser.rs b/style/servo/selector_parser.rs index 0df3fe6b0e..e81192c999 100644 --- a/style/servo/selector_parser.rs +++ b/style/servo/selector_parser.rs @@ -54,6 +54,7 @@ pub enum PseudoElement { DetailsSummary, DetailsContent, ServoAnonymousBox, + ServoAnonymousTable, ServoAnonymousTableCell, ServoAnonymousTableRow, ServoLegacyText, @@ -82,6 +83,7 @@ impl ToCss for PseudoElement { DetailsSummary => "::-servo-details-summary", DetailsContent => "::-servo-details-content", ServoAnonymousBox => "::-servo-anonymous-box", + ServoAnonymousTable => "::-servo-anonymous-table", ServoAnonymousTableCell => "::-servo-anonymous-table-cell", ServoAnonymousTableRow => "::-servo-anonymous-table-row", ServoLegacyText => "::-servo-legacy-text", @@ -229,6 +231,7 @@ impl PseudoElement { PseudoElement::DetailsSummary => PseudoElementCascadeType::Lazy, PseudoElement::DetailsContent | PseudoElement::ServoAnonymousBox | + PseudoElement::ServoAnonymousTable | PseudoElement::ServoAnonymousTableCell | PseudoElement::ServoAnonymousTableRow | PseudoElement::ServoLegacyText | @@ -554,6 +557,12 @@ impl<'a, 'i> ::selectors::Parser<'i> for SelectorParser<'a> { } ServoLegacyAnonymousTable }, + "-servo-anonymous-table" => { + if !self.in_user_agent_stylesheet() { + return Err(location.new_custom_error(SelectorParseErrorKind::UnexpectedIdent(name.clone()))) + } + ServoAnonymousTable + }, "-servo-anonymous-table-row" => { if !self.in_user_agent_stylesheet() { return Err(location.new_custom_error(SelectorParseErrorKind::UnexpectedIdent(name.clone())))