Bug 1560397 - [css-grid] If a repeat(auto-fill/fit) track starts outside the clamped grid then treat it as not having a auto-fill/fit at all. r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D45782

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mats Palmgren 2019-09-13 12:41:00 +00:00
Родитель e821ea6bdc
Коммит 78bd45b6de
7 изменённых файлов: 94 добавлений и 3 удалений

Просмотреть файл

@ -0,0 +1,10 @@
<html>
<head>
<style>
* {
display: inline-grid;
grid-template-columns: repeat(9999, minmax(1%, 25054ex) minmax(1%, 2%) 1px) repeat(auto-fit, minmax(1%, 2%));
}
</style>
</head>
</html>

Просмотреть файл

@ -0,0 +1,12 @@
<style>
#id_0 {
grid-template-rows: [ line_name_37 ] repeat(18022, [ line_name_38 ] 60% [ line_name_39 line_name_40 line_name_41 ] minmax(max-content, 24ex) [ line_name_42 ]) [ line_name_43 ] repeat(auto-fit, [ line_name_44 ] minmax(61%, min-content) [ line_name_45 line_name_46 ]) [ line_name_47 ] minmax(min-content, 25%) [ line_name_48 ];
}
.class_0 {
grid-row-end: line_name_19;
display: inline-grid;
}
</style>
<ol class="class_0" id="id_0">
<li class="class_0">

Просмотреть файл

@ -0,0 +1,25 @@
<html>
<head>
<style>
.class_2, .class_3 {
display: inline-grid;
grid: repeat(3, 6%) repeat(1, minmax(1em, 3%))/repeat(1, auto);
grid-row: i;
grid-auto-columns: 1px;
}
.class_2 {
grid-column: span 999999;
grid-template-columns: subgrid repeat(99999, [a]) repeat(auto-fill,[b]);
}
</style>
</head>
<body>
<big class="class_3">
<em class="class_2">
<x style="grid-column:b">A</x>
<x style="grid-column:a -1">A</x>
</em>
</big>
</body>
</html>

Просмотреть файл

@ -0,0 +1,21 @@
<html>
<head>
<style>
BIG, .class_2 {
position: fixed;
rotate: 4.201792242287117rad z;
}
.class_2, .class_3 {
display: inline-grid;
grid: repeat(25976, 2vh) repeat(auto-fit, minmax(0, max-content)) repeat(3, 6%) repeat(1, minmax(1em, 3%))/repeat(1, auto);
grid-row: i
}
</style>
</head>
<body>
<big class="class_3">
<em class="class_2"></em>
</big>
</body>
</html>

Просмотреть файл

@ -0,0 +1,13 @@
<html>
<head>
<style>
#id_0 {
display: inline-grid;
grid-template-rows: [ l0 ] repeat(58321, [ l1 ] minmax(26571ch, max-content) [ l2 ]) [ l3 ] repeat(auto-fill, [ l4 l5 ] minmax(min-content, 46.15128007109454em) [ l6 ])
}
</style>
</head>
<body>
<abbr id="id_0"></abbr>
</body>
</html>

Просмотреть файл

@ -729,6 +729,7 @@ pref(layout.css.column-span.enabled,true) load 1517033.html
pref(layout.css.column-span.enabled,true) load 1517297.html
load chrome://reftest/content/crashtests/layout/generic/crashtests/1520798-1.xul
load 1520798-2.html
load 1528771.html
load 1539656.html
load 1544060-1.html
load 1544060-2.html
@ -736,10 +737,14 @@ load 1542441.html
pref(layout.css.grid-template-subgrid-value.enabled,true) load 1553824.html
pref(layout.css.column-span.enabled,true) load 1554824.html
load 1555142.html
load 1560349.html
load 1560397.html
load 1560397-2.html
load 1562105.html
pref(layout.css.column-span.enabled,true) load 1563131.html
pref(layout.css.column-span.enabled,true) load 1568001-1.html
pref(layout.css.column-span.enabled,true) load 1568001-2.html
load 1569639.html
pref(layout.css.column-span.enabled,true) load 1571239.html
load 1571460.html
pref(layout.css.column-span.enabled,true) load 1571598.html

Просмотреть файл

@ -1241,6 +1241,10 @@ struct nsGridContainerFrame::TrackSizingFunctions {
}
if (MOZ_UNLIKELY(mExpandedTracks.Length() > kMaxLine - 1)) {
mExpandedTracks.TruncateLength(kMaxLine - 1);
if (mHasRepeatAuto && mRepeatAutoStart > kMaxLine - 1) {
// The `repeat(auto-fill/fit)` track is outside the clamped grid.
mHasRepeatAuto = false;
}
}
}
@ -1272,7 +1276,7 @@ struct nsGridContainerFrame::TrackSizingFunctions {
// The difference between mExplicitGridEnd and mSizingFunctions.Length().
int32_t mRepeatEndDelta;
// True if there is a specified repeat(auto-fill/fit) track.
const bool mHasRepeatAuto;
bool mHasRepeatAuto;
// True if this track (relative to mRepeatAutoStart) is a removed auto-fit.
// Indexed relative to mExplicitGridOffset + mRepeatAutoStart.
nsTArray<bool> mRemovedRepeatTracks;
@ -1322,8 +1326,9 @@ class MOZ_STACK_CLASS nsGridContainerFrame::LineNameMap {
mIsSameDirection(aIsSameDirection),
mHasRepeatAuto(aTracks.mHasRepeatAuto) {
MOZ_ASSERT(mHasRepeatAuto || mRepeatEndDelta == 0);
MOZ_ASSERT(mRepeatAutoStart <= mTracks.mExpandedLineNames.Length());
MOZ_ASSERT(!mHasRepeatAuto || mTracks.mExpandedLineNames.Length() >= 2);
MOZ_ASSERT(!mHasRepeatAuto ||
(mTracks.mExpandedLineNames.Length() >= 2 &&
mRepeatAutoStart <= mTracks.mExpandedLineNames.Length()));
}
/**