Bug 1371955: Diff against the correct style, not the table wrapper style. r=heycam
authorEmilio Cobos Álvarez <emilio@crisal.io>
Sun, 11 Jun 2017 13:44:24 +0200
changeset 412358 8e206f279b44325c925a4d049e1cc0830d56da8b
parent 412357 bdc22078e9f81f0a21d9e04522f52b96ed528b1e
child 412359 92451ad1ada735d8fa67fbb85a4ea242dc512048
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1371955
milestone56.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 1371955: Diff against the correct style, not the table wrapper style. r=heycam MozReview-Commit-ID: 9fwt2D7vOpW
layout/base/ServoRestyleManager.cpp
layout/base/ServoRestyleManager.h
--- a/layout/base/ServoRestyleManager.cpp
+++ b/layout/base/ServoRestyleManager.cpp
@@ -514,30 +514,31 @@ ServoRestyleManager::SnapshotFor(Element
 
   nsIPresShell* presShell = mPresContext->PresShell();
   presShell->EnsureStyleFlush();
 
   return *snapshot;
 }
 
 /* static */ nsIFrame*
-ServoRestyleManager::FrameForPseudoElement(const nsIContent* aContent,
+ServoRestyleManager::FrameForPseudoElement(const Element* aElement,
                                            nsIAtom* aPseudoTagOrNull)
 {
-  MOZ_ASSERT(!aPseudoTagOrNull || aContent->IsElement());
   if (!aPseudoTagOrNull) {
-    return aContent->GetPrimaryFrame();
+    return nsLayoutUtils::GetStyleFrame(aElement);
   }
 
   if (aPseudoTagOrNull == nsCSSPseudoElements::before) {
-    return nsLayoutUtils::GetBeforeFrame(aContent);
+    Element* pseudoElement = nsLayoutUtils::GetBeforePseudo(aElement);
+    return pseudoElement ? nsLayoutUtils::GetStyleFrame(pseudoElement) : nullptr;
   }
 
   if (aPseudoTagOrNull == nsCSSPseudoElements::after) {
-    return nsLayoutUtils::GetAfterFrame(aContent);
+    Element* pseudoElement = nsLayoutUtils::GetAfterPseudo(aElement);
+    return pseudoElement ? nsLayoutUtils::GetStyleFrame(pseudoElement) : nullptr;
   }
 
   if (aPseudoTagOrNull == nsCSSPseudoElements::firstLine ||
       aPseudoTagOrNull == nsCSSPseudoElements::firstLetter) {
     // TODO(emilio, bz): Figure out the best way to diff these styles.
     return nullptr;
   }
 
--- a/layout/base/ServoRestyleManager.h
+++ b/layout/base/ServoRestyleManager.h
@@ -77,17 +77,17 @@ public:
   nsresult ReparentStyleContext(nsIFrame* aFrame);
 
   /**
    * Gets the appropriate frame given a content and a pseudo-element tag.
    *
    * Right now only supports a null tag, before or after. If the pseudo-element
    * is not null, the content needs to be an element.
    */
-  static nsIFrame* FrameForPseudoElement(const nsIContent* aContent,
+  static nsIFrame* FrameForPseudoElement(const Element* aElement,
                                          nsIAtom* aPseudoTagOrNull);
 
   /**
    * Clears the ServoElementData and HasDirtyDescendants from all elements
    * in the subtree rooted at aElement.
    */
   static void ClearServoDataFromSubtree(Element* aElement);