Bug 931853 - Adjust the frame's vertical position to account for a negative margin larger than its height, in quirks mode. r=roc

This commit is contained in:
Mats Palmgren 2013-11-12 18:38:29 +00:00
parent 23f855d951
commit d587273433
6 changed files with 100 additions and 2 deletions

View File

@ -1763,8 +1763,12 @@ nsLineLayout::VerticalAlignFrames(PerSpanData* psd)
else {
// For other elements the logical height is the same as the
// frames height plus its margins.
logicalHeight = pfd->mBounds.height + pfd->mMargin.top +
pfd->mMargin.bottom;
logicalHeight = pfd->mBounds.height + pfd->mMargin.TopBottom();
if (logicalHeight < 0 &&
mPresContext->CompatibilityMode() == eCompatibility_NavQuirks) {
pfd->mAscent -= logicalHeight;
logicalHeight = 0;
}
}
// Get vertical-align property

View File

@ -0,0 +1,23 @@
<!DOCTYPE HTML>
<html><head>
<meta charset="utf-8">
<title>Testcase for bug 931853</title>
<style type="text/css">
html,body {
color:black; background-color:white; font-size:16px; padding:10px; margin:0;
}
div { height:7em; margin-bottom:2px; overflow:hidden; border:1px solid black;}
img { margin-left:30px; margin-top:-150px; vertical-align:top; }
span { display:inline-block; position:relative; height:0; xborder:1px solid red; }
</style>
</head>
<body>
<div><br><br><br><span style="bottom:50px "><img src="data:image/gif;base64,R0lGODlhAQABAIABAAD/AP///ywAAAAAAQABAAACAkQBADs=" width="350" height="150"></span></div>
<div><br><br><br><span style="bottom:20px "><img src="data:image/gif;base64,R0lGODlhAQABAIABAAD/AP///ywAAAAAAQABAAACAkQBADs=" width="350" height="150"></div>
<div><br><br><br><span style="bottom:0px "><img src="data:image/gif;base64,R0lGODlhAQABAIABAAD/AP///ywAAAAAAQABAAACAkQBADs=" width="350" height="150"></div>
<div><br><br><br><span style="bottom:120px"><img src="data:image/gif;base64,R0lGODlhAQABAIABAAD/AP///ywAAAAAAQABAAACAkQBADs=" width="350" height="150" style="margin-top:0px"></div>
</body>
</html>

View File

@ -0,0 +1,22 @@
<html><head>
<meta charset="utf-8">
<title>Testcase for bug 931853</title>
<style type="text/css">
html,body {
color:black; background-color:white; font-size:16px; padding:10px; margin:0;
}
div { height:7em; margin-bottom:2px; overflow:hidden; border:1px solid black;}
img { margin-left:30px; }
</style>
</head>
<body>
<div><br><br><br><img src="data:image/gif;base64,R0lGODlhAQABAIABAAD/AP///ywAAAAAAQABAAACAkQBADs=" width="350" height="150" style="margin-top:-200px"></div>
<div><br><br><br><img src="data:image/gif;base64,R0lGODlhAQABAIABAAD/AP///ywAAAAAAQABAAACAkQBADs=" width="350" height="150" style="margin-top:-170px"></div>
<div><br><br><br><img src="data:image/gif;base64,R0lGODlhAQABAIABAAD/AP///ywAAAAAAQABAAACAkQBADs=" width="350" height="150" style="margin-top:-150px"></div>
<div><br><br><br><img src="data:image/gif;base64,R0lGODlhAQABAIABAAD/AP///ywAAAAAAQABAAACAkQBADs=" width="350" height="150" style="margin-top:-120px"></div>
</body>
</html>

View File

@ -0,0 +1,24 @@
<!DOCTYPE HTML>
<html><head>
<meta charset="utf-8">
<title>Testcase for bug 931853</title>
<style type="text/css">
html,body {
color:black; background-color:white; font-size:16px; padding:10px; margin:0;
}
div { height:7em; margin-bottom:2px; overflow:hidden; border:1px solid black;}
img { margin-left:30px; margin-top:-150px; }
span { display:inline-block; height:0px; position:relative; line-height:0; }
</style>
</head>
<body>
<div><br><br><br><span style="bottom:0px "><img src="data:image/gif;base64,R0lGODlhAQABAIABAAD/AP///ywAAAAAAQABAAACAkQBADs=" width="350" height="150"></span></div>
<div><br><br><br><span style="bottom:0px "><img src="data:image/gif;base64,R0lGODlhAQABAIABAAD/AP///ywAAAAAAQABAAACAkQBADs=" width="350" height="150"></div>
<div><br><br><br><span style="bottom:0px "><img src="data:image/gif;base64,R0lGODlhAQABAIABAAD/AP///ywAAAAAAQABAAACAkQBADs=" width="350" height="150"></div>
<div><br><br><br><span style="bottom:120px"><img src="data:image/gif;base64,R0lGODlhAQABAIABAAD/AP///ywAAAAAAQABAAACAkQBADs=" width="350" height="150" style="margin-top:0px"></div>
</body>
</html>

View File

@ -0,0 +1,23 @@
<!DOCTYPE HTML>
<html><head>
<meta charset="utf-8">
<title>Testcase for bug 931853</title>
<style type="text/css">
html,body {
color:black; background-color:white; font-size:16px; padding:10px; margin:0;
}
div { height:7em; margin-bottom:2px; overflow:hidden; border:1px solid black;}
img { margin-left:30px; }
</style>
</head>
<body>
<div><br><br><br><img src="data:image/gif;base64,R0lGODlhAQABAIABAAD/AP///ywAAAAAAQABAAACAkQBADs=" width="350" height="150" style="margin-top:-200px"></div>
<div><br><br><br><img src="data:image/gif;base64,R0lGODlhAQABAIABAAD/AP///ywAAAAAAQABAAACAkQBADs=" width="350" height="150" style="margin-top:-170px"></div>
<div><br><br><br><img src="data:image/gif;base64,R0lGODlhAQABAIABAAD/AP///ywAAAAAAQABAAACAkQBADs=" width="350" height="150" style="margin-top:-150px"></div>
<div><br><br><br><img src="data:image/gif;base64,R0lGODlhAQABAIABAAD/AP///ywAAAAAAQABAAACAkQBADs=" width="350" height="150" style="margin-top:-120px"></div>
</body>
</html>

View File

@ -1779,4 +1779,6 @@ fuzzy(1,10000) fuzzy-if(Android&&AndroidVersion>=15,5,10000) == 902330-1.html 90
fuzzy-if(Android,8,400) == 906199-1.html 906199-1-ref.html
== 921716-1.html 921716-1-ref.html
fuzzy-if(cocoaWidget,1,40) == 928607-1.html 928607-1-ref.html
== 931853.html 931853-ref.html
== 931853-quirks.html 931853-quirks-ref.html
== 931464-1.html 931464-1-ref.html