mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
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:
parent
6f97dd1c96
commit
36fed07b1c
1 changed files with 5 additions and 2 deletions
|
@ -735,8 +735,8 @@ impl<E: TElement> StyleSharingCache<E> {
|
||||||
|
|
||||||
debug_assert!(target.has_current_styles_for_traversal(
|
debug_assert!(target.has_current_styles_for_traversal(
|
||||||
&candidate.element.borrow_data().unwrap(),
|
&candidate.element.borrow_data().unwrap(),
|
||||||
shared.traversal_flags)
|
shared.traversal_flags,
|
||||||
);
|
));
|
||||||
debug!("Sharing allowed between {:?} and {:?}", target.element, candidate.element);
|
debug!("Sharing allowed between {:?} and {:?}", target.element, candidate.element);
|
||||||
|
|
||||||
true
|
true
|
||||||
|
@ -751,6 +751,9 @@ impl<E: TElement> StyleSharingCache<E> {
|
||||||
target: E,
|
target: E,
|
||||||
) -> Option<E> {
|
) -> Option<E> {
|
||||||
self.cache_mut().lookup(|candidate| {
|
self.cache_mut().lookup(|candidate| {
|
||||||
|
if candidate.element == target {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if !candidate.parent_style_identity().eq(inherited) {
|
if !candidate.parent_style_identity().eq(inherited) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue