From 679ff14263a7e2ca57645946b01b35fbb0cf3ddb Mon Sep 17 00:00:00 2001 From: "L. David Baron" Date: Sat, 13 Sep 2014 06:17:36 -0700 Subject: [PATCH] Bug 977991 patch 4 - Ensure we don't try to use the style attribute optimization on pseudo-elements. r=birtles This is needed because patch 1 and patch 3 did not add a mechanism that allows restyling pseudo-elements, which would be substantially more work and very little use (since the only case in which they have style attributes is for our internal use on the ::-moz-color-swatch pseudo-element). RestyleUndisplayedChildren does not need the same fix because it's only used on elements, and never on pseudo-elements or anonymous boxes. --- layout/base/RestyleManager.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/layout/base/RestyleManager.cpp b/layout/base/RestyleManager.cpp index 119e1d3a315..5a324b69794 100644 --- a/layout/base/RestyleManager.cpp +++ b/layout/base/RestyleManager.cpp @@ -2747,6 +2747,15 @@ ElementRestyler::RestyleSelf(nsIFrame* aSelf, nsChangeHint_Hints_NotHandledForDescendants; } + // We don't support using eRestyle_StyleAttribute when pseudo-elements + // are involved. This is mostly irrelevant since style attribute + // changes on pseudo-elements are very rare, though it does mean we + // don't get the optimization for table elements. + if (pseudoType != nsCSSPseudoElements::ePseudo_NotPseudoElement && + (aRestyleHint & eRestyle_StyleAttribute)) { + aRestyleHint = (aRestyleHint & ~eRestyle_StyleAttribute) | eRestyle_Self; + } + // do primary context nsRefPtr newContext; nsIFrame *prevContinuation =