Bug 1225005 - Clamp negative values in containing block size. r=roc

This commit is contained in:
Mats Palmgren 2016-03-02 23:39:34 +01:00
parent a6b962bbed
commit 3078b89191
3 changed files with 7 additions and 5 deletions

View File

@ -0,0 +1,4 @@
<!DOCTYPE html>
<html>
<body style="padding: 810520769306363pt; -moz-column-count: 10; transform: translate(50%);"><div style="position: absolute;"></div></body>
</html>

View File

@ -618,3 +618,4 @@ load text-overflow-bug671796.xhtml
load text-overflow-bug713610.html
load text-overflow-form-elements.html
load text-overflow-iframe.html
asserts(4) load 1225005.html # bug 682647 and bug 448083

View File

@ -4629,12 +4629,9 @@ nsFrame::ReflowAbsoluteFrames(nsPresContext* aPresContext,
// The containing block for the abs pos kids is formed by our padding edge.
nsMargin usedBorder = GetUsedBorder();
nscoord containingBlockWidth =
aDesiredSize.Width() - usedBorder.LeftRight();
MOZ_ASSERT(containingBlockWidth >= 0);
std::max(0, aDesiredSize.Width() - usedBorder.LeftRight());
nscoord containingBlockHeight =
aDesiredSize.Height() - usedBorder.TopBottom();
MOZ_ASSERT(containingBlockHeight >= 0);
std::max(0, aDesiredSize.Height() - usedBorder.TopBottom());
nsContainerFrame* container = do_QueryFrame(this);
NS_ASSERTION(container, "Abs-pos children only supported on container frames for now");