Bug 1389385 - Do all descendant bit propagation from Gecko over FFI. r=emilio
authorBobby Holley <bobbyholley@gmail.com>
Tue, 18 Jul 2017 16:17:02 -0700
changeset 374403 f9eb00885da13405e6185212174c4c4f5c9fcbcc
parent 374402 6f84fdcb757373ea9f0de767ff4d0068067791c0
child 374404 4a977fea2799d75b82dbd9cf4da8d0dabadee65d
push id93678
push userarchaeopteryx@coole-files.de
push dateSat, 12 Aug 2017 23:17:05 +0000
treeherdermozilla-inbound@a79ccbfacad8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1389385
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1389385 - Do all descendant bit propagation from Gecko over FFI. r=emilio Deduplicating code is nice, and it will help us when we make the bit propagation more complicated in upcoming patches. MozReview-Commit-ID: KIQnNJVayrM
layout/style/ServoBindings.cpp
layout/style/ServoBindings.h
--- a/layout/style/ServoBindings.cpp
+++ b/layout/style/ServoBindings.cpp
@@ -369,22 +369,35 @@ Gecko_UnsetNodeFlags(RawGeckoNodeBorrowe
 {
   const_cast<nsINode*>(aNode)->UnsetFlags(aFlags);
 }
 
 void
 Gecko_SetOwnerDocumentNeedsStyleFlush(RawGeckoElementBorrowed aElement)
 {
   MOZ_ASSERT(NS_IsMainThread());
-
   if (nsIPresShell* shell = aElement->OwnerDoc()->GetShell()) {
     shell->EnsureStyleFlush();
   }
 }
 
+void
+Gecko_NoteDirtyDescendants(RawGeckoElementBorrowed aElement)
+{
+  MOZ_ASSERT(NS_IsMainThread());
+  const_cast<Element*>(aElement)->NoteDirtyDescendantsForServo();
+}
+
+void
+Gecko_NoteAnimationOnlyDirtyDescendants(RawGeckoElementBorrowed aElement)
+{
+  MOZ_ASSERT(NS_IsMainThread());
+  const_cast<Element*>(aElement)->NoteAnimationOnlyDirtyDescendantsForServo();
+}
+
 nsStyleContext*
 Gecko_GetStyleContext(RawGeckoElementBorrowed aElement,
                       nsIAtom* aPseudoTagOrNull)
 {
   nsIFrame* relevantFrame =
     ServoRestyleManager::FrameForPseudoElement(aElement, aPseudoTagOrNull);
   if (relevantFrame) {
     return relevantFrame->StyleContext();
--- a/layout/style/ServoBindings.h
+++ b/layout/style/ServoBindings.h
@@ -382,16 +382,18 @@ void Gecko_SetContentDataImageValue(nsSt
 nsStyleContentData::CounterFunction* Gecko_SetCounterFunction(
     nsStyleContentData* content_data, nsStyleContentType type);
 
 // Dirtiness tracking.
 uint32_t Gecko_GetNodeFlags(RawGeckoNodeBorrowed node);
 void Gecko_SetNodeFlags(RawGeckoNodeBorrowed node, uint32_t flags);
 void Gecko_UnsetNodeFlags(RawGeckoNodeBorrowed node, uint32_t flags);
 void Gecko_SetOwnerDocumentNeedsStyleFlush(RawGeckoElementBorrowed element);
+void Gecko_NoteDirtyDescendants(RawGeckoElementBorrowed element);
+void Gecko_NoteAnimationOnlyDirtyDescendants(RawGeckoElementBorrowed element);
 
 // Incremental restyle.
 // Also, we might want a ComputedValues to ComputedValues API for animations?
 // Not if we do them in Gecko...
 nsStyleContext* Gecko_GetStyleContext(RawGeckoElementBorrowed element,
                                       nsIAtom* aPseudoTagOrNull);
 mozilla::CSSPseudoElementType Gecko_GetImplementedPseudo(RawGeckoElementBorrowed element);
 nsChangeHint Gecko_CalcStyleDifference(ServoStyleContextBorrowed old_style,