зеркало из https://github.com/mozilla/gecko-dev.git
Fix double-subtraction of opposite margin when one of margin-top/bottom is auto, for absolutely positioned elements. (Bug 604212) r=bzbarsky a2.0=roc
This commit is contained in:
Родитель
04084f782b
Коммит
a0c2fd0719
|
@ -1404,11 +1404,11 @@ nsHTMLReflowState::InitAbsoluteConstraints(nsPresContext* aPresContext,
|
|||
mComputedMargin.bottom = availMarginSpace - mComputedMargin.top;
|
||||
} else {
|
||||
// Just 'margin-top' is 'auto'
|
||||
mComputedMargin.top = availMarginSpace - mComputedMargin.bottom;
|
||||
mComputedMargin.top = availMarginSpace;
|
||||
}
|
||||
} else {
|
||||
// Just 'margin-bottom' is 'auto'
|
||||
mComputedMargin.bottom = availMarginSpace - mComputedMargin.top;
|
||||
mComputedMargin.bottom = availMarginSpace;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>'auto' top and bottom margins on absolutely positioned elements</title>
|
||||
<style>
|
||||
|
||||
body > div {
|
||||
position: relative;
|
||||
height: 100px;
|
||||
border: medium solid;
|
||||
}
|
||||
|
||||
body > div > div {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
height: 40px;
|
||||
width: 10px;
|
||||
background: blue;
|
||||
}
|
||||
|
||||
</style>
|
||||
<div>
|
||||
<div style="left: 10px;top: 10px"></div>
|
||||
<div style="left: 30px;top: 40px"></div>
|
||||
<div style="left: 50px;top: 10px"></div>
|
||||
<div style="left: 70px;top: 30px"></div>
|
||||
</div>
|
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE HTML>
|
||||
<title>'auto' top and bottom margins on absolutely positioned elements</title>
|
||||
<style>
|
||||
|
||||
body > div {
|
||||
position: relative;
|
||||
height: 100px;
|
||||
border: medium solid;
|
||||
}
|
||||
|
||||
body > div > div {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
height: 40px;
|
||||
width: 10px;
|
||||
background: blue;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
</style>
|
||||
<div>
|
||||
<div style="left: 10px;"></div>
|
||||
<div style="left: 30px;margin-top: auto"></div>
|
||||
<div style="left: 50px;margin-bottom: auto"></div>
|
||||
<div style="left: 70px;margin-top: auto; margin-bottom: auto"></div>
|
||||
</div>
|
|
@ -1 +1,2 @@
|
|||
== font-size-wrap.html font-size-wrap-ref.html
|
||||
== abs-pos-auto-margin-1.html abs-pos-auto-margin-1-ref.html
|
||||
|
|
Загрузка…
Ссылка в новой задаче