Bug 1618351 - Floor subgrid auto-fill repeat count at zero to avoid underflow of unsigned integer mRepeatAutoEnd. r=dholbert
authorMats Palmgren <mats@mozilla.com>
Thu, 27 Feb 2020 21:44:04 +0000
changeset 516002 ab55651ab243386cfaa4fb60c2e7a8feb1d4bf43
parent 516001 9ff913c103c1ead5e385f978b7446880b08e8ec8
child 516003 0f5221d3b83b72502e7e40d5488e44dd5c3aef6d
push id37165
push useraiakab@mozilla.com
push dateFri, 28 Feb 2020 09:24:28 +0000
treeherdermozilla-central@fb4f281c1c54 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1618351
milestone75.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1618351 - Floor subgrid auto-fill repeat count at zero to avoid underflow of unsigned integer mRepeatAutoEnd. r=dholbert Differential Revision: https://phabricator.services.mozilla.com/D64637
layout/generic/nsGridContainerFrame.cpp
testing/web-platform/tests/css/css-grid/subgrid/repeat-auto-fill-001-ref.html
testing/web-platform/tests/css/css-grid/subgrid/repeat-auto-fill-001.html
testing/web-platform/tests/css/css-grid/subgrid/repeat-auto-fill-002.html
testing/web-platform/tests/css/css-grid/subgrid/repeat-auto-fill-003.html
testing/web-platform/tests/css/css-grid/subgrid/repeat-auto-fill-004-ref.html
testing/web-platform/tests/css/css-grid/subgrid/repeat-auto-fill-004.html
--- a/layout/generic/nsGridContainerFrame.cpp
+++ b/layout/generic/nsGridContainerFrame.cpp
@@ -1315,17 +1315,18 @@ class MOZ_STACK_CLASS nsGridContainerFra
       mRepeatAutoEnd = mRepeatAutoStart;
       const auto& styleSubgrid = aTracks.mTemplate.AsSubgrid();
       mHasRepeatAuto =
           styleSubgrid->fill_idx != std::numeric_limits<size_t>::max();
       if (mHasRepeatAuto) {
         const auto& lineNameLists = styleSubgrid->names;
         int32_t extraAutoFillLineCount = mClampMaxLine - lineNameLists.Length();
         mRepeatAutoStart = styleSubgrid->fill_idx;
-        mRepeatAutoEnd = mRepeatAutoStart + extraAutoFillLineCount + 1;
+        mRepeatAutoEnd =
+            mRepeatAutoStart + std::max(0, extraAutoFillLineCount + 1);
       }
     } else {
       mClampMinLine = kMinLine;
       mClampMaxLine = kMaxLine;
       if (mHasRepeatAuto) {
         mTrackAutoRepeatLineNames =
             aTracks.mTemplate.GetRepeatAutoValue()->line_names.AsSpan();
       }
--- a/testing/web-platform/tests/css/css-grid/subgrid/repeat-auto-fill-001-ref.html
+++ b/testing/web-platform/tests/css/css-grid/subgrid/repeat-auto-fill-001-ref.html
@@ -158,16 +158,55 @@ html,body {
   <div style="grid-column:4"></div>
   <div style="grid-column:1"></div>
   <div style="grid-column:1"></div>
   <div style="grid-column:1"></div>
   <div style="grid-column:1"></div>
   <div style="grid-column:1"></div>
 </div></div>
 
+<div class="grid"><div class="subgrid fill-0k">
+  <div style="grid-column:4"></div>
+  <div style="grid-column:4"></div>
+  <div style="grid-column:4"></div>
+  <div style="grid-column:4"></div>
+  <div style="grid-column:4"></div>
+  <div style="grid-column:1"></div>
+  <div style="grid-column:1"></div>
+  <div style="grid-column:1"></div>
+  <div style="grid-column:1"></div>
+  <div style="grid-column:1"></div>
+</div></div>
+
+<div class="grid"><div class="subgrid fill-0l">
+  <div style="grid-column:4"></div>
+  <div style="grid-column:4"></div>
+  <div style="grid-column:4"></div>
+  <div style="grid-column:4"></div>
+  <div style="grid-column:4"></div>
+  <div style="grid-column:1"></div>
+  <div style="grid-column:1"></div>
+  <div style="grid-column:1"></div>
+  <div style="grid-column:1"></div>
+  <div style="grid-column:1"></div>
+</div></div>
+
+<div class="grid"><div class="subgrid fill-0m">
+  <div style="grid-column:4"></div>
+  <div style="grid-column:4"></div>
+  <div style="grid-column:4"></div>
+  <div style="grid-column:4"></div>
+  <div style="grid-column:4"></div>
+  <div style="grid-column:1"></div>
+  <div style="grid-column:1"></div>
+  <div style="grid-column:1"></div>
+  <div style="grid-column:1"></div>
+  <div style="grid-column:1"></div>
+</div></div>
+
 <div class="grid"><div class="subgrid fill-1a">
   <div style="grid-column:4"></div>
   <div style="grid-column:4"></div>
   <div style="grid-column:4"></div>
   <div style="grid-column:4"></div>
   <div style="grid-column:1"></div>
   <div style="grid-column:1"></div>
   <div style="grid-column:1"></div>
--- a/testing/web-platform/tests/css/css-grid/subgrid/repeat-auto-fill-001.html
+++ b/testing/web-platform/tests/css/css-grid/subgrid/repeat-auto-fill-001.html
@@ -32,16 +32,19 @@ html,body {
 .fill-0c  { grid-template-columns: subgrid [x] [x] repeat(auto-fill, [y]) [z] [z] [z] }  /* [x] [x] [z] [z] [z] */
 .fill-0d  { grid-template-columns: subgrid [x] [x] [x] repeat(auto-fill, [y]) [z] [z] }  /* [x] [x] [x] [z] [z] */
 .fill-0e  { grid-template-columns: subgrid [x] [x] [x] [x] repeat(auto-fill, [y]) [z] }  /* [x] [x] [x] [x] [z] */
 .fill-0f  { grid-template-columns: subgrid [x] [x] [x] [x] [x] repeat(auto-fill, [y]) }  /* [x] [x] [x] [x] [x] */
 .fill-0g  { grid-template-columns: subgrid [x] [x] [x] [x] [x] repeat(auto-fill, [y]) [z] [z] }  /* [x] [x] [x] [x] [x] */
 .fill-0h  { grid-template-columns: subgrid [x] [x] [x] [x] [x] [x] [x] repeat(auto-fill, [y]) [z] [z] }  /* [x] [x] [x] [x] [x] */
 .fill-0i  { grid-template-columns: subgrid [x] [x] [x] [x] [x] [x] [x] repeat(auto-fill, [y]) [z] }  /* [x] [x] [x] [x] [x] */
 .fill-0j  { grid-template-columns: subgrid [x] [x] [x] [x] [x] [x] [x] repeat(auto-fill, [y]) }  /* [x] [x] [x] [x] [x] */
+.fill-0k  { grid-template-columns: subgrid repeat(auto-fill, [y]) repeat(100, [z]) }  /* [z] [z] [z] [z] [z] */
+.fill-0l  { grid-template-columns: subgrid [x] repeat(auto-fill, [y]) repeat(100, [z]) }  /* [x] [z] [z] [z] [z] */
+.fill-0m  { grid-template-columns: subgrid  repeat(100, [x]) repeat(auto-fill, [y]) }  /* [x] [x] [x] [x] [x] */
 
 .fill-1a  { grid-template-columns: subgrid repeat(auto-fill, [y]) [z] [z] [z] [z] }  /* [y] [z] [z] [z] [z] */
 .fill-1b  { grid-template-columns: subgrid [x] repeat(auto-fill, [y]) [z] [z] [z] }  /* [x] [y] [z] [z] [z] */
 .fill-1c  { grid-template-columns: subgrid [x] [x] repeat(auto-fill, [y]) [z] [z] }  /* [x] [x] [y] [z] [z] */
 .fill-1d  { grid-template-columns: subgrid [x] [x] [x] repeat(auto-fill, [y]) [z] }  /* [x] [x] [x] [y] [z] */
 .fill-1e  { grid-template-columns: subgrid [x] [x] [x] [x] repeat(auto-fill, [y]) }  /* [x] [x] [x] [x] [y] */
 
 .fill-2a  { grid-template-columns: subgrid repeat(auto-fill, [y]) [z] [z] [z] }  /* [y] [y] [z] [z] [z] */
@@ -190,16 +193,55 @@ html,body {
   <div style="grid-column:y 1"></div>
   <div style="grid-column:y -1"></div>
   <div style="grid-column:y -2"></div>
   <div style="grid-column:y -3"></div>
   <div style="grid-column:y -4"></div>
   <div style="grid-column:y -5"></div>
 </div></div>
 
+<div class="grid"><div class="subgrid fill-0k">
+  <div style="grid-column:y 5"></div>
+  <div style="grid-column:y 4"></div>
+  <div style="grid-column:y 3"></div>
+  <div style="grid-column:y 2"></div>
+  <div style="grid-column:y 1"></div>
+  <div style="grid-column:y -1"></div>
+  <div style="grid-column:y -2"></div>
+  <div style="grid-column:y -3"></div>
+  <div style="grid-column:y -4"></div>
+  <div style="grid-column:y -5"></div>
+</div></div>
+
+<div class="grid"><div class="subgrid fill-0l">
+  <div style="grid-column:y 5"></div>
+  <div style="grid-column:y 4"></div>
+  <div style="grid-column:y 3"></div>
+  <div style="grid-column:y 2"></div>
+  <div style="grid-column:y 1"></div>
+  <div style="grid-column:y -1"></div>
+  <div style="grid-column:y -2"></div>
+  <div style="grid-column:y -3"></div>
+  <div style="grid-column:y -4"></div>
+  <div style="grid-column:y -5"></div>
+</div></div>
+
+<div class="grid"><div class="subgrid fill-0m">
+  <div style="grid-column:y 5"></div>
+  <div style="grid-column:y 4"></div>
+  <div style="grid-column:y 3"></div>
+  <div style="grid-column:y 2"></div>
+  <div style="grid-column:y 1"></div>
+  <div style="grid-column:y -1"></div>
+  <div style="grid-column:y -2"></div>
+  <div style="grid-column:y -3"></div>
+  <div style="grid-column:y -4"></div>
+  <div style="grid-column:y -5"></div>
+</div></div>
+
 <div class="grid"><div class="subgrid fill-1a">
   <div style="grid-column:y 5"></div>
   <div style="grid-column:y 4"></div>
   <div style="grid-column:y 3"></div>
   <div style="grid-column:y 2"></div>
   <div style="grid-column:y 1"></div>
   <div style="grid-column:y -1"></div>
   <div style="grid-column:y -2"></div>
@@ -397,16 +439,19 @@ html,body {
     "subgrid [x] [x] [z] [z] [z]",
     "subgrid [x] [x] [x] [z] [z]",
     "subgrid [x] [x] [x] [x] [z]",
     "subgrid [x] [x] [x] [x] [x]",
     "subgrid [x] [x] [x] [x] [x]",
     "subgrid [x] [x] [x] [x] [x]",
     "subgrid [x] [x] [x] [x] [x]",
     "subgrid [x] [x] [x] [x] [x]",
+    "subgrid [z] [z] [z] [z] [z]",
+    "subgrid [x] [z] [z] [z] [z]",
+    "subgrid [x] [x] [x] [x] [x]",
     "subgrid [y] [z] [z] [z] [z]",
     "subgrid [x] [y] [z] [z] [z]",
     "subgrid [x] [x] [y] [z] [z]",
     "subgrid [x] [x] [x] [y] [z]",
     "subgrid [x] [x] [x] [x] [y]",
     "subgrid [y] [y] [z] [z] [z]",
     "subgrid [x] [y] [y] [z] [z]",
     "subgrid [x] [x] [y] [y] [z]",
--- a/testing/web-platform/tests/css/css-grid/subgrid/repeat-auto-fill-002.html
+++ b/testing/web-platform/tests/css/css-grid/subgrid/repeat-auto-fill-002.html
@@ -35,16 +35,19 @@ html,body {
 .fill-0c  { grid-template-columns: subgrid [x] [x] repeat(auto-fill, [y]) [z] [z] [z] }  /* [x] [x] [z] [z] [z] */
 .fill-0d  { grid-template-columns: subgrid [x] [x] [x] repeat(auto-fill, [y]) [z] [z] }  /* [x] [x] [x] [z] [z] */
 .fill-0e  { grid-template-columns: subgrid [x] [x] [x] [x] repeat(auto-fill, [y]) [z] }  /* [x] [x] [x] [x] [z] */
 .fill-0f  { grid-template-columns: subgrid [x] [x] [x] [x] [x] repeat(auto-fill, [y]) }  /* [x] [x] [x] [x] [x] */
 .fill-0g  { grid-template-columns: subgrid [x] [x] [x] [x] [x] repeat(auto-fill, [y]) [z] [z] }  /* [x] [x] [x] [x] [x] */
 .fill-0h  { grid-template-columns: subgrid [x] [x] [x] [x] [x] [x] [x] repeat(auto-fill, [y]) [z] [z] }  /* [x] [x] [x] [x] [x] */
 .fill-0i  { grid-template-columns: subgrid [x] [x] [x] [x] [x] [x] [x] repeat(auto-fill, [y]) [z] }  /* [x] [x] [x] [x] [x] */
 .fill-0j  { grid-template-columns: subgrid [x] [x] [x] [x] [x] [x] [x] repeat(auto-fill, [y]) }  /* [x] [x] [x] [x] [x] */
+.fill-0k  { grid-template-columns: subgrid repeat(auto-fill, [y]) repeat(100, [z]) }  /* [z] [z] [z] [z] [z] */
+.fill-0l  { grid-template-columns: subgrid [x] repeat(auto-fill, [y]) repeat(100, [z]) }  /* [x] [z] [z] [z] [z] */
+.fill-0m  { grid-template-columns: subgrid  repeat(100, [x]) repeat(auto-fill, [y]) }  /* [x] [x] [x] [x] [x] */
 
 .fill-1a  { grid-template-columns: subgrid repeat(auto-fill, [y]) [z] [z] [z] [z] }  /* [y] [z] [z] [z] [z] */
 .fill-1b  { grid-template-columns: subgrid [x] repeat(auto-fill, [y]) [z] [z] [z] }  /* [x] [y] [z] [z] [z] */
 .fill-1c  { grid-template-columns: subgrid [x] [x] repeat(auto-fill, [y]) [z] [z] }  /* [x] [x] [y] [z] [z] */
 .fill-1d  { grid-template-columns: subgrid [x] [x] [x] repeat(auto-fill, [y]) [z] }  /* [x] [x] [x] [y] [z] */
 .fill-1e  { grid-template-columns: subgrid [x] [x] [x] [x] repeat(auto-fill, [y]) }  /* [x] [x] [x] [x] [y] */
 
 .fill-2a  { grid-template-columns: subgrid repeat(auto-fill, [y]) [z] [z] [z] }  /* [y] [y] [z] [z] [z] */
@@ -193,16 +196,55 @@ html,body {
   <div style="grid-column:y 1"></div>
   <div style="grid-column:y -1"></div>
   <div style="grid-column:y -2"></div>
   <div style="grid-column:y -3"></div>
   <div style="grid-column:y -4"></div>
   <div style="grid-column:y -5"></div>
 </div></div></div>
 
+<div class="grid"><div class="subgrid fill-0k"><div class="subgrid">
+  <div style="grid-column:y 5"></div>
+  <div style="grid-column:y 4"></div>
+  <div style="grid-column:y 3"></div>
+  <div style="grid-column:y 2"></div>
+  <div style="grid-column:y 1"></div>
+  <div style="grid-column:y -1"></div>
+  <div style="grid-column:y -2"></div>
+  <div style="grid-column:y -3"></div>
+  <div style="grid-column:y -4"></div>
+  <div style="grid-column:y -5"></div>
+</div></div></div>
+
+<div class="grid"><div class="subgrid fill-0l"><div class="subgrid">
+  <div style="grid-column:y 5"></div>
+  <div style="grid-column:y 4"></div>
+  <div style="grid-column:y 3"></div>
+  <div style="grid-column:y 2"></div>
+  <div style="grid-column:y 1"></div>
+  <div style="grid-column:y -1"></div>
+  <div style="grid-column:y -2"></div>
+  <div style="grid-column:y -3"></div>
+  <div style="grid-column:y -4"></div>
+  <div style="grid-column:y -5"></div>
+</div></div></div>
+
+<div class="grid"><div class="subgrid fill-0m"><div class="subgrid">
+  <div style="grid-column:y 5"></div>
+  <div style="grid-column:y 4"></div>
+  <div style="grid-column:y 3"></div>
+  <div style="grid-column:y 2"></div>
+  <div style="grid-column:y 1"></div>
+  <div style="grid-column:y -1"></div>
+  <div style="grid-column:y -2"></div>
+  <div style="grid-column:y -3"></div>
+  <div style="grid-column:y -4"></div>
+  <div style="grid-column:y -5"></div>
+</div></div></div>
+
 <div class="grid"><div class="subgrid fill-1a"><div class="subgrid">
   <div style="grid-column:y 5"></div>
   <div style="grid-column:y 4"></div>
   <div style="grid-column:y 3"></div>
   <div style="grid-column:y 2"></div>
   <div style="grid-column:y 1"></div>
   <div style="grid-column:y -1"></div>
   <div style="grid-column:y -2"></div>
--- a/testing/web-platform/tests/css/css-grid/subgrid/repeat-auto-fill-003.html
+++ b/testing/web-platform/tests/css/css-grid/subgrid/repeat-auto-fill-003.html
@@ -40,16 +40,19 @@ html,body {
 .fill-0c  { grid-template-columns: subgrid [x] [x] repeat(auto-fill, [y]) [z] [z] [z] }  /* [x] [x] [z] [z] [z] */
 .fill-0d  { grid-template-columns: subgrid [x] [x] [x] repeat(auto-fill, [y]) [z] [z] }  /* [x] [x] [x] [z] [z] */
 .fill-0e  { grid-template-columns: subgrid [x] [x] [x] [x] repeat(auto-fill, [y]) [z] }  /* [x] [x] [x] [x] [z] */
 .fill-0f  { grid-template-columns: subgrid [x] [x] [x] [x] [x] repeat(auto-fill, [y]) }  /* [x] [x] [x] [x] [x] */
 .fill-0g  { grid-template-columns: subgrid [x] [x] [x] [x] [x] repeat(auto-fill, [y]) [z] [z] }  /* [x] [x] [x] [x] [x] */
 .fill-0h  { grid-template-columns: subgrid [x] [x] [x] [x] [x] [x] [x] repeat(auto-fill, [y]) [z] [z] }  /* [x] [x] [x] [x] [x] */
 .fill-0i  { grid-template-columns: subgrid [x] [x] [x] [x] [x] [x] [x] repeat(auto-fill, [y]) [z] }  /* [x] [x] [x] [x] [x] */
 .fill-0j  { grid-template-columns: subgrid [x] [x] [x] [x] [x] [x] [x] repeat(auto-fill, [y]) }  /* [x] [x] [x] [x] [x] */
+.fill-0k  { grid-template-columns: subgrid repeat(auto-fill, [y]) repeat(100, [z]) }  /* [z] [z] [z] [z] [z] */
+.fill-0l  { grid-template-columns: subgrid [x] repeat(auto-fill, [y]) repeat(100, [z]) }  /* [x] [z] [z] [z] [z] */
+.fill-0m  { grid-template-columns: subgrid  repeat(100, [x]) repeat(auto-fill, [y]) }  /* [x] [x] [x] [x] [x] */
 
 .fill-1a  { grid-template-columns: subgrid repeat(auto-fill, [y]) [z] [z] [z] [z] }  /* [y] [z] [z] [z] [z] */
 .fill-1b  { grid-template-columns: subgrid [x] repeat(auto-fill, [y]) [z] [z] [z] }  /* [x] [y] [z] [z] [z] */
 .fill-1c  { grid-template-columns: subgrid [x] [x] repeat(auto-fill, [y]) [z] [z] }  /* [x] [x] [y] [z] [z] */
 .fill-1d  { grid-template-columns: subgrid [x] [x] [x] repeat(auto-fill, [y]) [z] }  /* [x] [x] [x] [y] [z] */
 .fill-1e  { grid-template-columns: subgrid [x] [x] [x] [x] repeat(auto-fill, [y]) }  /* [x] [x] [x] [x] [y] */
 
 .fill-2a  { grid-template-columns: subgrid repeat(auto-fill, [y]) [z] [z] [z] }  /* [y] [y] [z] [z] [z] */
@@ -199,16 +202,55 @@ html,body {
   <div style="grid-row:y 1"></div>
   <div style="grid-row:y -1"></div>
   <div style="grid-row:y -2"></div>
   <div style="grid-row:y -3"></div>
   <div style="grid-row:y -4"></div>
   <div style="grid-row:y -5"></div>
 </div></div></div>
 
+<div class="grid"><div class="subgrid fill-0k"><div class="subgrid">
+  <div style="grid-row:y 5"></div>
+  <div style="grid-row:y 4"></div>
+  <div style="grid-row:y 3"></div>
+  <div style="grid-row:y 2"></div>
+  <div style="grid-row:y 1"></div>
+  <div style="grid-row:y -1"></div>
+  <div style="grid-row:y -2"></div>
+  <div style="grid-row:y -3"></div>
+  <div style="grid-row:y -4"></div>
+  <div style="grid-row:y -5"></div>
+</div></div></div>
+
+<div class="grid"><div class="subgrid fill-0l"><div class="subgrid">
+  <div style="grid-row:y 5"></div>
+  <div style="grid-row:y 4"></div>
+  <div style="grid-row:y 3"></div>
+  <div style="grid-row:y 2"></div>
+  <div style="grid-row:y 1"></div>
+  <div style="grid-row:y -1"></div>
+  <div style="grid-row:y -2"></div>
+  <div style="grid-row:y -3"></div>
+  <div style="grid-row:y -4"></div>
+  <div style="grid-row:y -5"></div>
+</div></div></div>
+
+<div class="grid"><div class="subgrid fill-0m"><div class="subgrid">
+  <div style="grid-row:y 5"></div>
+  <div style="grid-row:y 4"></div>
+  <div style="grid-row:y 3"></div>
+  <div style="grid-row:y 2"></div>
+  <div style="grid-row:y 1"></div>
+  <div style="grid-row:y -1"></div>
+  <div style="grid-row:y -2"></div>
+  <div style="grid-row:y -3"></div>
+  <div style="grid-row:y -4"></div>
+  <div style="grid-row:y -5"></div>
+</div></div></div>
+
 <div class="grid"><div class="subgrid fill-1a"><div class="subgrid">
   <div style="grid-row:y 5"></div>
   <div style="grid-row:y 4"></div>
   <div style="grid-row:y 3"></div>
   <div style="grid-row:y 2"></div>
   <div style="grid-row:y 1"></div>
   <div style="grid-row:y -1"></div>
   <div style="grid-row:y -2"></div>
--- a/testing/web-platform/tests/css/css-grid/subgrid/repeat-auto-fill-004-ref.html
+++ b/testing/web-platform/tests/css/css-grid/subgrid/repeat-auto-fill-004-ref.html
@@ -158,16 +158,55 @@ html,body {
   <div style="grid-column:4"></div>
   <div style="grid-column:1"></div>
   <div style="grid-column:1"></div>
   <div style="grid-column:1"></div>
   <div style="grid-column:1"></div>
   <div style="grid-column:1"></div>
 </div></div>
 
+<div class="grid"><div class="subgrid fill-0k">
+  <div style="grid-column:4"></div>
+  <div style="grid-column:4"></div>
+  <div style="grid-column:4"></div>
+  <div style="grid-column:4"></div>
+  <div style="grid-column:4"></div>
+  <div style="grid-column:1"></div>
+  <div style="grid-column:1"></div>
+  <div style="grid-column:1"></div>
+  <div style="grid-column:1"></div>
+  <div style="grid-column:1"></div>
+</div></div>
+
+<div class="grid"><div class="subgrid fill-0l">
+  <div style="grid-column:4"></div>
+  <div style="grid-column:4"></div>
+  <div style="grid-column:4"></div>
+  <div style="grid-column:4"></div>
+  <div style="grid-column:4"></div>
+  <div style="grid-column:1"></div>
+  <div style="grid-column:1"></div>
+  <div style="grid-column:1"></div>
+  <div style="grid-column:1"></div>
+  <div style="grid-column:1"></div>
+</div></div>
+
+<div class="grid"><div class="subgrid fill-0m">
+  <div style="grid-column:4"></div>
+  <div style="grid-column:4"></div>
+  <div style="grid-column:4"></div>
+  <div style="grid-column:4"></div>
+  <div style="grid-column:4"></div>
+  <div style="grid-column:1"></div>
+  <div style="grid-column:1"></div>
+  <div style="grid-column:1"></div>
+  <div style="grid-column:1"></div>
+  <div style="grid-column:1"></div>
+</div></div>
+
 <div class="grid"><div class="subgrid fill-1a">
   <div style="grid-column:4"></div>
   <div style="grid-column:4"></div>
   <div style="grid-column:4"></div>
   <div style="grid-column:4"></div>
   <div style="grid-column:4"></div>
   <div style="grid-column:4"></div>
   <div style="grid-column:1"></div>
--- a/testing/web-platform/tests/css/css-grid/subgrid/repeat-auto-fill-004.html
+++ b/testing/web-platform/tests/css/css-grid/subgrid/repeat-auto-fill-004.html
@@ -35,16 +35,19 @@ html,body {
 .fill-0c  { grid-template-columns: subgrid [x] [x] repeat(auto-fill, [y]) [z] [z] [z] }  /* [x] [x] [z] [z] [z] */
 .fill-0d  { grid-template-columns: subgrid [x] [x] [x] repeat(auto-fill, [y]) [z] [z] }  /* [x] [x] [x] [z] [z] */
 .fill-0e  { grid-template-columns: subgrid [x] [x] [x] [x] repeat(auto-fill, [y]) [z] }  /* [x] [x] [x] [x] [z] */
 .fill-0f  { grid-template-columns: subgrid [x] [x] [x] [x] [x] repeat(auto-fill, [y]) }  /* [x] [x] [x] [x] [x] */
 .fill-0g  { grid-template-columns: subgrid [x] [x] [x] [x] [x] repeat(auto-fill, [y]) [z] [z] }  /* [x] [x] [x] [x] [x] */
 .fill-0h  { grid-template-columns: subgrid [x] [x] [x] [x] [x] [x] [x] repeat(auto-fill, [y]) [z] [z] }  /* [x] [x] [x] [x] [x] */
 .fill-0i  { grid-template-columns: subgrid [x] [x] [x] [x] [x] [x] [x] repeat(auto-fill, [y]) [z] }  /* [x] [x] [x] [x] [x] */
 .fill-0j  { grid-template-columns: subgrid [x] [x] [x] [x] [x] [x] [x] repeat(auto-fill, [y]) }  /* [x] [x] [x] [x] [x] */
+.fill-0k  { grid-template-columns: subgrid repeat(auto-fill, [y]) repeat(100, [z]) }  /* [z] [z] [z] [z] [z] */
+.fill-0l  { grid-template-columns: subgrid [x] repeat(auto-fill, [y]) repeat(100, [z]) }  /* [x] [z] [z] [z] [z] */
+.fill-0m  { grid-template-columns: subgrid  repeat(100, [x]) repeat(auto-fill, [y]) }  /* [x] [x] [x] [x] [x] */
 
 .fill-1a  { grid-template-columns: subgrid repeat(auto-fill, [y]) [z] [z] [z] [z] }  /* [y] [z] [z] [z] [z] */
 .fill-1b  { grid-template-columns: subgrid [x] repeat(auto-fill, [y]) [z] [z] [z] }  /* [x] [y] [z] [z] [z] */
 .fill-1c  { grid-template-columns: subgrid [x] [x] repeat(auto-fill, [y]) [z] [z] }  /* [x] [x] [y] [z] [z] */
 .fill-1d  { grid-template-columns: subgrid [x] [x] [x] repeat(auto-fill, [y]) [z] }  /* [x] [x] [x] [y] [z] */
 .fill-1e  { grid-template-columns: subgrid [x] [x] [x] [x] repeat(auto-fill, [y]) }  /* [x] [x] [x] [x] [y] */
 
 .fill-2a  { grid-template-columns: subgrid repeat(auto-fill, [y]) [z] [z] [z] }  /* [y] [y] [z] [z] [z] */
@@ -193,16 +196,55 @@ html,body {
   <div style="grid-column:y 1"></div>
   <div style="grid-column:y -1"></div>
   <div style="grid-column:y -2"></div>
   <div style="grid-column:y -3"></div>
   <div style="grid-column:y -4"></div>
   <div style="grid-column:y -5"></div>
 </div></div></div>
 
+<div class="grid"><div class="subgrid fill-0k"><div class="subgrid">
+  <div style="grid-column:y 5"></div>
+  <div style="grid-column:y 4"></div>
+  <div style="grid-column:y 3"></div>
+  <div style="grid-column:y 2"></div>
+  <div style="grid-column:y 1"></div>
+  <div style="grid-column:y -1"></div>
+  <div style="grid-column:y -2"></div>
+  <div style="grid-column:y -3"></div>
+  <div style="grid-column:y -4"></div>
+  <div style="grid-column:y -5"></div>
+</div></div></div>
+
+<div class="grid"><div class="subgrid fill-0l"><div class="subgrid">
+  <div style="grid-column:y 5"></div>
+  <div style="grid-column:y 4"></div>
+  <div style="grid-column:y 3"></div>
+  <div style="grid-column:y 2"></div>
+  <div style="grid-column:y 1"></div>
+  <div style="grid-column:y -1"></div>
+  <div style="grid-column:y -2"></div>
+  <div style="grid-column:y -3"></div>
+  <div style="grid-column:y -4"></div>
+  <div style="grid-column:y -5"></div>
+</div></div></div>
+
+<div class="grid"><div class="subgrid fill-0m"><div class="subgrid">
+  <div style="grid-column:y 5"></div>
+  <div style="grid-column:y 4"></div>
+  <div style="grid-column:y 3"></div>
+  <div style="grid-column:y 2"></div>
+  <div style="grid-column:y 1"></div>
+  <div style="grid-column:y -1"></div>
+  <div style="grid-column:y -2"></div>
+  <div style="grid-column:y -3"></div>
+  <div style="grid-column:y -4"></div>
+  <div style="grid-column:y -5"></div>
+</div></div></div>
+
 <div class="grid"><div class="subgrid fill-1a"><div class="subgrid">
   <div style="grid-column:y 5"></div>
   <div style="grid-column:y 4"></div>
   <div style="grid-column:y 3"></div>
   <div style="grid-column:y 2"></div>
   <div style="grid-column:y 1"></div>
   <div style="grid-column:y -1"></div>
   <div style="grid-column:y -2"></div>