Bug 45631: text-indent: n% doesn't incrementally reflow correctly. r+sr=roc.
authorsharparrow1@yahoo.com
Mon, 21 May 2007 02:55:27 -0700
changeset 1668 65c73e706b932a335d59643eb0feddf8b89b9f12
parent 1667 e8dbd24204808ba23dc37c7df76d39407f9a739d
child 1669 971fa9f8cf7738611341a217cbaec9a4ba2f5fda
push id1
push userbsmedberg@mozilla.com
push dateThu, 20 Mar 2008 16:49:24 +0000
treeherdermozilla-central@61007906a1f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs45631
milestone1.9a5pre
Bug 45631: text-indent: n% doesn't incrementally reflow correctly. r+sr=roc.
layout/generic/nsBlockFrame.cpp
layout/generic/nsLineLayout.cpp
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -3199,16 +3199,21 @@ nsBlockFrame::DoReflowInlineFrames(nsBlo
   nscoord availHeight;
   if (aState.GetFlag(BRS_UNCONSTRAINEDHEIGHT)) {
     availHeight = NS_UNCONSTRAINEDSIZE;
   }
   else {
     /* XXX get the height right! */
     availHeight = aState.mAvailSpaceRect.height;
   }
+
+  // Make sure to enable resize optimization before we call BeginLineReflow
+  // because it might get disabled there
+  aLine->EnableResizeReflowOptimization();
+
   aLineLayout.BeginLineReflow(x, aState.mY,
                               availWidth, availHeight,
                               impactedByFloats,
                               PR_FALSE /*XXX isTopOfPage*/);
 
   // XXX Unfortunately we need to know this before reflowing the first
   // inline frame in the line. FIX ME.
   if ((0 == aLineLayout.GetLineNumber()) &&
@@ -3219,17 +3224,16 @@ nsBlockFrame::DoReflowInlineFrames(nsBlo
   // keep track of the last overflow float in case we need to undo any new additions
   nsIFrame* lastPlaceholder = aState.mOverflowPlaceholders.LastChild();
 
   // Reflow the frames that are already on the line first
   nsresult rv = NS_OK;
   LineReflowStatus lineReflowStatus = LINE_REFLOW_OK;
   PRInt32 i;
   nsIFrame* frame = aLine->mFirstChild;
-  aLine->EnableResizeReflowOptimization();
 
   // Determine whether this is a line of placeholders for out-of-flow
   // continuations
   PRBool isContinuingPlaceholders = PR_FALSE;
 
   if (impactedByFloats) {
     // There is a soft break opportunity at the start of the line, because
     // we can always move this line down below float(s).
--- a/layout/generic/nsLineLayout.cpp
+++ b/layout/generic/nsLineLayout.cpp
@@ -244,16 +244,17 @@ nsLineLayout::BeginLineReflow(nscoord aX
       indent = mStyleText->mTextIndent.GetCoordValue();
     }
     else if (eStyleUnit_Percent == unit) {
       nscoord width =
         nsHTMLReflowState::GetContainingBlockContentWidth(mBlockReflowState);
       if ((0 != width) && (NS_UNCONSTRAINEDSIZE != width)) {
         indent = nscoord(mStyleText->mTextIndent.GetPercentValue() * width);
       }
+      mLineBox->DisableResizeReflowOptimization();
     }
 
     mTextIndent = indent;
 
     if (NS_STYLE_DIRECTION_RTL == psd->mDirection) {
       if (NS_UNCONSTRAINEDSIZE != psd->mRightEdge) {
         psd->mRightEdge -= indent;
       }