mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 15:23:51 +00:00
Bug 599882. Make baselines not depend on relative positioning of kids. r=dbaron
This commit is contained in:
parent
dd82a0d964
commit
0eba625d0e
@ -3418,7 +3418,8 @@ nsLayoutUtils::GetFirstLinePosition(const nsIFrame* aFrame,
|
||||
nsIFrame* kid = aFrame->GetFirstPrincipalChild();
|
||||
// kid might be a legend frame here, but that's ok.
|
||||
if (GetFirstLinePosition(kid, &kidPosition)) {
|
||||
*aResult = kidPosition + kid->GetPosition().y;
|
||||
*aResult = kidPosition + (kid->GetPosition().y -
|
||||
kid->GetRelativeOffset().y);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -3435,7 +3436,8 @@ nsLayoutUtils::GetFirstLinePosition(const nsIFrame* aFrame,
|
||||
nsIFrame *kid = line->mFirstChild;
|
||||
LinePosition kidPosition;
|
||||
if (GetFirstLinePosition(kid, &kidPosition)) {
|
||||
*aResult = kidPosition + kid->GetPosition().y;
|
||||
*aResult = kidPosition + (kid->GetPosition().y -
|
||||
kid->GetRelativeOffset().y);
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
@ -3468,12 +3470,14 @@ nsLayoutUtils::GetLastLineBaseline(const nsIFrame* aFrame, nscoord* aResult)
|
||||
nsIFrame *kid = line->mFirstChild;
|
||||
nscoord kidBaseline;
|
||||
if (GetLastLineBaseline(kid, &kidBaseline)) {
|
||||
*aResult = kidBaseline + kid->GetPosition().y;
|
||||
// Ignore relative positioning for baseline calculations
|
||||
*aResult = kidBaseline + kid->GetPosition().y -
|
||||
kid->GetRelativeOffset().y;
|
||||
return true;
|
||||
} else if (kid->GetType() == nsGkAtoms::scrollFrame) {
|
||||
// Use the bottom of the scroll frame.
|
||||
// XXX CSS2.1 really doesn't say what to do here.
|
||||
*aResult = kid->GetRect().YMost();
|
||||
*aResult = kid->GetRect().YMost() - kid->GetRelativeOffset().y;
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
|
@ -1082,7 +1082,7 @@ public:
|
||||
}
|
||||
};
|
||||
static bool GetFirstLinePosition(const nsIFrame* aFrame,
|
||||
LinePosition* aResult);
|
||||
LinePosition* aResult);
|
||||
|
||||
|
||||
/**
|
||||
|
18
layout/reftests/bugs/599882-1-ref.html
Normal file
18
layout/reftests/bugs/599882-1-ref.html
Normal file
@ -0,0 +1,18 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
.positioned {
|
||||
display:block;
|
||||
}
|
||||
|
||||
.container {
|
||||
display:inline-block;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<span style="vertical-align: baseline">Baseline aligned</span>
|
||||
<span class="container"><span class="positioned"> </span></span>
|
||||
</body>
|
||||
</html>
|
21
layout/reftests/bugs/599882-1a.html
Normal file
21
layout/reftests/bugs/599882-1a.html
Normal file
@ -0,0 +1,21 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
.positioned {
|
||||
display:block;
|
||||
position: relative;
|
||||
top:200px;
|
||||
}
|
||||
|
||||
.container {
|
||||
display:inline-block;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<span style="vertical-align: baseline">Baseline aligned</span>
|
||||
<span class="container"><span class="positioned"> </span></span>
|
||||
</body>
|
||||
</html>
|
21
layout/reftests/bugs/599882-1b.html
Normal file
21
layout/reftests/bugs/599882-1b.html
Normal file
@ -0,0 +1,21 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
.positioned {
|
||||
display:block;
|
||||
position: relative;
|
||||
top:200px;
|
||||
}
|
||||
|
||||
.container {
|
||||
display:inline-table;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<span style="vertical-align: baseline">Baseline aligned</span>
|
||||
<span class="container"><span class="positioned"> </span></span>
|
||||
</body>
|
||||
</html>
|
9
layout/reftests/bugs/599882-2-ref.html
Normal file
9
layout/reftests/bugs/599882-2-ref.html
Normal file
@ -0,0 +1,9 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<ul>
|
||||
<li>
|
||||
<div class="positioned"> </div>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
19
layout/reftests/bugs/599882-2.html
Normal file
19
layout/reftests/bugs/599882-2.html
Normal file
@ -0,0 +1,19 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
.positioned {
|
||||
position: relative;
|
||||
top:200px;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<ul>
|
||||
<li>
|
||||
<div class="positioned"> </div>
|
||||
</li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
@ -1589,6 +1589,9 @@ skip-if(!browserIsRemote) == 593243-2.html 593243-2-ref.html # bug 593168
|
||||
random-if(winWidget) needs-focus == 598726-1.html 598726-1-ref.html # Fails on Windows, bug 782196
|
||||
== 599113-1.html 599113-1-ref.html
|
||||
fails-if(!haveTestPlugin) == 599476.html 599476-ref.html
|
||||
== 599882-1a.html 599882-1-ref.html
|
||||
== 599882-1b.html 599882-1-ref.html
|
||||
== 599882-2.html 599882-2-ref.html
|
||||
== 600045-1.html 600045-1-ref.html
|
||||
== 600803-1.html 600803-1-ref.html
|
||||
== 603423-1.html 603423-1-ref.html
|
||||
|
Loading…
Reference in New Issue
Block a user