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/selector_matching.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/selector_matching.rs')
-rw-r--r-- | components/style/selector_matching.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/components/style/selector_matching.rs b/components/style/selector_matching.rs index 228ff41af05..b1fbd5042e8 100644 --- a/components/style/selector_matching.rs +++ b/components/style/selector_matching.rs @@ -799,6 +799,13 @@ pub fn common_style_affecting_attributes() -> [CommonStyleAffectingAttributeInfo ] } +/// Attributes that, if present, disable style sharing. All legacy HTML attributes must be in +/// either this list or `common_style_affecting_attributes`. See the comment in +/// `synthesize_presentational_hints_for_legacy_attributes`. +pub fn rare_style_affecting_attributes() -> [Atom, ..1] { + [ atom!("border") ] +} + /// Determines whether the given element matches the given single selector. /// /// NB: If you add support for any new kinds of selectors to this routine, be sure to set @@ -993,6 +1000,12 @@ pub fn matches_simple_selector<'a,E,N>(selector: &SimpleSelector, matches_generic_nth_child(element, 0, 1, true, true) } + ServoNonzeroBorder => { + *shareable = false; + let elem = element.as_element(); + elem.has_nonzero_border() + } + Negation(ref negated) => { *shareable = false; !negated.iter().all(|s| matches_simple_selector(s, element, shareable)) |