Bug 400171: check line mCombinedArea (along with mBounds) to find float damage. r+sr=roc, a=blocking1.9+
authordholbert@cs.stanford.edu
Wed, 07 Nov 2007 12:07:54 -0800
changeset 7668 e7737bd09e65b759aa4859b6c72ace9dc1ff7637
parent 7667 f4855ed2fb5b327e8885011074a70b45891d4bee
child 7669 3e62d6c087f68cf9d1ab3d4677ed3d3b0c508da8
push idunknown
push userunknown
push dateunknown
reviewersblocking1.9
bugs400171
milestone1.9b2pre
Bug 400171: check line mCombinedArea (along with mBounds) to find float damage. r+sr=roc, a=blocking1.9+
layout/generic/nsBlockFrame.cpp
layout/reftests/bugs/reftest.list
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -1613,19 +1613,24 @@ nsBlockFrame::PropagateFloatDamage(nsBlo
 
   // Check to see if there are any floats; if there aren't, there can't
   // be any float damage
   if (!spaceManager->HasAnyFloats())
     return;
 
   // Check the damage region recorded in the float damage.
   if (spaceManager->HasFloatDamage()) {
+    // Need to check mBounds *and* mCombinedArea to find intersections 
+    // with aLine's floats
     nscoord lineYA = aLine->mBounds.y + aDeltaY;
     nscoord lineYB = lineYA + aLine->mBounds.height;
-    if (spaceManager->IntersectsDamage(lineYA, lineYB)) {
+    nscoord lineYCombinedA = aLine->GetCombinedArea().y + aDeltaY;
+    nscoord lineYCombinedB = lineYCombinedA + aLine->GetCombinedArea().height;
+    if (spaceManager->IntersectsDamage(lineYA, lineYB) ||
+        spaceManager->IntersectsDamage(lineYCombinedA, lineYCombinedB)) {
       aLine->MarkDirty();
       return;
     }
   }
 
   // Check if the line is moving relative to the space manager
   if (aDeltaY + aState.mReflowState.mBlockDelta != 0) {
     if (aLine->IsBlock()) {
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -423,15 +423,15 @@ fails == 393655-2.html 393655-2-ref.html
 == 395331-1.xml 395331-1-ref.xml
 == 396286-1.html about:blank  # crash test
 == 398289-1.html 398289-1-ref.html
 == 398797-1a.html 398797-1-ref.html
 == 398797-1b.html 398797-1-ref.html
 == 398797-1c.html 398797-1-ref.html
 == 398797-1d.html 398797-1-ref.html
 == 399384-1.html 399384-1-ref.html
-fails == 400171-1a.html 400171-1-ref.html # Remove 'fails' when 400171 lands
+== 400171-1a.html 400171-1-ref.html
 == 400171-1b.html 400171-1-ref.html
 == 400171-1c.html 400171-1-ref.html
-fails == 400171-2a.html 400171-2-ref.html # Remove 'fails' when 400171 lands
+== 400171-2a.html 400171-2-ref.html
 == 400171-2b.html 400171-2-ref.html
-fails == 400171-2c.html 400171-2-ref.html # Remove 'fails' when 400171 lands
+== 400171-2c.html 400171-2-ref.html
 == 400421-1.html 400421-1-ref.html