mirror of
https://github.com/servo/servo.git
synced 2025-08-07 22:45:34 +01:00
Use inheritance_parent to control style_sharing.
Using traversal_parent here is wrong. MozReview-Commit-ID: GHCIjkgx4VE
This commit is contained in:
parent
46288f9c46
commit
7b019f807b
1 changed files with 3 additions and 3 deletions
|
@ -582,7 +582,7 @@ impl<E: TElement> StyleSharingCache<E> {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
if target.traversal_parent().is_none() {
|
if target.inheritance_parent().is_none() {
|
||||||
debug!("{:?} Cannot share style: element has no parent",
|
debug!("{:?} Cannot share style: element has no parent",
|
||||||
target.element);
|
target.element);
|
||||||
return None;
|
return None;
|
||||||
|
@ -615,8 +615,8 @@ impl<E: TElement> StyleSharingCache<E> {
|
||||||
// share styles and permit sharing across their children. The latter
|
// share styles and permit sharing across their children. The latter
|
||||||
// check allows us to share style between cousins if the parents
|
// check allows us to share style between cousins if the parents
|
||||||
// shared style.
|
// shared style.
|
||||||
let parent = target.traversal_parent();
|
let parent = target.inheritance_parent();
|
||||||
let candidate_parent = candidate.element.traversal_parent();
|
let candidate_parent = candidate.element.inheritance_parent();
|
||||||
if parent != candidate_parent &&
|
if parent != candidate_parent &&
|
||||||
!checks::can_share_style_across_parents(parent, candidate_parent) {
|
!checks::can_share_style_across_parents(parent, candidate_parent) {
|
||||||
trace!("Miss: Parent");
|
trace!("Miss: Parent");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue