Bug 1116714 part 3 - Use GetParentOrPlaceholderFor (not GetParent) so that reframing anonymous content frames works also for fixed pos frames. r=roc
☠☠ backed out by 1f32089c6733 ☠ ☠
authorMats Palmgren <mats@mozilla.com>
Tue, 06 Jan 2015 09:27:56 +0000
changeset 235232 4d2d510fbd623a3799ffc501b8e3561201f8cc36
parent 235231 5e51dc838a896d4aa649926ae9e763d1a657c169
child 235233 426055dc106ab9e557bd692c2a4e16a946a861b0
push id355
push usermleibovic@mozilla.com
push dateWed, 07 Jan 2015 02:29:19 +0000
reviewersroc
bugs1116714
milestone37.0a1
Bug 1116714 part 3 - Use GetParentOrPlaceholderFor (not GetParent) so that reframing anonymous content frames works also for fixed pos frames. r=roc
layout/base/nsCSSFrameConstructor.cpp
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -9288,19 +9288,19 @@ nsCSSFrameConstructor::RecreateFramesFor
 
     if (frame->GetStateBits() & NS_FRAME_ANONYMOUSCONTENTCREATOR_CONTENT) {
       // Recreate the frames for the entire nsIAnonymousContentCreator tree
       // since |frame| or one of its descendants may need an nsStyleContext
       // that associates it to a CSS pseudo-element, and only the
       // nsIAnonymousContentCreator that created this content knows how to make
       // that happen.
       nsIAnonymousContentCreator* acc = nullptr;
-      nsIFrame* ancestor = frame->GetParent();
+      nsIFrame* ancestor = nsLayoutUtils::GetParentOrPlaceholderFor(frame);
       while (!(acc = do_QueryFrame(ancestor))) {
-        ancestor = ancestor->GetParent();
+        ancestor = nsLayoutUtils::GetParentOrPlaceholderFor(ancestor);
       }
       NS_ASSERTION(acc, "Where is the nsIAnonymousContentCreator? We may fail "
                         "to recreate its content correctly");
       // nsSVGUseFrame is special, and we know this is unnecessary for it.
       if (ancestor->GetType() != nsGkAtoms::svgUseFrame) {
         NS_ASSERTION(aContent->IsInNativeAnonymousSubtree(),
                      "Why is NS_FRAME_ANONYMOUSCONTENTCREATOR_CONTENT set?");
         return RecreateFramesForContent(ancestor->GetContent(), aAsyncInsert,