Bug 807565: Don't let border/padding push minimum content-box size for themed flex items below 0. r=mats

This commit is contained in:
Daniel Holbert 2014-01-06 19:17:26 -08:00
parent cea53677bb
commit 3ea9bcc426
4 changed files with 19 additions and 5 deletions

View File

@ -0,0 +1,2 @@
<!DOCTYPE html>
<html><ul style="display: flex;"><li style="-moz-appearance: treetwistyopen; padding-left: 536870913em;"></li></ul></html>

View File

@ -0,0 +1,8 @@
<!DOCTYPE html>
<html>
<div style="display: flex">
<div style="-moz-appearance: treetwistyopen; padding-left: 536870913em;">
<div style="float: left"></div>
</div>
</div>
</html>

View File

@ -488,6 +488,8 @@ load 799207-1.html
load 799207-2.html
load 801268-1.html
load 804089-1.xhtml
load 807565-1.html
load 807565-2.html
load 810726.html
load 825810-1.html
load 825810-2.html

View File

@ -835,11 +835,13 @@ nsFlexContainerFrame::GenerateFlexItemForChild(
aPresContext->DevPixelsToAppUnits(
aAxisTracker.GetCrossComponent(widgetMinSize));
// GMWS() returns border-box; we need content-box
widgetMainMinSize -=
aAxisTracker.GetMarginSizeInMainAxis(childRS.ComputedPhysicalBorderPadding());
widgetCrossMinSize -=
aAxisTracker.GetMarginSizeInCrossAxis(childRS.ComputedPhysicalBorderPadding());
// GMWS() returns border-box. We need content-box, so subtract
// borderPadding (but don't let that push our min sizes below 0).
nsMargin& bp = childRS.ComputedPhysicalBorderPadding();
widgetMainMinSize = std::max(widgetMainMinSize -
aAxisTracker.GetMarginSizeInMainAxis(bp), 0);
widgetCrossMinSize = std::max(widgetCrossMinSize -
aAxisTracker.GetMarginSizeInCrossAxis(bp), 0);
if (!canOverride) {
// Fixed-size widget: freeze our main-size at the widget's mandated size.