Subtract the correct border+padding. (Bug 546048) r=roc

This commit is contained in:
L. David Baron 2010-04-04 14:46:15 -07:00
parent dc591bae4a
commit 238beaa031
4 changed files with 79 additions and 1 deletions

View File

@ -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);
}

View File

@ -0,0 +1,29 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Testcase, bug 546048</title>
<style type="text/css">
body { font-size: 10px }
dl { min-height: 35px; }
dt { float: left; width: 50%; padding-left: 45px; }
span { float: left; }
</style>
</head>
<body>
<dl>
<dt>
<span><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAAXNSR0IArs4c6QAAAChJREFUSMftzUENAAAIBKDT/p01hQ83KEDN5FQnAoFAIBAIBAKB4EewtloCPhS2RvMAAAAASUVORK5CYII="></span> Heading<br />
This is the line that overlaps the float.
</dl>
<dl>
<dt>
<span><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAAXNSR0IArs4c6QAAAChJREFUSMftzUENAAAIBKDT/p01hQ83KEDN5FQnAoFAIBAIBAKB4EewtloCPhS2RvMAAAAASUVORK5CYII="></span> Heading<br />
Here's an equivalent line where we don't simulate the image loading after the page.
</dl>
</body>
</html>

View File

@ -0,0 +1,48 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Testcase, bug 546048</title>
<script type="text/javascript">
// Simulate the image loading after the page loads.
function move_image()
{
var img = document.querySelector("img");
var root = document.documentElement;
img.style.width='5px';
root.style.display='none';
img.offsetHeight;
root.style.display='';
img.offsetHeight;
img.style.width='';
}
window.addEventListener("load", move_image, false);
</script>
<style type="text/css">
body { font-size: 10px }
dl { min-height: 35px; }
dt { float: left; width: 50%; padding-left: 45px; }
span { float: left; }
</style>
</head>
<body>
<dl>
<dt>
<span><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAAXNSR0IArs4c6QAAAChJREFUSMftzUENAAAIBKDT/p01hQ83KEDN5FQnAoFAIBAIBAKB4EewtloCPhS2RvMAAAAASUVORK5CYII="></span> Heading<br />
This is the line that overlaps the float.
</dl>
<dl>
<dt>
<span><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAAXNSR0IArs4c6QAAAChJREFUSMftzUENAAAIBKDT/p01hQ83KEDN5FQnAoFAIBAIBAKB4EewtloCPhS2RvMAAAAASUVORK5CYII="></span> Heading<br />
Here's an equivalent line where we don't simulate the image loading after the page.
</dl>
</body>
</html>

View File

@ -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