style: avoid testing against ourselves in lookup_for_rules.

There's a path in finish_restyle, where we can recascade a style for a given
element, in get_after_change_style.

I haven't been able to construct a test-case for this, but this is the only
coherent story I have for crashes like:

  https://crash-stats.mozilla.com/report/index/bcdfe629-ca1f-4e4d-aa17-27f890170917#tab-details
This commit is contained in:
Emilio Cobos Álvarez 2017-09-18 02:46:27 +02:00
parent 6f97dd1c96
commit 36fed07b1c
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -735,8 +735,8 @@ impl<E: TElement> StyleSharingCache<E> {
debug_assert!(target.has_current_styles_for_traversal(
&candidate.element.borrow_data().unwrap(),
shared.traversal_flags)
);
shared.traversal_flags,
));
debug!("Sharing allowed between {:?} and {:?}", target.element, candidate.element);
true
@ -751,6 +751,9 @@ impl<E: TElement> StyleSharingCache<E> {
target: E,
) -> Option<E> {
self.cache_mut().lookup(|candidate| {
if candidate.element == target {
return false;
}
if !candidate.parent_style_identity().eq(inherited) {
return false;
}