Bug 724432 - Skip UpdateOverflow if we did Reflow. Don't propagate UpdateOverflow in ReResolveStyleContext. r=roc
authorMats Palmgren <matspal@gmail.com>
Tue, 07 Feb 2012 12:31:47 +0100
changeset 86411 8f1b1574e4b0f207609cf6a9074ad5ce1796ee8a
parent 86410 4eda0eecbb9527df9e97e18d24ed3ac06bb6cb4e
child 86426 e0d9c8ddd5bd31cfc5481d47945ffe6e62009704
child 86442 f89f6541d03275f97cd6cda0e0b838971f1ee14e
push id94
push userbturner@mozilla.com
push dateWed, 08 Feb 2012 05:39:15 +0000
reviewersroc
bugs724432
milestone13.0a1
Bug 724432 - Skip UpdateOverflow if we did Reflow. Don't propagate UpdateOverflow in ReResolveStyleContext. r=roc
layout/base/nsCSSFrameConstructor.cpp
layout/base/nsFrameManager.cpp
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -7975,17 +7975,17 @@ nsCSSFrameConstructor::ProcessRestyledFr
         StyleChangeReflow(frame, hint);
         didReflow = true;
       }
       if (hint & (nsChangeHint_RepaintFrame | nsChangeHint_SyncFrameView |
                   nsChangeHint_UpdateOpacityLayer | nsChangeHint_UpdateTransformLayer)) {
         ApplyRenderingChangeToTree(presContext, frame, hint);
         didInvalidate = true;
       }
-      if (hint & nsChangeHint_UpdateOverflow) {
+      if ((hint & nsChangeHint_UpdateOverflow) && !didReflow) {
         while (frame) {
           frame->UpdateOverflow();
           nsIFrame* next =
             nsLayoutUtils::GetNextContinuationOrSpecialSibling(frame);
           // Update the ancestors' overflow after we have updated the overflow
           // for all the continuations with the same parent.
           if (!next || frame->GetParent() != next->GetParent()) {
             for (nsIFrame* ancestor = frame->GetParent(); ancestor;
--- a/layout/base/nsFrameManager.cpp
+++ b/layout/base/nsFrameManager.cpp
@@ -1056,16 +1056,18 @@ nsFrameManager::ReResolveStyleContext(ns
     // clear out the nsChangeHint_ClearAncestorIntrinsics flag, since it's
     // possible that we had some random ancestor that cleared ancestor
     // intrinsic widths, but we still need to clear intrinsic widths on frames
     // that are our ancestors but its descendants.
     aMinChange =
       NS_SubtractHint(aMinChange, nsChangeHint_ClearAncestorIntrinsics);
   }
 
+  aMinChange = NS_SubtractHint(aMinChange, nsChangeHint_UpdateOverflow);
+
   // It would be nice if we could make stronger assertions here; they
   // would let us simplify the ?: expressions below setting |content|
   // and |pseudoContent| in sensible ways as well as making what
   // |localContent|, |content|, and |pseudoContent| mean make more
   // sense.  However, we can't, because of frame trees like the one in
   // https://bugzilla.mozilla.org/show_bug.cgi?id=472353#c14 .  Once we
   // fix bug 242277 we should be able to make this make more sense.
   NS_ASSERTION(aFrame->GetContent() || !aParentContent ||