aboutsummaryrefslogtreecommitdiffstats
path: root/components/selectors/parser.rs
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2019-04-19 04:41:17 +0000
committerEmilio Cobos Álvarez <emilio@crisal.io>2019-05-07 12:55:27 +0200
commit52026f602b9c15f4a854512f6d79a447dc85e048 (patch)
tree2e347a8b2f5d4feed717b34bf1e52eaa1c0ae210 /components/selectors/parser.rs
parentc0b17cc84406e51549955d46b225277a14495e23 (diff)
downloadservo-52026f602b9c15f4a854512f6d79a447dc85e048.tar.gz
servo-52026f602b9c15f4a854512f6d79a447dc85e048.zip
style: Don't allow to parse XUL tree pseudo-elements with a single colon.
Now that they're not exposed to the web we can remove this special case. Differential Revision: https://phabricator.services.mozilla.com/D28071
Diffstat (limited to 'components/selectors/parser.rs')
-rw-r--r--components/selectors/parser.rs10
1 files changed, 2 insertions, 8 deletions
diff --git a/components/selectors/parser.rs b/components/selectors/parser.rs
index afb7280508d..e3afab57e16 100644
--- a/components/selectors/parser.rs
+++ b/components/selectors/parser.rs
@@ -191,12 +191,6 @@ pub trait Parser<'i> {
type Impl: SelectorImpl;
type Error: 'i + From<SelectorParseErrorKind<'i>>;
- /// Whether the name is a pseudo-element that can be specified with
- /// the single colon syntax in addition to the double-colon syntax.
- fn pseudo_element_allows_single_colon(name: &str) -> bool {
- is_css2_pseudo_element(name)
- }
-
/// Whether to parse the `::slotted()` pseudo-element.
fn parse_slotted(&self) -> bool {
false
@@ -2038,7 +2032,7 @@ where
/// Returns whether the name corresponds to a CSS2 pseudo-element that
/// can be specified with the single colon syntax (in addition to the
/// double-colon syntax, which can be used for all pseudo-elements).
-pub fn is_css2_pseudo_element(name: &str) -> bool {
+fn is_css2_pseudo_element(name: &str) -> bool {
// ** Do not add to this list! **
match_ignore_ascii_case! { name,
"before" | "after" | "first-line" | "first-letter" => true,
@@ -2114,7 +2108,7 @@ where
},
};
let is_pseudo_element =
- !is_single_colon || P::pseudo_element_allows_single_colon(&name);
+ !is_single_colon || is_css2_pseudo_element(&name);
if is_pseudo_element {
if state.intersects(SelectorParsingState::AFTER_PSEUDO_ELEMENT) {
return Err(input.new_custom_error(SelectorParseErrorKind::InvalidState));