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.
This commit is contained in:
L. David Baron 2014-09-13 06:17:36 -07:00
parent a886f18156
commit 679ff14263

View File

@ -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<nsStyleContext> newContext;
nsIFrame *prevContinuation =