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.
This commit is contained in:
Boris Zbarsky 2017-05-15 15:55:05 -04:00
parent f3c8f7e0d0
commit 5ddf455235

View file

@ -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)
}