aboutsummaryrefslogtreecommitdiffstats
path: root/components/selectors/parser.rs
diff options
context:
space:
mode:
authorXidorn Quan <me@upsuper.org>2017-10-09 17:01:15 +1100
committerXidorn Quan <me@upsuper.org>2017-10-09 22:04:08 +1100
commitab46a0bbe011c71034a7beec9a6e189a774ef9a8 (patch)
treebf48b2b826be895f519e7406f8f005b9c72da83a /components/selectors/parser.rs
parent715fc9cea6ed4ad22772c6d20136eac66cfe275c (diff)
downloadservo-ab46a0bbe011c71034a7beec9a6e189a774ef9a8.tar.gz
servo-ab46a0bbe011c71034a7beec9a6e189a774ef9a8.zip
Add support for :scope pseudo-class
Diffstat (limited to 'components/selectors/parser.rs')
-rw-r--r--components/selectors/parser.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/components/selectors/parser.rs b/components/selectors/parser.rs
index b020a04fd03..44ff450aa3e 100644
--- a/components/selectors/parser.rs
+++ b/components/selectors/parser.rs
@@ -673,6 +673,7 @@ pub enum Component<Impl: SelectorImpl> {
FirstChild, LastChild, OnlyChild,
Root,
Empty,
+ Scope,
NthChild(i32, i32),
NthLastChild(i32, i32),
NthOfType(i32, i32),
@@ -969,6 +970,7 @@ impl<Impl: SelectorImpl> ToCss for Component<Impl> {
OnlyChild => dest.write_str(":only-child"),
Root => dest.write_str(":root"),
Empty => dest.write_str(":empty"),
+ Scope => dest.write_str(":scope"),
FirstOfType => dest.write_str(":first-of-type"),
LastOfType => dest.write_str(":last-of-type"),
OnlyOfType => dest.write_str(":only-of-type"),
@@ -1699,6 +1701,7 @@ fn parse_simple_pseudo_class<'i, P, E, Impl>(parser: &P, name: CowRcStr<'i>)
"only-child" => Ok(Component::OnlyChild),
"root" => Ok(Component::Root),
"empty" => Ok(Component::Empty),
+ "scope" => Ok(Component::Scope),
"first-of-type" => Ok(Component::FirstOfType),
"last-of-type" => Ok(Component::LastOfType),
"only-of-type" => Ok(Component::OnlyOfType),