Bug 823483 patch 5 - Make (again) percentage width on text inputs make intrinsic minimum width be 0. r=dholbert

This restores the quirky behavior for text inputs, which was removed by
patch 2, but only halfway (for width but not max-width), which matches
Chromium and Edge.
This commit is contained in:
L. David Baron 2016-02-04 09:43:02 +11:00
parent 07fb9e7d19
commit 4a26b9b900
2 changed files with 7 additions and 4 deletions

View File

@ -4543,11 +4543,14 @@ AddIntrinsicSizeOffset(nsRenderingContext* aRenderingContext,
nscoord size; nscoord size;
if (aType == nsLayoutUtils::MIN_ISIZE && if (aType == nsLayoutUtils::MIN_ISIZE &&
(aStyleSize.HasPercent() || (((aStyleSize.HasPercent() || aStyleMaxSize.HasPercent()) &&
aStyleMaxSize.HasPercent()) && aFrame->IsFrameOfType(nsIFrame::eReplacedSizing)) ||
aFrame->IsFrameOfType(nsIFrame::eReplacedSizing)) { (aStyleSize.HasPercent() &&
aFrame->GetType() == nsGkAtoms::textInputFrame))) {
// A percentage width or max-width on replaced elements means they // A percentage width or max-width on replaced elements means they
// can shrink to 0. // can shrink to 0.
// This is also true for percentage widths (but not max-widths) on
// text inputs.
// Note that if this is max-width, this overrides the fixed-width // Note that if this is max-width, this overrides the fixed-width
// rule in the next condition. // rule in the next condition.
result = 0; // let |min| handle padding/border/margin result = 0; // let |min| handle padding/border/margin

View File

@ -58,7 +58,7 @@ skip-if(B2G||Mulet) == 28811-1a.html 28811-1-ref.html # Initial mulet triage: pa
fuzzy-if(gtkWidget,6,26200) == 28811-1b.html 28811-1-ref.html # Bug 1128229 fuzzy-if(gtkWidget,6,26200) == 28811-1b.html 28811-1-ref.html # Bug 1128229
skip-if(B2G||Mulet) == 28811-2a.html 28811-2-ref.html # Initial mulet triage: parity with B2G/B2G Desktop skip-if(B2G||Mulet) == 28811-2a.html 28811-2-ref.html # Initial mulet triage: parity with B2G/B2G Desktop
fuzzy-if(gtkWidget,6,26200) == 28811-2b.html 28811-2-ref.html # Bug 1128229 fuzzy-if(gtkWidget,6,26200) == 28811-2b.html 28811-2-ref.html # Bug 1128229
!= 40596-1a.html 40596-1-ref.html == 40596-1a.html 40596-1-ref.html
!= 40596-1b.html 40596-1-ref.html != 40596-1b.html 40596-1-ref.html
!= 40596-1c.html 40596-1-ref.html != 40596-1c.html 40596-1-ref.html
!= 40596-1d.html 40596-1-ref.html != 40596-1d.html 40596-1-ref.html