Closed
Bug 1317168
Opened 7 years ago
Closed 7 years ago
[css-grid] Assertion failure: inflation != 1.0f || ancestorAutoSize.ISize(aWM) == autoSize.ISize(aWM) (Incorrect size computed by ComputeAutoSize?), at layout/forms/nsTextControlFrame.cpp:504
Categories
(Core :: Layout, defect)
Core
Layout
Tracking
()
RESOLVED
FIXED
mozilla53
Tracking | Status | |
---|---|---|
firefox49 | --- | unaffected |
firefox50 | --- | unaffected |
firefox51 | --- | unaffected |
firefox52 | --- | fixed |
firefox53 | --- | fixed |
People
(Reporter: MatsPalmgren_bugz, Assigned: MatsPalmgren_bugz)
References
(Blocks 1 open bug)
Details
(Keywords: assertion, regression, testcase)
Attachments
(3 files, 1 obsolete file)
2.73 KB,
patch
|
dholbert
:
review+
|
Details | Diff | Splinter Review |
8.11 KB,
patch
|
Details | Diff | Splinter Review | |
9.15 KB,
patch
|
dholbert
:
review+
jcristau
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
data:text/html,<div style="display:grid; grid:100px/100px"><input></div>
Assignee | ||
Comment 1•7 years ago
|
||
Attachment #8810266 -
Flags: review?(dholbert)
Assignee | ||
Comment 2•7 years ago
|
||
The problem was that nsContainerFrame::ComputeAutoSize is affected by min-size clamping whereas CalcIntrinsicSize is not. So we need to return the potentially clamped ISize, and only assert they produce the same ISize otherwise.
Attachment #8810267 -
Flags: review?(dholbert)
Assignee | ||
Comment 3•7 years ago
|
||
Assignee | ||
Comment 4•7 years ago
|
||
FYI, the change to GetPrefISize actually does change the reflow logging slightly. IIRC, we GetPref/MinISize needs to follow the pattern DISPLAY_PREF_WIDTH(this, result); ... result = ...; return result; because these macros logs the 'result' value on exit. The current GetPrefISize code fails to do that, so I fixed it while I'm here.
Attachment #8810266 -
Attachment is obsolete: true
Attachment #8810266 -
Flags: review?(dholbert)
Attachment #8810269 -
Flags: review?(dholbert)
Assignee | ||
Updated•7 years ago
|
Attachment #8810269 -
Attachment description: part 1 - nsTextControlFrame::CalcIntrinsicSize is infallible so make it return the size result rather than NS_OK. Also, make it const. (idempotent patch) → part 1 - nsTextControlFrame::CalcIntrinsicSize is infallible so make it return the size result rather than NS_OK. Also, make it const.
Updated•7 years ago
|
status-firefox49:
--- → unaffected
status-firefox50:
--- → unaffected
status-firefox51:
--- → unaffected
Updated•7 years ago
|
status-firefox53:
--- → affected
Comment 5•7 years ago
|
||
Comment on attachment 8810269 [details] [diff] [review] part 1 - nsTextControlFrame::CalcIntrinsicSize is infallible so make it return the size result rather than NS_OK. Also, make it const. Review of attachment 8810269 [details] [diff] [review]: ----------------------------------------------------------------- r=me
Attachment #8810269 -
Flags: review?(dholbert) → review+
Comment 6•7 years ago
|
||
Comment on attachment 8810267 [details] [diff] [review] part 2 - [css-grid] Use the nsContainerFrame::ComputeAutoSize result when it might have been clamped. Review of attachment 8810267 [details] [diff] [review]: ----------------------------------------------------------------- Commit message nit: > Bug 1317168 part 2 - [css-grid] Use the nsContainerFrame::ComputeAutoSize result when it might have been clamped. r=dholbert This is a bit too generic -- it should mention "text frames" or "nsTextControlFrame" somewhere. ::: layout/forms/nsTextControlFrame.cpp @@ +477,5 @@ > float inflation = nsLayoutUtils::FontSizeInflationFor(this); > LogicalSize autoSize = CalcIntrinsicSize(aRenderingContext, aWM, inflation); > + > + // Note: nsContainerFrame::ComputeAutoSize only computes the inline-size, and > + // only for 'auto'. The returned block-size is always NS_UNCONSTRAINEDSIZE. Please reword this last sentence to make it clearer *whose* returned block size you're talking about. (this method here? nsContainerFrame::ComputeAutoSize? or both? Right now I can't tell) (e.g. if you're just specifically talking about nsContainerFrame impl in this last sentence, then s/The returned/Its returned/.) @@ +483,5 @@ > + if (iSizeCoord.GetUnit() == eStyleUnit_Auto) { > + if (aFlags & ComputeSizeFlags::eIClampMarginBoxMinSize) { > + // Use the potentially clamped inline-size. > + autoSize.ISize(aWM) = > + nsContainerFrame::ComputeAutoSize(aRenderingContext, aWM, I think we won't be getting any font-inflation information here (based on the assertion below which allows for nsContainerFrame::ComputeAutoSize to disagree when inflation is non-1.0). This is maybe OK, since we don't ship font-inflation default-enabled anywhere at this point. You should probably add an XXX comment to note this issue, though? Something like: // CalcIntrinsicSize isn't aware of grid-item margin-box clamping, so we have to fall // back to nsContainerFrame's ComputeAutoSize impl (which does handle margin-box clamping). // Unfortunately, nsContainerFrame doesn't handle font inflation, but maybe that's OK // because we don't ship it default-enabled...? (I'm hand-waving a bit here about what handles what, but I'm guessing my hand-waving is accurate based on the context around this code)
Attachment #8810267 -
Flags: review?(dholbert) → review+
Assignee | ||
Comment 7•7 years ago
|
||
> I think we won't be getting any font-inflation information here nsFrame::ShrinkWidthToFit does handle it though, so I'm not sure what the issue here might be... > ... we don't ship font-inflation default-enabled anywhere at this point Perhaps we should just rip out all of that code then? For a few reasons: 1. IIRC, it's actually quite a bit of a performance drag even when it's preffed off 2. IIRC, dbaron said somewhere that the approach we took isn't working very well (perhaps this is the reason it's disabled?) 3. maintaining dead code/comments is a waste of time OTOH, perhaps we should decide/investigate a better approach first and see if there's is some code worth keeping... if indeed we think it's a feature worth having at all.
Comment 8•7 years ago
|
||
(In reply to Mats Palmgren (:mats) from comment #7) > > I think we won't be getting any font-inflation information here > > nsFrame::ShrinkWidthToFit does handle it though, so I'm not sure what > the issue here might be... Nor am I -- I'm just going by the assertion condition. > > ... we don't ship font-inflation default-enabled anywhere at this point > > Perhaps we should just rip out all of that code then? > [...] > OTOH, perhaps we should decide/investigate a better approach first and > see if there's is some code worth keeping... if indeed we think it's > a feature worth having at all. (Yeah -- if we end up landing a replacement, it might conceivably want to share some code [or at least insert itself at similar points in the code], so it might be useful to do the removal-and-replacement all at once. *shrug*.)
Pushed by mpalmgren@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/87e598f49765 part 1 - nsTextControlFrame::CalcIntrinsicSize is infallible so make it return the size result rather than NS_OK. Also, make it const. r=dholbert https://hg.mozilla.org/integration/mozilla-inbound/rev/33bab2311a77 part 2 - [css-grid] Fall back to using nsContainerFrame::ComputeAutoSize when the nsTextControlFrame min-content size needs to have grid item clamping applied. r=dholbert https://hg.mozilla.org/integration/mozilla-inbound/rev/cb5c261faec0 part 3 - [css-grid] Reftests for <input> grid items.
Assignee | ||
Comment 10•7 years ago
|
||
Comment on attachment 8810269 [details] [diff] [review] part 1 - nsTextControlFrame::CalcIntrinsicSize is infallible so make it return the size result rather than NS_OK. Also, make it const. Approval Request Comment [Feature/regressing bug #]: CSS Grid [User impact if declined]: web-compat risk [Describe test coverage new/current, TreeHerder]: have reftests, all tests pass [Risks and why]: low risk [String/UUID change made/needed]: none This is part of the CSS Grid release, please uplift to Aurora 52, thanks.
Attachment #8810269 -
Flags: approval-mozilla-aurora?
Assignee | ||
Updated•7 years ago
|
Flags: in-testsuite+
Comment 11•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/87e598f49765 https://hg.mozilla.org/mozilla-central/rev/33bab2311a77 https://hg.mozilla.org/mozilla-central/rev/cb5c261faec0
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
Comment 12•7 years ago
|
||
Comment on attachment 8810269 [details] [diff] [review] part 1 - nsTextControlFrame::CalcIntrinsicSize is infallible so make it return the size result rather than NS_OK. Also, make it const. css-grid fixes for aurora52
Attachment #8810269 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment 13•7 years ago
|
||
bugherder uplift |
https://hg.mozilla.org/releases/mozilla-aurora/rev/d74bba27e731 https://hg.mozilla.org/releases/mozilla-aurora/rev/23b83d8ff9ec https://hg.mozilla.org/releases/mozilla-aurora/rev/ef7152cecd69
You need to log in
before you can comment on or make changes to this bug.
Description
•