aboutsummaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorBoris Zbarsky <bzbarsky@mit.edu>2017-05-15 15:55:05 -0400
committerBoris Zbarsky <bzbarsky@mit.edu>2017-05-15 15:55:05 -0400
commit5ddf455235be2a31d10ef388572a35d2433361ae (patch)
treedfc70ffdb1997799e307cb880699fcef524065f8 /components
parentf3c8f7e0d0fb42f32e3699d07fc0f8002bf564c8 (diff)
downloadservo-5ddf455235be2a31d10ef388572a35d2433361ae.tar.gz
servo-5ddf455235be2a31d10ef388572a35d2433361ae.zip
Fix style sharing cache lookups to compare ids of the two elements.
Otherwise we can have a situation like this: <style> .notmatching > #foo {} </style> <span id="foo"></span> <span></span> and the style sharing cache lookup for the second <span> would try to revalidate against the cached value for the first <span>, but end up failing asserts about the two elements matching lists of revalidation selectors that have the same length.
Diffstat (limited to 'components')
-rw-r--r--components/style/matching.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/components/style/matching.rs b/components/style/matching.rs
index 530b3c1f591..4e336c25002 100644
--- a/components/style/matching.rs
+++ b/components/style/matching.rs
@@ -176,7 +176,7 @@ fn element_matches_candidate<E: TElement>(element: &E,
miss!(State)
}
- if element.get_id().is_some() {
+ if element.get_id() != candidate_element.get_id() {
miss!(IdAttr)
}