Bug 1371955: Diff against the correct style, not the table wrapper style.
MozReview-Commit-ID: 9fwt2D7vOpW
--- a/layout/base/ServoRestyleManager.cpp
+++ b/layout/base/ServoRestyleManager.cpp
@@ -527,30 +527,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);