mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1128354: Don't optimize away a flex item's second reflow, if it has percent-height children. r=mats
This commit is contained in:
parent
9a8c12e67d
commit
2fe25b94dc
@ -3695,11 +3695,19 @@ nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
|
||||
// that reflow the same as its final (post-flexing/stretching) size?
|
||||
if (finalFlexedPhysicalSize ==
|
||||
item->Frame()->GetContentRectRelativeToSelf().Size()) {
|
||||
// It has the correct size --> no need to reflow! Just make sure it's
|
||||
// at the right position.
|
||||
itemNeedsReflow = false;
|
||||
MoveFlexItemToFinalPosition(aReflowState, *item, framePos,
|
||||
containerWidth);
|
||||
// Even if our size hasn't changed, some of our descendants might
|
||||
// care that our height is now considered "definite" (whereas it
|
||||
// wasn't in our previous "measuring" reflow), if they have a
|
||||
// relative height.
|
||||
if (!(item->Frame()->GetStateBits() &
|
||||
NS_FRAME_CONTAINS_RELATIVE_HEIGHT)) {
|
||||
// Item has the correct size (and its children don't care that
|
||||
// it's now "definite"). Let's just make sure it's at the right
|
||||
// position.
|
||||
itemNeedsReflow = false;
|
||||
MoveFlexItemToFinalPosition(aReflowState, *item, framePos,
|
||||
containerWidth);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (itemNeedsReflow) {
|
||||
|
35
layout/reftests/bugs/1128354-1-ref.html
Normal file
35
layout/reftests/bugs/1128354-1-ref.html
Normal file
@ -0,0 +1,35 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<style>
|
||||
.flexVert {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.flexIntermediateHoriz {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.flexInnerHoriz {
|
||||
display: flex;
|
||||
background: pink;
|
||||
}
|
||||
|
||||
.spacer {
|
||||
background: lightblue;
|
||||
height: 200px;
|
||||
width: 50px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="flexVert">
|
||||
<div class="flexIntermediateHoriz">
|
||||
<div class="flexInnerHoriz">text</div>
|
||||
<div class="spacer"></div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
37
layout/reftests/bugs/1128354-1.html
Normal file
37
layout/reftests/bugs/1128354-1.html
Normal file
@ -0,0 +1,37 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<style>
|
||||
.flexVert {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.flexIntermediateHoriz {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.flexInnerHoriz {
|
||||
display: flex;
|
||||
height: 100%; /* If you delete this line, then pink area is stretched
|
||||
to have its height match blue area. */
|
||||
background: pink;
|
||||
}
|
||||
|
||||
.spacer {
|
||||
background: lightblue;
|
||||
height: 200px;
|
||||
width: 50px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="flexVert">
|
||||
<div class="flexIntermediateHoriz">
|
||||
<div class="flexInnerHoriz">text</div>
|
||||
<div class="spacer"></div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1868,5 +1868,6 @@ fuzzy-if(d2d,36,304) HTTP(..) == 1116480-1-fakeitalic-overflow.html 1116480-1-fa
|
||||
== 1127107-1b-pre.html 1127107-1-ref.html
|
||||
== 1127107-2-capitalize.html 1127107-2-capitalize-ref.html
|
||||
== 1127679-1a-inline-flex-relpos.html 1127679-1b-inline-flex-relpos.html
|
||||
== 1128354-1.html 1128354-1-ref.html
|
||||
== 1130231-1-button-padding-rtl.html 1130231-1-button-padding-rtl-ref.html
|
||||
== 1130231-2-button-padding-rtl.html 1130231-2-button-padding-rtl-ref.html
|
||||
|
Loading…
Reference in New Issue
Block a user