Introduce a new flag and use it to be more permissive about cousin sharing.

MozReview-Commit-ID: BCJg0Ycsy6M
This commit is contained in:
Bobby Holley 2017-08-04 17:33:26 -07:00
parent ac37f81c1f
commit 54c52910e4
4 changed files with 45 additions and 23 deletions

View file

@ -610,13 +610,14 @@ impl<E: TElement> StyleSharingCandidateCache<E> {
}
}
// Check that we have the same parent, or at least the same pointer
// identity for parent computed style. The latter check allows us to
// share style between cousins if the parents shared style.
// Check that we have the same parent, or at least that the parents
// share styles and permit sharing across their children. The latter
// check allows us to share style between cousins if the parents
// shared style.
let parent = target.traversal_parent();
let candidate_parent = candidate.element.traversal_parent();
if parent != candidate_parent &&
!checks::same_computed_values(parent, candidate_parent) {
!checks::can_share_style_across_parents(parent, candidate_parent) {
miss!(Parent)
}