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/layout/css/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/layout/css/matching.rs')
-rw-r--r-- | components/layout/css/matching.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/components/layout/css/matching.rs b/components/layout/css/matching.rs index f1615aa005d..86968a6d9c2 100644 --- a/components/layout/css/matching.rs +++ b/components/layout/css/matching.rs @@ -268,6 +268,9 @@ impl StyleSharingCandidate { return false } + // FIXME(pcwalton): It's probably faster to iterate over all the element's attributes and + // use the {common, rare}-style-affecting-attributes tables as lookup tables. + for attribute_info in style::common_style_affecting_attributes().iter() { match attribute_info.mode { AttrIsPresentMode(flag) => { @@ -295,6 +298,12 @@ impl StyleSharingCandidate { } } + for attribute_name in style::rare_style_affecting_attributes().iter() { + if element.get_attr(&ns!(""), attribute_name).is_some() { + return false + } + } + if element.get_link().is_some() != self.link { return false } |