[css-grid] min-height:auto clamped to 0 by indefinite max-height percentage
Categories
(Core :: Layout: Grid, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox67 | --- | fixed |
People
(Reporter: Oriol, Assigned: MatsPalmgren_bugz)
References
Details
(Keywords: testcase)
Attachments
(3 files, 1 obsolete file)
351 bytes,
text/html
|
Details | |
51.20 KB,
patch
|
dholbert
:
review+
|
Details | Diff | Splinter Review |
4.59 KB,
patch
|
dholbert
:
review+
|
Details | Diff | Splinter Review |
Consider
.grid {
display: grid;
height: 100px;
width: 100px;
border: solid thick;
}
.item {
max-height: 100%;
max-width: 100%;
background: cyan;
}
.content {
height: 200px;
width: 200px;
border: dashed thick magenta;
}
<div class="grid">
<div class="item">
<div class="content"></div>
</div>
</div>
When resolving intrinsic track sizes, the base size is set to the minimum contribution, which is the automatic minimum size. This will be
the min-content size in the relevant axis, [...] clamped by the same-axis max size property if that is definite.
Here 100% is not definite, because it would be resolved with respect to the grid area, which hasn't been calculated yet.
Therefore, the row should be 200px tall and the column 200px wide, even if this overflows the grid container.
However, in Firefox, the row is only 100px tall. It seems the indefinite max-height percentage is clamping the auto min-height to 0.
Chromium and Edge do it correctly.
Assignee | ||
Comment 1•6 years ago
|
||
Looks like we resolve the max-height percentage to zero while
calculating the min-content contribution in the block-axis.
Oriol, is this from a WPT or should I write some?
Reporter | ||
Comment 2•6 years ago
|
||
This is from https://crbug.com/890278, I don't think there is a WPT.
Assignee | ||
Comment 3•6 years ago
|
||
I'm not really sure why this breaks layout/reftests/css-grid/grid-item-table-stretch-002.html on Android only, given that the tests contains no percentages whatsoever. As far as I know we don't have any Android-specific code in Grid or Table layout so I suspect this is an unrelated existing issue. I'll just mark it as failing for now and file a follow-up bug for it. Let me know if you have any clues as to what the problem might be...
Comment 4•6 years ago
|
||
Comment 5•6 years ago
|
||
(In reply to Mats Palmgren (:mats) from comment #3)
I'm not really sure why this breaks layout/reftests/css-grid/grid-item-table-stretch-002.html [...]
Let me know if you have any clues as to what the problem might be...
I don't have any clues, but I did discover one possibly-related bug while investigating, and I filed bug 1527734 on it. (I don't have any confidence that bug 1527734 is the explanation for the failure you're seeing here, though.)
Assignee | ||
Comment 6•6 years ago
|
||
Also: it'd probably be worth giving the test 5-10 retriggers on Try, to check that 'fails' is really appropriate
Yup, I did so in an earlier Try push and it is indeed a permafail, not random.
Comment 8•6 years ago
|
||
Backed out for dt failures on browser_webconsole_sidebar_scroll.js
Backout link: https://hg.mozilla.org/integration/mozilla-inbound/rev/659c7fae6ae49dc00e950a6755b7f724bcb9084e
Push link:https://treeherder.mozilla.org/#/jobs?repo=mozilla-inbound&resultStatus=testfailed%2Cbusted%2Cexception%2Crunnable&selectedJob=229063893&revision=e919946fd91306287e4a6197c52a77b6361676ce
Log link: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=229063893&repo=mozilla-inbound&lineNumber=4268
Assignee | ||
Comment 9•6 years ago
|
||
Hmmm, so that test fails on OSX and Windows only? But passed on Linux / Android?
Fwiw, the test works fine when I run it locally on Linux.
Assignee | ||
Comment 10•6 years ago
|
||
The failed test is due to a dependence in a devtools panel on this bug.
STR
- open devtools Console
- type "document <ENTER>"
- open the context menu on the result line from 2
- type V (Open in Sidebar)
There should be a vertical scrollbar but it was missing.
Assignee | ||
Comment 11•6 years ago
|
||
Comment 12•6 years ago
|
||
Comment 13•6 years ago
|
||
Assignee | ||
Comment 14•6 years ago
|
||
Comment 15•6 years ago
|
||
Comment 16•6 years ago
|
||
Comment 17•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/739201563949
https://hg.mozilla.org/mozilla-central/rev/31404c0c060e
Comment 18•6 years ago
|
||
James, do you know why a PR for exporting these tests wasn't opened?
Comment 19•6 years ago
|
||
Yes, because there were merge conflicts (there should really by a comment for that). The reason there's merge conflicts appears to be that the changes from Bug 1513959 didn't end up fully synced; it looks like we ended up not updating for the changes to the patch after it was backed out.So I'll fix that and then this one should be unblocked.
Description
•