From eaee1dbb37e59160969c69687419d81c78b28b9f Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Wed, 15 Feb 2017 19:36:57 -0800 Subject: [PATCH] Bug 1340022 - Implement "handled for descendants" tracking for RestyleDamage. r=emilio MozReview-Commit-ID: Bbk99ogILXC --HG-- extra : rebase_source : 2998f39a67c39073ea66e3e12815e1a7a25f7c9d --- layout/base/nsChangeHint.h | 2 ++ layout/style/ServoBindings.cpp | 6 ++++++ layout/style/ServoBindings.h | 1 + 3 files changed, 9 insertions(+) diff --git a/layout/base/nsChangeHint.h b/layout/base/nsChangeHint.h index 0f064eca40ea..8df4c63f4cce 100644 --- a/layout/base/nsChangeHint.h +++ b/layout/base/nsChangeHint.h @@ -319,6 +319,8 @@ inline nsChangeHint operator^=(nsChangeHint& aLeft, nsChangeHint aRight) nsChangeHint_UpdateUsesOpacity | \ nsChangeHint_UpdateBackgroundPosition) +// NB: Once we drop support for the old style system, this logic should be +// inlined in the Servo style system to eliminate the FFI call. inline nsChangeHint NS_HintsNotHandledForDescendantsIn(nsChangeHint aChangeHint) { nsChangeHint result = nsChangeHint(aChangeHint & ( nsChangeHint_UpdateTransformLayer | diff --git a/layout/style/ServoBindings.cpp b/layout/style/ServoBindings.cpp index 0f46e90bc6bb..d3d23566719a 100644 --- a/layout/style/ServoBindings.cpp +++ b/layout/style/ServoBindings.cpp @@ -310,6 +310,12 @@ Gecko_CalcStyleDifference(nsStyleContext* aOldStyleContext, return result; } +nsChangeHint +Gecko_HintsHandledForDescendants(nsChangeHint aHint) +{ + return aHint & ~NS_HintsNotHandledForDescendantsIn(aHint); +} + ServoElementSnapshotOwned Gecko_CreateElementSnapshot(RawGeckoElementBorrowed aElement) { diff --git a/layout/style/ServoBindings.h b/layout/style/ServoBindings.h index 6fd24326e201..f8403e4dd749 100644 --- a/layout/style/ServoBindings.h +++ b/layout/style/ServoBindings.h @@ -243,6 +243,7 @@ nsStyleContext* Gecko_GetStyleContext(RawGeckoNodeBorrowed node, nsIAtom* aPseudoTagOrNull); nsChangeHint Gecko_CalcStyleDifference(nsStyleContext* oldstyle, ServoComputedValuesBorrowed newstyle); +nsChangeHint Gecko_HintsHandledForDescendants(nsChangeHint aHint); // Element snapshot. ServoElementSnapshotOwned Gecko_CreateElementSnapshot(RawGeckoElementBorrowed element);