diff options
author | Patrick Walton <pcwalton@mimiga.net> | 2014-12-07 22:54:56 -0800 |
---|---|---|
committer | Patrick Walton <pcwalton@mimiga.net> | 2014-12-15 17:41:37 -0800 |
commit | 10f1ed5e311e7092d3e24b58c4960f5e8a511ac0 (patch) | |
tree | ef72767ba32a4268b20002c1a80a0d13ea9b47a4 /components/style/selectors.rs | |
parent | e0e14c60d68474a0dec94d2ec71d979a95fbc6a6 (diff) | |
download | servo-10f1ed5e311e7092d3e24b58c4960f5e8a511ac0.tar.gz servo-10f1ed5e311e7092d3e24b58c4960f5e8a511ac0.zip |
style: Parse the legacy `border` attribute per the legacy HTML specification.
Additionally, this patch cleans up some miscellaneous formatting issues
and refactors files in `layout/css/` somewhat to eliminate needless
levels of indirection. It also fixes our handling of presentational
hints that only apply if border is nonzero.
Diffstat (limited to 'components/style/selectors.rs')
-rw-r--r-- | components/style/selectors.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/components/style/selectors.rs b/components/style/selectors.rs index da0e2b7b638..9cb3f240dd4 100644 --- a/components/style/selectors.rs +++ b/components/style/selectors.rs @@ -79,7 +79,8 @@ pub enum SimpleSelector { NthLastOfType(i32, i32), FirstOfType, LastOfType, - OnlyOfType + OnlyOfType, + ServoNonzeroBorder, // ... } @@ -231,7 +232,7 @@ fn compute_specificity(mut selector: &CompoundSelector, // | &Empty | &Lang(*) | &NthChild(..) | &NthLastChild(..) | &NthOfType(..) | &NthLastOfType(..) - | &FirstOfType | &LastOfType | &OnlyOfType + | &FirstOfType | &LastOfType | &OnlyOfType | &ServoNonzeroBorder => specificity.class_like_selectors += 1, &NamespaceSelector(..) => (), &Negation(ref negated) @@ -506,6 +507,10 @@ fn parse_simple_pseudo_class(name: &str) -> Result<SimpleSelector, ()> { "first-of-type" => Ok(FirstOfType), "last-of-type" => Ok(LastOfType), "only-of-type" => Ok(OnlyOfType), + "-servo-nonzero-border" => { + // TODO(pcwalton): Have some mechanism whereby we forbid Web content from using this. + Ok(ServoNonzeroBorder) + } // "empty" => Ok(Empty), _ => Err(()) } |