From: L. David Baron Bug 828312, patch 3: Use the non-inherited hints from the parent style context when that parent style context is on a child frame. diff --git a/layout/base/RestyleManager.cpp b/layout/base/RestyleManager.cpp --- a/layout/base/RestyleManager.cpp +++ b/layout/base/RestyleManager.cpp @@ -2144,20 +2144,28 @@ ElementRestyler::RestyleSelf(nsRestyleHi const nsCSSPseudoElements::Type pseudoType = oldContext->GetPseudoType(); nsStyleContext* parentContext; // Get the frame providing the parent style context. If it is a // child, then resolve the provider first. nsIFrame* providerFrame = mFrame->GetParentStyleContextFrame(); bool isChild = providerFrame && providerFrame->GetParent() == mFrame; if (!isChild) { - if (providerFrame) + if (providerFrame) { parentContext = providerFrame->StyleContext(); - else + + if (providerFrame != mFrame->GetParent()) { + // We don't actually know what the parent style context's + // non-inherited hints were, so assume the worst. + mParentFrameHintsNotHandledForDescendants = + nsChangeHint_Hints_NotHandledForDescendants; + } + } else { parentContext = nullptr; + } } else { MOZ_ASSERT(providerFrame->GetContent() == mFrame->GetContent(), "Postcondition for GetParentStyleContextFrame() violated. " "That means we need to add the current element to the " "ancestor filter."); // resolve the provider here (before mFrame below). @@ -2168,32 +2176,27 @@ ElementRestyler::RestyleSelf(nsRestyleHi // can't be trusted because it assumes any changes to the parent // style context provider will be automatically propagated to // the frame(s) with child style contexts. ElementRestyler providerRestyler(PARENT_CONTEXT_FROM_CHILD_FRAME, *this, providerFrame); providerRestyler.Restyle(aRestyleHint); assumeDifferenceHint = providerRestyler.HintsHandledForFrame(); + mParentFrameHintsNotHandledForDescendants = + providerRestyler.HintsNotHandledForDescendants(); // The provider's new context becomes the parent context of // mFrame's context. parentContext = providerFrame->StyleContext(); // Set |mResolvedChild| so we don't bother resolving the // provider again. mResolvedChild = providerFrame; } - if (providerFrame != mFrame->GetParent()) { - // We don't actually know what the parent style context's - // non-inherited hints were, so assume the worst. - mParentFrameHintsNotHandledForDescendants = - nsChangeHint_Hints_NotHandledForDescendants; - } - #ifdef DEBUG { // Check that our assumption that continuations of the same // pseudo-type and with the same style context parent have the // same style context is valid before the reresolution. (We need // to check the pseudo-type and style context parent because of // :first-letter and :first-line, where we create styled and // unstyled letter/line frames distinguished by pseudo-type, and