зеркало из https://github.com/mozilla/gecko-dev.git
Bug 971655 - The inner (-moz-fieldset-content) frame have the correct padding area and is the abs.pos. containing block so don't use the outer FieldSetFrame. r=roc
This commit is contained in:
Родитель
855d61051d
Коммит
5e738ea28a
|
@ -891,11 +891,13 @@ CalculateContainingBlockSizeForAbsolutes(const nsHTMLReflowState& aReflowState,
|
|||
// frame and not always sticking them in block frames.
|
||||
|
||||
// First, find the reflow state for the outermost frame for this
|
||||
// content.
|
||||
// content, except for fieldsets where the inner anonymous frame has
|
||||
// the correct padding area with the legend taken into account.
|
||||
const nsHTMLReflowState* aLastRS = &aReflowState;
|
||||
const nsHTMLReflowState* lastButOneRS = &aReflowState;
|
||||
while (aLastRS->parentReflowState &&
|
||||
aLastRS->parentReflowState->frame->GetContent() == frame->GetContent()) {
|
||||
aLastRS->parentReflowState->frame->GetContent() == frame->GetContent() &&
|
||||
aLastRS->parentReflowState->frame->GetType() != nsGkAtoms::fieldSetFrame) {
|
||||
lastButOneRS = aLastRS;
|
||||
aLastRS = aLastRS->parentReflowState;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,79 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html><head>
|
||||
<meta charset="utf-8">
|
||||
<title>Testcase for bug 971653</title>
|
||||
<style type="text/css">
|
||||
html,body {
|
||||
color:black; background-color:white; font-size:16px; padding:0; margin:0;
|
||||
}
|
||||
|
||||
div {
|
||||
position: absolute;
|
||||
background: rgba(0,255,0,0.5);
|
||||
top:0; bottom:0;
|
||||
left:0; right:0;
|
||||
z-index: 0;
|
||||
}
|
||||
c {
|
||||
display: block;
|
||||
background: blue;
|
||||
height:100%;
|
||||
}
|
||||
|
||||
legend { height: 24px; }
|
||||
|
||||
fieldset {
|
||||
position: absolute;
|
||||
border: 2px green solid;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
margin-bottom:40px;
|
||||
}
|
||||
|
||||
#t1,#t3 { padding: 3px 5px 7px 11px; }
|
||||
#t2,#t4 { padding: 0; }
|
||||
|
||||
#t1 div, #t3 div {
|
||||
/* same numbers as padding above */
|
||||
left: -11px; right: -5px;
|
||||
top: -3px; bottom:-7px;
|
||||
}
|
||||
|
||||
#t2 { top: 120px; }
|
||||
#t3 { top: 240px; }
|
||||
#t4 { top: 360px; }
|
||||
|
||||
x {
|
||||
position: absolute;
|
||||
width:100px;
|
||||
height:100px;
|
||||
}
|
||||
#t1 x, #t2 x {
|
||||
height:78px; /* compensate for legend */
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<fieldset id="t1">
|
||||
<legend>legend</legend>
|
||||
<x><div></div><c></c></x>
|
||||
</fieldset>
|
||||
|
||||
<fieldset id="t2">
|
||||
<legend>legend</legend>
|
||||
<x><div></div></x>
|
||||
</fieldset>
|
||||
|
||||
<fieldset id="t3">
|
||||
<x><div></div><c></c></x>
|
||||
</fieldset>
|
||||
|
||||
<fieldset id="t4">
|
||||
<x><div></div></x>
|
||||
</fieldset>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,64 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html><head>
|
||||
<meta charset="utf-8">
|
||||
<title>Testcase for bug 971653</title>
|
||||
<style type="text/css">
|
||||
html,body {
|
||||
color:black; background-color:white; font-size:16px; padding:0; margin:0;
|
||||
}
|
||||
|
||||
div {
|
||||
position: absolute;
|
||||
background: rgba(0,255,0,0.5);
|
||||
top:0; bottom:0;
|
||||
left:0; right:0;
|
||||
z-index: 0;
|
||||
}
|
||||
c {
|
||||
display: block;
|
||||
background: blue;
|
||||
height:100%;
|
||||
}
|
||||
|
||||
legend { height: 24px; }
|
||||
|
||||
fieldset {
|
||||
position: absolute;
|
||||
border: 2px green solid;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
margin-bottom:40px;
|
||||
}
|
||||
|
||||
#t1,#t3 { padding: 3px 5px 7px 11px; }
|
||||
#t2,#t4 { padding: 0; }
|
||||
|
||||
#t2 { top: 120px; }
|
||||
#t3 { top: 240px; }
|
||||
#t4 { top: 360px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<fieldset id="t1">
|
||||
<legend>legend</legend>
|
||||
<div></div><c></c>
|
||||
</fieldset>
|
||||
|
||||
<fieldset id="t2">
|
||||
<legend>legend</legend>
|
||||
<div></div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset id="t3">
|
||||
<div></div><c></c>
|
||||
</fieldset>
|
||||
|
||||
<fieldset id="t4">
|
||||
<div></div>
|
||||
</fieldset>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -9,3 +9,4 @@ random-if(B2G) == fieldset-overflow-auto-1.html fieldset-overflow-auto-1-ref.htm
|
|||
== relpos-legend-1.html relpos-legend-1-ref.html
|
||||
== relpos-legend-2.html relpos-legend-2-ref.html
|
||||
test-pref(layout.css.sticky.enabled,true) == sticky-legend-1.html sticky-legend-1-ref.html
|
||||
== abs-pos-child-sizing.html abs-pos-child-sizing-ref.html
|
||||
|
|
Загрузка…
Ссылка в новой задаче