aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/css/matching.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/layout/css/matching.rs')
-rw-r--r--components/layout/css/matching.rs9
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
}