From: L. David Baron Subtract the correct border+padding. (Bug 546048) diff --git a/layout/generic/nsBlockReflowState.cpp b/layout/generic/nsBlockReflowState.cpp --- a/layout/generic/nsBlockReflowState.cpp +++ b/layout/generic/nsBlockReflowState.cpp @@ -938,17 +938,17 @@ nsBlockReflowState::FlowAndPlaceFloat(ns // If the float's dimensions have changed, note the damage in the // float manager. if (region != oldRegion) { // XXXwaterson conservative: we could probably get away with noting // less damage; e.g., if only height has changed, then only note the // area into which the float has grown or from which the float has // shrunk. nscoord top = NS_MIN(region.y, oldRegion.y) - borderPadding.top; - nscoord bottom = NS_MAX(region.YMost(), oldRegion.YMost()) - borderPadding.left; + nscoord bottom = NS_MAX(region.YMost(), oldRegion.YMost()) - borderPadding.top; mFloatManager->IncludeInDamage(top, bottom); } #ifdef NOISY_FLOATMANAGER nscoord tx, ty; mFloatManager->GetTranslation(tx, ty); nsFrame::ListTag(stdout, mBlock); printf(": FlowAndPlaceFloat: AddFloat: txy=%d,%d (%d,%d) {%d,%d,%d,%d}\n", diff --git a/layout/reftests/floats/546048-1-ref.html b/layout/reftests/floats/546048-1-ref.html new file mode 100644 --- /dev/null +++ b/layout/reftests/floats/546048-1-ref.html @@ -0,0 +1,29 @@ + + + +Testcase, bug 546048 + + + + + +
+
+ Heading
+ This is the line that overlaps the float. +
+
+
+ Heading
+ Here's an equivalent line where we don't simulate the image loading after the page. +
+ + + diff --git a/layout/reftests/floats/546048-1.html b/layout/reftests/floats/546048-1.html new file mode 100644 --- /dev/null +++ b/layout/reftests/floats/546048-1.html @@ -0,0 +1,48 @@ + + + +Testcase, bug 546048 + + + + + + + +
+
+ Heading
+ This is the line that overlaps the float. +
+
+
+ Heading
+ Here's an equivalent line where we don't simulate the image loading after the page. +
+ + + diff --git a/layout/reftests/floats/reftest.list b/layout/reftests/floats/reftest.list --- a/layout/reftests/floats/reftest.list +++ b/layout/reftests/floats/reftest.list @@ -14,8 +14,9 @@ fails == other-float-outside-rule-7-righ == zero-height-float-base.html zero-height-float-ref.html fails == zero-height-float.html zero-height-float-ref.html fails == 345369-1.html 345369-1-ref.html fails == 345369-2.html 345369-2-ref.html == 345369-3.html 345369-3-ref.html == 345369-4.html 345369-4-ref.html == 345369-5.html 345369-5-ref.html == 429974-1.html 429974-1-ref.html +== 546048-1.html 546048-1-ref.html