From 3b0453e3381d52d4aa44810037d0b953cde1d1e7 Mon Sep 17 00:00:00 2001 From: "L. David Baron" Date: Sun, 4 Apr 2010 14:46:15 -0700 Subject: [PATCH] Subtract the correct border+padding. (Bug 546048) r=roc --- layout/generic/nsBlockReflowState.cpp | 2 +- layout/reftests/floats/546048-1-ref.html | 29 ++++++++++++++ layout/reftests/floats/546048-1.html | 48 ++++++++++++++++++++++++ layout/reftests/floats/reftest.list | 1 + 4 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 layout/reftests/floats/546048-1-ref.html create mode 100644 layout/reftests/floats/546048-1.html diff --git a/layout/generic/nsBlockReflowState.cpp b/layout/generic/nsBlockReflowState.cpp index e8e92badf1e..b70439ab59c 100644 --- a/layout/generic/nsBlockReflowState.cpp +++ b/layout/generic/nsBlockReflowState.cpp @@ -943,7 +943,7 @@ nsBlockReflowState::FlowAndPlaceFloat(nsIFrame* aFloat, // 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); } diff --git a/layout/reftests/floats/546048-1-ref.html b/layout/reftests/floats/546048-1-ref.html new file mode 100644 index 00000000000..b12cfee4cfc --- /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 index 00000000000..502bd0bf67c --- /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 index c2aacff54dc..7b865445554 100644 --- a/layout/reftests/floats/reftest.list +++ b/layout/reftests/floats/reftest.list @@ -19,3 +19,4 @@ fails == 345369-2.html 345369-2-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