Bug 1397168 - Add a function to find out if a node has any ancestor that is pending for restyling. r=emilio

MozReview-Commit-ID: DXcodMcQP59

--HG--
extra : rebase_source : e31ed0d2471150bfdf30ac656f39795d11a4fed5
This commit is contained in:
Wei-Cheng Pan 2017-09-06 15:42:05 +08:00
parent 21231eaf77
commit 4c6b1c3dec
3 changed files with 11 additions and 0 deletions

View File

@ -1202,6 +1202,12 @@ ServoRestyleManager::ProcessAllPendingAttributeAndStateInvalidations()
ClearSnapshots(); ClearSnapshots();
} }
bool
ServoRestyleManager::HasPendingRestyleAncestor(Element* aElement) const
{
return Servo_HasPendingRestyleAncestor(aElement);
}
void void
ServoRestyleManager::UpdateOnlyAnimationStyles() ServoRestyleManager::UpdateOnlyAnimationStyles()
{ {

View File

@ -188,6 +188,7 @@ public:
nsRestyleHint aRestyleHint); nsRestyleHint aRestyleHint);
void ProcessPendingRestyles(); void ProcessPendingRestyles();
void ProcessAllPendingAttributeAndStateInvalidations(); void ProcessAllPendingAttributeAndStateInvalidations();
bool HasPendingRestyleAncestor(dom::Element* aElement) const;
/** /**
* Performs a Servo animation-only traversal to compute style for all nodes * Performs a Servo animation-only traversal to compute style for all nodes

View File

@ -646,6 +646,10 @@ SERVO_BINDING_FUNC(Servo_ProcessInvalidations, void,
const mozilla::ServoElementSnapshotTable* snapshots) const mozilla::ServoElementSnapshotTable* snapshots)
SERVO_BINDING_FUNC(Servo_HasPendingRestyleAncestor, bool,
RawGeckoElementBorrowed element)
// AddRef / Release functions // AddRef / Release functions
#define SERVO_ARC_TYPE(name_, type_) \ #define SERVO_ARC_TYPE(name_, type_) \
SERVO_BINDING_FUNC(Servo_##name_##_AddRef, void, type_##Borrowed) \ SERVO_BINDING_FUNC(Servo_##name_##_AddRef, void, type_##Borrowed) \