diff options
Diffstat (limited to 'testing/web-platform/tests/css/css-grid/masonry')
61 files changed, 1203 insertions, 853 deletions
diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/align-content/masonry-align-content-001-ref.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/alignment/masonry-align-content-001-ref.html index fff6cf2138..fff6cf2138 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/align-content/masonry-align-content-001-ref.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/alignment/masonry-align-content-001-ref.html diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/align-content/masonry-align-content-001.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/alignment/masonry-align-content-001.html index dfefd998c6..387ee9da5e 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/align-content/masonry-align-content-001.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/alignment/masonry-align-content-001.html @@ -5,9 +5,13 @@ --> <html><head> <meta charset="utf-8"> - <title>CSS Grid Test: Masonry layout with `align-content` in masonry axis</title> + <title>CSS Grid Test: Masonry layout with `align-content` in masonry axis (horizontal writing mode)</title> + <meta name="assert" + content="Test passes if align-content shifts content + in the masonry axis of a masonry grid container + and the grid container's baseline is also shifted accordingly."> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> - <link rel="help" href="https://drafts.csswg.org/css-grid-2"> + <link rel="help" href="https://drafts.csswg.org/css-grid-3/#alignment"> <link rel="match" href="masonry-align-content-001-ref.html"> <style> html,body { diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/align-content/masonry-align-content-002-ref.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/alignment/masonry-align-content-002-ref.html index 67318b323a..67318b323a 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/align-content/masonry-align-content-002-ref.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/alignment/masonry-align-content-002-ref.html diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/align-content/masonry-align-content-002.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/alignment/masonry-align-content-002.html index 75b82654fe..be7e7a813e 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/align-content/masonry-align-content-002.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/alignment/masonry-align-content-002.html @@ -5,9 +5,12 @@ --> <html><head> <meta charset="utf-8"> - <title>CSS Grid Test: Masonry layout with `align-content` in masonry axis</title> + <title>CSS Grid Test: Masonry layout with `align-content` in masonry axis (vertical writing mode)</title> + <meta name="assert" + content="Test passes if align-content shifts content + in the masonry axis of a vertical writing-mode masonry grid container."> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> - <link rel="help" href="https://drafts.csswg.org/css-grid-2"> + <link rel="help" href="https://drafts.csswg.org/css-grid-3/#alignment"> <link rel="match" href="masonry-align-content-002-ref.html"> <style> html,body { diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/align-content/masonry-align-content-003-ref.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/alignment/masonry-align-content-003-ref.html index 9780d5f5dc..9da15c0f40 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/align-content/masonry-align-content-003-ref.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/alignment/masonry-align-content-003-ref.html @@ -8,31 +8,31 @@ <title>Reference: Masonry layout with `align-content` in grid axis</title> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> <style> -html,body { - color:black; background-color:white; font:15px/1 monospace; padding:0; margin:0; -} + html,body { + color:black; background-color:white; font:15px/1 monospace; padding:0; margin:0; + } -grid { - display: inline-grid; - gap: 1px 2px; - grid-template-columns: 1ch auto; - grid-template-rows: repeat(4,auto); - background: content-box silver; - border: 1px solid; - padding: 0 3px 2px 0; - width: 100px; - height: 120px; - align-content: center; - justify-items: start; -} + grid { + display: inline-grid; + gap: 1px 2px; + grid-template-columns: 1ch auto; + grid-template-rows: repeat(4,19px); + background: content-box silver; + border: 1px solid; + padding: 0 3px 2px 0; + width: 100px; + height: 120px; + align-content: center; + justify-items: start; + } -item { - background-color: #444; - color: #fff; -} + item { + background-color: #444; + color: #fff; + } -.tall { grid-row: span 2; padding: 3px 11px 1px 13px; } -</style> + .tall { grid-row: span 2; padding: 3px 11px 1px 13px; } + </style> </head> <body> @@ -90,7 +90,7 @@ item { <item style="grid-row:3/4">6</item> </grid> -<grid style="align-content:stretch"> +<grid style="align-content:stretch; grid-template-rows: repeat(4,29.25px);"> <item class="tall" style="grid-row:1/2">1</item> <item style="grid-row:2/3">2</item> <item style="grid-row:3/4">3</item> diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/align-content/masonry-align-content-003.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/alignment/masonry-align-content-003.html index ae58e79cb2..818d7e2d84 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/align-content/masonry-align-content-003.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/alignment/masonry-align-content-003.html @@ -5,9 +5,13 @@ --> <html><head> <meta charset="utf-8"> - <title>CSS Grid Test: Masonry layout with `align-content` in grid axis</title> + <title>CSS Grid Test: Masonry layout with `align-content` in grid axis (horizontal writing mode)</title> + <meta name="assert" + content="Test passes if align-content distributes tracks + in the grid axis of a masonry grid container + and the grid container's baseline is also shifted accordingly."> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> - <link rel="help" href="https://drafts.csswg.org/css-grid-2"> + <link rel="help" href="https://drafts.csswg.org/css-grid-3/#alignment"> <link rel="match" href="masonry-align-content-003-ref.html"> <style> html,body { diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/align-content/masonry-align-content-004-ref.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/alignment/masonry-align-content-004-ref.html index de11c836b8..de11c836b8 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/align-content/masonry-align-content-004-ref.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/alignment/masonry-align-content-004-ref.html diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/align-content/masonry-align-content-004.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/alignment/masonry-align-content-004.html index 3f07aa1fe7..747420ba46 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/align-content/masonry-align-content-004.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/alignment/masonry-align-content-004.html @@ -5,9 +5,12 @@ --> <html><head> <meta charset="utf-8"> - <title>CSS Grid Test: Masonry layout with `align-content` in grid axis</title> + <title>CSS Grid Test: Masonry layout with `align-content` in grid axis (vertical writing mode)</title> + <meta name="assert" + content="Test passes if align-content distributes tracks + in the grid axis of a vertical writing-mode masonry grid container."> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> - <link rel="help" href="https://drafts.csswg.org/css-grid-2"> + <link rel="help" href="https://drafts.csswg.org/css-grid-3/#alignment"> <link rel="match" href="masonry-align-content-004-ref.html"> <style> html,body { diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/justify-content/masonry-justify-content-001-ref.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/alignment/masonry-justify-content-001-ref.html index f7d9ccf48f..f7d9ccf48f 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/justify-content/masonry-justify-content-001-ref.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/alignment/masonry-justify-content-001-ref.html diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/justify-content/masonry-justify-content-001.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/alignment/masonry-justify-content-001.html index 3d60ac19fe..36ecd4f3b3 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/justify-content/masonry-justify-content-001.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/alignment/masonry-justify-content-001.html @@ -5,9 +5,12 @@ --> <html><head> <meta charset="utf-8"> - <title>CSS Grid Test: Masonry layout with `justify-content` in grid axis</title> + <title>CSS Grid Test: Masonry layout with `justify-content` in grid axis (horizontal writing mode)</title> + <meta name="assert" + content="Test passes if justify-content distributes tracks + in the grid axis of a masonry grid container."> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> - <link rel="help" href="https://drafts.csswg.org/css-grid-2"> + <link rel="help" href="https://drafts.csswg.org/css-grid-3/#alignment"> <link rel="match" href="masonry-justify-content-001-ref.html"> <style> html,body { diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/justify-content/masonry-justify-content-002-ref.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/alignment/masonry-justify-content-002-ref.html index 6889af7eac..6889af7eac 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/justify-content/masonry-justify-content-002-ref.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/alignment/masonry-justify-content-002-ref.html diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/justify-content/masonry-justify-content-002.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/alignment/masonry-justify-content-002.html index b1db084d4e..fc3696282c 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/justify-content/masonry-justify-content-002.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/alignment/masonry-justify-content-002.html @@ -5,9 +5,12 @@ --> <html><head> <meta charset="utf-8"> - <title>CSS Grid Test: Masonry layout with `justify-content` in grid axis</title> + <title>CSS Grid Test: Masonry layout with `justify-content` in grid axis (vertical writing mode)</title> + <meta name="assert" + content="Test passes if justify-content distributes tracks + in the grid axis of a vertical writing-mode masonry grid container."> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> - <link rel="help" href="https://drafts.csswg.org/css-grid-2"> + <link rel="help" href="https://drafts.csswg.org/css-grid-3/#alignment"> <link rel="match" href="masonry-justify-content-002-ref.html"> <style> html,body { diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/justify-content/masonry-justify-content-003-ref.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/alignment/masonry-justify-content-003-ref.html index 81d0fba410..81d0fba410 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/justify-content/masonry-justify-content-003-ref.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/alignment/masonry-justify-content-003-ref.html diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/justify-content/masonry-justify-content-003.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/alignment/masonry-justify-content-003.html index 772984b9e0..e2e6ead819 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/justify-content/masonry-justify-content-003.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/alignment/masonry-justify-content-003.html @@ -5,9 +5,12 @@ --> <html><head> <meta charset="utf-8"> - <title>CSS Grid Test: Masonry layout with `justify-content` in masonry axis</title> + <title>CSS Grid Test: Masonry layout with `justify-content` in masonry axis (horizontal writing mode)</title> + <meta name="assert" + content="Test passes if justify-content shifts content + in the masonry axis of a masonry grid container."> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> - <link rel="help" href="https://drafts.csswg.org/css-grid-2"> + <link rel="help" href="https://drafts.csswg.org/css-grid-3/#alignment"> <link rel="match" href="masonry-justify-content-003-ref.html"> <style> html,body { diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/justify-content/masonry-justify-content-004-ref.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/alignment/masonry-justify-content-004-ref.html index 43af71fc01..43af71fc01 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/justify-content/masonry-justify-content-004-ref.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/alignment/masonry-justify-content-004-ref.html diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/justify-content/masonry-justify-content-004.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/alignment/masonry-justify-content-004.html index 7d04ffeb4b..e309ef8870 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/justify-content/masonry-justify-content-004.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/alignment/masonry-justify-content-004.html @@ -5,9 +5,12 @@ --> <html><head> <meta charset="utf-8"> - <title>CSS Grid Test: Masonry layout with `justify-content` in masonry axis</title> + <title>CSS Grid Test: Masonry layout with `justify-content` in masonry axis (vertical writing mode)</title> + <meta name="assert" + content="Test passes if justify-content shifts content + in the masonry axis of a vertical writing-mode masonry grid container."> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> - <link rel="help" href="https://drafts.csswg.org/css-grid-2"> + <link rel="help" href="https://drafts.csswg.org/css-grid-3/#alignment"> <link rel="match" href="masonry-justify-content-004-ref.html"> <style> html,body { diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/fragmentation/masonry-fragmentation-001.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/fragmentation/masonry-fragmentation-001.html index 69182c5425..24a5b29061 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/fragmentation/masonry-fragmentation-001.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/fragmentation/masonry-fragmentation-001.html @@ -7,7 +7,7 @@ <meta charset="utf-8"> <title>CSS Grid Test: Masonry layout fragmentation</title> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> - <link rel="help" href="https://drafts.csswg.org/css-grid-2"> + <link rel="help" href="https://drafts.csswg.org/css-grid-3"> <link rel="match" href="masonry-fragmentation-001-ref.html"> <style> html,body { diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/fragmentation/masonry-fragmentation-002.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/fragmentation/masonry-fragmentation-002.html index 01c4de00b5..76a0540fa9 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/fragmentation/masonry-fragmentation-002.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/fragmentation/masonry-fragmentation-002.html @@ -7,7 +7,7 @@ <meta charset="utf-8"> <title>CSS Grid Test: Masonry layout fragmentation</title> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> - <link rel="help" href="https://drafts.csswg.org/css-grid-2"> + <link rel="help" href="https://drafts.csswg.org/css-grid-3"> <link rel="match" href="masonry-fragmentation-002-ref.html"> <style> html,body { diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/fragmentation/masonry-fragmentation-003.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/fragmentation/masonry-fragmentation-003.html index fe150e7f83..7252fc169e 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/fragmentation/masonry-fragmentation-003.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/fragmentation/masonry-fragmentation-003.html @@ -7,7 +7,7 @@ <meta charset="utf-8"> <title>CSS Grid Test: Grid axis fragmentation with column masonry layout</title> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> - <link rel="help" href="https://drafts.csswg.org/css-grid-2"> + <link rel="help" href="https://drafts.csswg.org/css-grid-3"> <link rel="match" href="masonry-fragmentation-003-ref.html"> <style> html,body { diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/gap/masonry-gap-001-ref.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/gap/masonry-gap-001-ref.html index 031629e926..7157460267 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/gap/masonry-gap-001-ref.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/gap/masonry-gap-001-ref.html @@ -15,7 +15,7 @@ html,body { grid { display: inline-grid; gap: 10px 20px; - grid-template-columns: auto min-content repeat(2,auto); + grid-template-columns: auto min-content repeat(2,auto); color: #444; border: 1px solid; padding: 2px; @@ -27,6 +27,8 @@ item { padding: 20px; margin: 3px; border: 5px solid blue; + place-self: start; + grid-row: span 2; } </style> </head> @@ -34,9 +36,8 @@ item { <grid> <item>1</item> - <item style="padding:0; place-self:start; min-width:0">2</item> + <item style="padding:0; grid-row: span 1">2</item> <item>3</item> <item>4</item> - <item style="order:1; width:0; margin-right:-23px; margin-top:-37px; align-self:start">5</item> - <item>6</item> + <item style="padding:0; grid-column: 2; grid-row: 2">5</item> </grid> diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/gap/masonry-gap-001.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/gap/masonry-gap-001.html index 673bbe40e4..628c00135d 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/gap/masonry-gap-001.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/gap/masonry-gap-001.html @@ -7,7 +7,7 @@ <meta charset="utf-8"> <title>CSS Grid Test: Masonry layout with definite `gap` in both axes</title> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> - <link rel="help" href="https://drafts.csswg.org/css-grid-2"> + <link rel="help" href="https://drafts.csswg.org/css-grid-3/#alignment"> <link rel="match" href="masonry-gap-001-ref.html"> <style> html,body { @@ -17,7 +17,7 @@ html,body { grid { display: inline-grid; gap: 10px 20px; - grid-template-columns: repeat(4,auto); + grid-template-columns: repeat(4,auto); grid-template-rows: masonry; color: #444; border: 1px solid; @@ -36,10 +36,9 @@ item { <body> <grid> - <item>1</item> - <item style="padding:0">2</item> - <item>3</item> - <item>4</item> - <item>5</item> - <item>6</item> + <item style="grid-column: 1;">1</item> + <item style="padding:0; grid-column: 2;">2</item> + <item style="grid-column: 3;">3</item> + <item style="grid-column: 4;">4</item> + <item style="padding:0; grid-column: 2;">5</item> </grid> diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/gap/masonry-gap-002-ref.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/gap/masonry-gap-002-ref.html new file mode 100644 index 0000000000..834a884f76 --- /dev/null +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/gap/masonry-gap-002-ref.html @@ -0,0 +1,62 @@ +<!DOCTYPE HTML> +<!-- + Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ +--> +<html><head> + <meta charset="utf-8"> + <title>Reference: Masonry layout with normal `gap` in both axes</title> + <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> + <link rel="author" title="Elika J. Etemad" href="https://fantasai.inkedblade.net/contact"> + <style> +html,body { + color:black; background-color:white; font:25px/1 "Courier New", monospace; padding:0; margin:0; +} + +grid { + display: inline-grid; + gap: 0; + grid-template-columns: auto min-content repeat(2,auto); + color: #444; + border: 1px solid; + padding: 2px; +} + +item { + background-color: #444; + color: #fff; + padding: 20px; + margin: 3px; + border: 5px solid blue; + place-self: start; + grid-row: span 2; + display: block; +} +</style> +</head> +<body> + +<grid> + <item>1</item> + <item style="padding:0; grid-row: span 1">2</item> + <item>3</item> + <item>4</item> + <item style="padding:0; grid-column: 2; grid-row: 2">5</item> +</grid> + +<grid> + <item>1</item> + <item style="padding:0; grid-row: span 1">2</item> + <item>3</item> + <item>4</item> + <item style="padding:0; grid-column: 2; grid-row: 2">5</item> +</grid> + +<grid> + <div style="columns: 3; column-gap: 1em;"> + <item>1</item> + <item>2</item> + <item>3</item> + </div> +</grid> + diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/gap/masonry-gap-002.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/gap/masonry-gap-002.html new file mode 100644 index 0000000000..6dae0a1a72 --- /dev/null +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/gap/masonry-gap-002.html @@ -0,0 +1,71 @@ +<!DOCTYPE HTML> +<!-- + Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ +--> +<html><head> + <meta charset="utf-8"> + <title>CSS Grid Test: Masonry layout with normal `gap` in both axes</title> + <meta name="assert" + content="Test passes if a 'normal' gap is the initial value, + is resolved to zero, + does not allow margin collapsing, + and inherits as 'normal' in masonry layout"> + <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> + <link rel="author" title="Elika J. Etemad" href="https://fantasai.inkedblade.net/contact"> + <link rel="help" href="https://drafts.csswg.org/css-grid-3/#alignment"> + <link rel="match" href="masonry-gap-001-ref.html"> + <style> +html,body { + color:black; background-color:white; font:25px/1 "Courier New", monospace; padding:0; margin:0; +} + +grid { + display: inline-grid; + grid-template-columns: repeat(4,auto); + grid-template-rows: masonry; + color: #444; + border: 1px solid; + padding: 2px; +} + +item { + background-color: #444; + color: #fff; + padding: 20px; + margin: 3px; + border: 5px solid blue; + display: block; +} + +</style> +</head> +<body> + +<!-- test initial value of normal --> +<grid> + <item style="grid-column: 1;">1</item> + <item style="padding:0; grid-column: 2;">2</item> + <item style="grid-column: 3;">3</item> + <item style="grid-column: 4;">4</item> + <item style="padding:0; grid-column: 2;">5</item> +</grid> + +<!-- test that 'normal' is supported and also resolves to zero --> +<grid style="gap: 10px; gap: normal"> + <item style="grid-column: 1;">1</item> + <item style="padding:0; grid-column: 2;">2</item> + <item style="grid-column: 3;">3</item> + <item style="grid-column: 4;">4</item> + <item style="padding:0; grid-column: 2;">5</item> +</grid> + +<!-- test inheritance of normal as keyword --> + +<grid style="gap: 10px; gap: normal"> + <div style="columns: 3; gap: inherit;"> + <item>1</item> + <item>2</item> + <item>3</item> + </div> +</grid> diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/grid-placement/masonry-grid-placement-named-lines-001-ref.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/grid-placement/masonry-grid-placement-named-lines-001-ref.html index c99b117f2e..2aefa719dc 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/grid-placement/masonry-grid-placement-named-lines-001-ref.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/grid-placement/masonry-grid-placement-named-lines-001-ref.html @@ -5,7 +5,7 @@ --> <html><head> <meta charset="utf-8"> - <title>Reference: Placement involving named lines</title> + <title>Reference: Definite column placement in a masonry grid (single edge)</title> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> <style> body,html { color:black; background:white; font-size:15px/1 monospace; padding:0; margin:0; } diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/grid-placement/masonry-grid-placement-named-lines-001.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/grid-placement/masonry-grid-placement-named-lines-001.html index b6745f6973..8bb78e307d 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/grid-placement/masonry-grid-placement-named-lines-001.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/grid-placement/masonry-grid-placement-named-lines-001.html @@ -5,8 +5,9 @@ --> <html><head> <meta charset="utf-8"> - <title>CSS Grid Test: Placement involving named lines</title> + <title>CSS Grid Test: Definite column placement in a masonry grid (single edge)</title> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> + <link rel="help" href="https://drafts.csswg.org/css-grid-3/#grid-template-masonry"> <link rel="help" href="https://drafts.csswg.org/css-grid/#grid-placement-int"> <link rel="match" href="masonry-grid-placement-named-lines-001-ref.html"> <style> diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/grid-placement/masonry-grid-placement-named-lines-002-ref.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/grid-placement/masonry-grid-placement-named-lines-002-ref.html index dd589f90c5..cfe1369e87 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/grid-placement/masonry-grid-placement-named-lines-002-ref.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/grid-placement/masonry-grid-placement-named-lines-002-ref.html @@ -5,7 +5,7 @@ --> <html><head> <meta charset="utf-8"> - <title>Reference: Placement involving named lines</title> + <title>Reference: Definite column placement in a masonry grid (double edge)</title> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> <style> body,html { color:black; background:white; font:15px/1 monospace; padding:0; margin:0; } diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/grid-placement/masonry-grid-placement-named-lines-002.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/grid-placement/masonry-grid-placement-named-lines-002.html index 0ad0dfcea3..4e51f09f94 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/grid-placement/masonry-grid-placement-named-lines-002.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/grid-placement/masonry-grid-placement-named-lines-002.html @@ -5,8 +5,9 @@ --> <html><head> <meta charset="utf-8"> - <title>CSS Grid Test: Placement involving named lines</title> + <title>CSS Grid Test: Definite column placement in a masonry grid (double edge)</title> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> + <link rel="help" href="https://drafts.csswg.org/css-grid-3/#grid-template-masonry"> <link rel="help" href="https://drafts.csswg.org/css-grid/#grid-placement-int"> <link rel="match" href="masonry-grid-placement-named-lines-002-ref.html"> <style> diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-001-ref.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-001-ref.html index 898bff16d8..1a9f65aaf6 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-001-ref.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-001-ref.html @@ -3,41 +3,38 @@ Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ --> -<html><head> +<html> <meta charset="utf-8"> <title>Reference: Masonry layout intrinsic sizing</title> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> <link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style> -html,body { - color:black; background-color:white; font:15px/1 Ahem; padding:0; margin:0; -} + +@import "support/masonry-intrinsic-sizing-visual.css"; grid { display: inline-grid; gap: 1px 2px; - grid-template-columns: repeat(4,auto); - grid-auto-rows: 1em; + grid-auto-rows: auto; border: 1px solid; padding: 0 1px 0 2px; vertical-align: top; } -.fr { +.auto grid { + grid-template-columns: repeat(4,auto); +} +.fr grid { grid-template-columns: 1fr 2fr 1fr 1fr; } -.mixed { +.mixed grid { grid-template-columns: 1fr 2fr min-content max-content; } - -item { - background-color: #444; - color: blue; -} </style> -</head> + <body> -<grid> +<section class="auto"> +<grid style="grid-template-columns: repeat(4, 2ch)"> <item style="width:2ch">1</item> <item>2</item> <item>3</item> @@ -45,7 +42,7 @@ item { <item>5</item> </grid> -<grid style="grid-template-columns: 1ch repeat(3,auto)"> +<grid style="grid-template-columns: repeat(4, 2ch)"> <item>1</item> <item>2</item> <item>3</item> @@ -58,7 +55,7 @@ item { <item>2</item> <item>3</item> <item>4</item> - <item style="width:2ch; grid-column:2">5</item> + <item style="width:2ch; grid-area:1/2">5</item> </grid> <grid> @@ -66,26 +63,28 @@ item { <item>2</item> <item>3</item> <item>4</item> - <item style="width:4ch; grid-column:2/span 2">5</item> + <item style="visibility: hidden">4</item> + <item style="width:4ch; grid-area:1/2/2/4">5</item> </grid> <grid> - <item>1</item> + <item style="grid-column: 4">1</item> <item>2</item> <item>3</item> <item>4</item> - <item style="grid-column:2/span 2">5</item> - <item style="width:5ch; grid-column:1/span 3">6</item> + <item style="visibility: hidden">4</item> + <item style="grid-area: 1/2/2/span 2">5</item> + <item style="width:5ch; grid-area: 2/1/3/4">6</item> </grid> - <grid> - <item>1</item> + <item style="grid-column: 4">1</item> <item>2</item> <item>3</item> <item>4</item> - <item style="width:3ch; grid-column:2/span 2">5</item> - <item style="width:5ch; grid-column:1/span 3">6</item> + <item style="visibility: hidden">4</item> + <item style="width:3ch; grid-area:1/2/2/4">5</item> + <item style="width:5ch; grid-area:2/1/3/4">6</item> </grid> <grid> @@ -104,17 +103,20 @@ item { <item style="width:6ch; grid-column:span 4">5</item> </grid> -<grid style="grid-template-columns: repeat(4,1ch)"> +<grid> <item>1</item> <item>2</item> <item>3</item> <item>4</item> - <item style="width:6ch; grid-column:span 3">5</item> + <item style="width:6ch; grid-area: 2/1/3/4">5</item> + <item style="width:6ch; grid-area: 2/2/3/5; visibility: hidden">5</item> </grid> +</section> <!-- ditto with 'fr' sizing --> -<grid class="fr"> +<section class="fr"> +<grid> <item style="width:2ch">1</item> <item>2</item> <item>3</item> @@ -122,7 +124,7 @@ item { <item>5</item> </grid> -<grid class="fr" style="grid-template-columns: 1ch 2fr 1fr 1fr"> +<grid> <item>1</item> <item>2</item> <item>3</item> @@ -130,42 +132,43 @@ item { <item style="width:2ch">5</item> </grid> -<grid class="fr"> +<grid> <item>1</item> <item>2</item> <item>3</item> <item>4</item> - <item style="width:2ch; grid-column:2">5</item> + <item style="width:2ch; grid-area: 1/2">5</item> </grid> -<grid class="fr"> +<grid> <item>1</item> <item>2</item> <item>3</item> <item>4</item> - <item style="width:4ch; grid-column:2/span 2">5</item> + <item style="width:4ch; grid-area: 1/2/2/4">5</item> </grid> -<grid class="fr"> - <item>1</item> +<grid> + <item style="grid-column: 4">1</item> <item>2</item> <item>3</item> <item>4</item> - <item style="grid-column:2/span 2">5</item> - <item style="width:5ch; grid-column:1/span 3">6</item> + <item style="visibility: hidden">4</item> + <item style="grid-area: 1/2/2/span 2">5</item> + <item style="width:5ch; grid-area: 2/1/3/4">6</item> </grid> - -<grid class="fr"> - <item>1</item> +<grid> + <item style="grid-column: 4">1</item> <item>2</item> <item>3</item> <item>4</item> - <item style="width:3ch; grid-column:2/span 2">5</item> - <item style="width:5ch; grid-column:1/span 3">6</item> + <item style="visibility: hidden">4</item> + <item style="width:3ch; grid-area:1/2/2/4">5</item> + <item style="width:5ch; grid-area:2/1/3/4">6</item> </grid> -<grid class="fr"> +<grid> <item>1</item> <item>2</item> <item>3</item> @@ -173,7 +176,7 @@ item { <item style="grid-column:span 4">5</item> </grid> -<grid class="fr"> +<grid> <item>1</item> <item>2</item> <item>3</item> @@ -181,18 +184,20 @@ item { <item style="width:6ch; grid-column:span 4">5</item> </grid> -<grid class="fr" style="grid-template-columns: 1ch 2ch 1ch 1ch"> +<grid> <item>1</item> <item>2</item> <item>3</item> <item>4</item> - <item style="width:6ch; grid-column:span 3">5</item> + <item style="width:6ch; grid-area: 2/1/3/4">5</item> + <item style="width:6ch; grid-area: 2/2/3/5; visibility: hidden">5</item> </grid> - +</section> <!-- ditto with mixed sizing --> -<grid class="mixed" style="grid-template-columns: 2ch 4ch 1ch 1ch"> +<section class="mixed"> +<grid style="grid-template-columns: 2ch 4ch 2ch 2ch"> <item style="width:2ch">1</item> <item>2</item> <item>3</item> @@ -200,7 +205,7 @@ item { <item>5</item> </grid> -<grid class="mixed" style="grid-template-columns: 1ch 2ch 1ch 1ch"> +<grid style="grid-template-columns: 2ch 4ch 2ch 2ch"> <item>1</item> <item>2</item> <item>3</item> @@ -208,42 +213,44 @@ item { <item style="width:2ch">5</item> </grid> -<grid class="mixed"> +<grid> <item>1</item> <item>2</item> <item>3</item> <item>4</item> - <item style="width:2ch; grid-column:2">5</item> + <item style="width:2ch; grid-area: 1/2">5</item> </grid> -<grid class="mixed"> +<grid> <item>1</item> <item>2</item> <item>3</item> <item>4</item> - <item style="width:4ch; grid-column:2/span 2">5</item> + <item style="visibility: hidden">4</item> + <item style="width:4ch; grid-area: 1/2/2/4">5</item> </grid> -<grid class="mixed"> - <item>1</item> +<grid> + <item style="grid-column: 4">1</item> <item>2</item> <item>3</item> <item>4</item> - <item style="grid-column:2/span 2">5</item> - <item style="width:5ch; grid-column:1/span 3">6</item> + <item style="visibility: hidden">4</item> + <item style="grid-area: 1/2/2/span 2">5</item> + <item style="width:5ch; grid-area: 2/1/3/4">6</item> </grid> - -<grid class="mixed"> - <item>1</item> +<grid> + <item style="grid-column: 4">1</item> <item>2</item> <item>3</item> <item>4</item> - <item style="width:3ch; grid-column:2/span 2">5</item> - <item style="width:5ch; grid-column:1/span 3">6</item> + <item style="visibility: hidden">4</item> + <item style="width:3ch; grid-area:1/2/2/4">5</item> + <item style="width:5ch; grid-area:2/1/3/4">6</item> </grid> -<grid class="mixed"> +<grid> <item>1</item> <item>2</item> <item>3</item> @@ -251,7 +258,7 @@ item { <item style="grid-column:span 4">5</item> </grid> -<grid class="mixed"> +<grid> <item>1</item> <item>2</item> <item>3</item> @@ -259,13 +266,13 @@ item { <item style="width:6ch; grid-column:span 4">5</item> </grid> -<grid class="mixed" style="grid-template-columns: 1ch 2ch 1ch 1ch"> +<grid> <item>1</item> <item>2</item> <item>3</item> <item>4</item> - <item style="width:6ch; grid-column:span 3">5</item> + <item style="width:6ch; grid-area: 2/1/3/4">5</item> + <item style="width:6ch; grid-area: 2/2/3/5; visibility: hidden">5</item> </grid> +</section> -</body> -</html> diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-001.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-001.html index 0f6cdb1495..cc0608eafe 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-001.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-001.html @@ -3,43 +3,40 @@ Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ --> -<html><head> +<html> <meta charset="utf-8"> - <title>CSS Grid Test: Masonry layout intrinsic sizing</title> + <title>CSS Grid Test: Masonry layout column sizing - intrinsic</title> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> - <link rel="help" href="https://drafts.csswg.org/css-grid-2"> + <link rel="help" href="https://drafts.csswg.org/css-grid-3/#track-sizing"> <link rel="match" href="masonry-intrinsic-sizing-001-ref.html"> <link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style> -html,body { - color:black; background-color:white; font:15px/1 Ahem; padding:0; margin:0; -} + +@import "support/masonry-intrinsic-sizing-visual.css"; grid { display: inline-grid; gap: 1px 2px; - grid-template-columns: repeat(4,auto); grid-template-rows: masonry; border: 1px solid; padding: 0 1px 0 2px; vertical-align: top; } -.fr { +.auto grid { + grid-template-columns: repeat(4,auto); +} +.fr grid { grid-template-columns: 1fr 2fr 1fr 1fr; } -.mixed { +.mixed grid { grid-template-columns: 1fr 2fr min-content max-content; } - -item { - background-color: #444; - color: blue; -} </style> -</head> + <body> -<grid> +<section class="auto"> +<grid title="Wider 1st item 2ch"> <item style="width:2ch">1</item> <item>2</item> <item>3</item> @@ -47,7 +44,7 @@ item { <item>5</item> </grid> -<grid> +<grid title="Wider 5th item 2ch"> <item>1</item> <item>2</item> <item>3</item> @@ -55,7 +52,7 @@ item { <item style="width:2ch">5</item> </grid> -<grid> +<grid title="Wider 5th item 2ch in col 2"> <item>1</item> <item>2</item> <item>3</item> @@ -63,7 +60,7 @@ item { <item style="width:2ch; grid-column:2">5</item> </grid> -<grid> +<grid title="Wider 5th item 4ch in col 2-3"> <item>1</item> <item>2</item> <item>3</item> @@ -71,7 +68,7 @@ item { <item style="width:4ch; grid-column:2/span 2">5</item> </grid> -<grid> +<grid title="5th item in col 2-3, wider 6th item 5ch in col 1-3"> <item>1</item> <item>2</item> <item>3</item> @@ -80,8 +77,7 @@ item { <item style="width:5ch; grid-column:1/span 3">6</item> </grid> - -<grid> +<grid title="5th item 3ch in 2-3, 6th item 5ch in 1-3"> <item>1</item> <item>2</item> <item>3</item> @@ -90,7 +86,7 @@ item { <item style="width:5ch; grid-column:1/span 3">6</item> </grid> -<grid> +<grid title="5th item span 4"> <item>1</item> <item>2</item> <item>3</item> @@ -98,7 +94,7 @@ item { <item style="grid-column:span 4">5</item> </grid> -<grid> +<grid title="5th item 6ch span 4"> <item>1</item> <item>2</item> <item>3</item> @@ -106,17 +102,19 @@ item { <item style="width:6ch; grid-column:span 4">5</item> </grid> -<grid> +<grid title="5th item 6ch span 3"> <item>1</item> <item>2</item> <item>3</item> <item>4</item> <item style="width:6ch; grid-column:span 3">5</item> </grid> +</section> <!-- ditto with 'fr' sizing --> -<grid class="fr"> +<section class="fr"> +<grid title="Wider 1st item 2ch"> <item style="width:2ch">1</item> <item>2</item> <item>3</item> @@ -124,7 +122,7 @@ item { <item>5</item> </grid> -<grid class="fr"> +<grid title="Wider 5th item 2ch"> <item>1</item> <item>2</item> <item>3</item> @@ -132,7 +130,7 @@ item { <item style="width:2ch">5</item> </grid> -<grid class="fr"> +<grid title="Wider 5th item 2ch in col 2"> <item>1</item> <item>2</item> <item>3</item> @@ -140,7 +138,7 @@ item { <item style="width:2ch; grid-column:2">5</item> </grid> -<grid class="fr"> +<grid title="Wider 5th item 4ch in col 2-3"> <item>1</item> <item>2</item> <item>3</item> @@ -148,7 +146,7 @@ item { <item style="width:4ch; grid-column:2/span 2">5</item> </grid> -<grid class="fr"> +<grid title="5th item in col 2-3, wider 6th item 5ch in col 1-3"> <item>1</item> <item>2</item> <item>3</item> @@ -157,8 +155,7 @@ item { <item style="width:5ch; grid-column:1/span 3">6</item> </grid> - -<grid class="fr"> +<grid title="5th item 3ch in 2-3, 6th item 5ch in 1-3"> <item>1</item> <item>2</item> <item>3</item> @@ -167,7 +164,7 @@ item { <item style="width:5ch; grid-column:1/span 3">6</item> </grid> -<grid class="fr"> +<grid title="5th item span 4"> <item>1</item> <item>2</item> <item>3</item> @@ -175,7 +172,7 @@ item { <item style="grid-column:span 4">5</item> </grid> -<grid class="fr"> +<grid title="5th item 6ch span 4"> <item>1</item> <item>2</item> <item>3</item> @@ -183,18 +180,19 @@ item { <item style="width:6ch; grid-column:span 4">5</item> </grid> -<grid class="fr"> +<grid title="5th item 6ch span 3"> <item>1</item> <item>2</item> <item>3</item> <item>4</item> <item style="width:6ch; grid-column:span 3">5</item> </grid> - +</section> <!-- ditto with mixed sizing --> -<grid class="mixed"> +<section class="mixed"> +<grid title="Wider 1st item 2ch"> <item style="width:2ch">1</item> <item>2</item> <item>3</item> @@ -202,7 +200,7 @@ item { <item>5</item> </grid> -<grid class="mixed"> +<grid title="Wider 5th item 2ch"> <item>1</item> <item>2</item> <item>3</item> @@ -210,7 +208,7 @@ item { <item style="width:2ch">5</item> </grid> -<grid class="mixed"> +<grid title="Wider 5th item 2ch in col 2"> <item>1</item> <item>2</item> <item>3</item> @@ -218,7 +216,7 @@ item { <item style="width:2ch; grid-column:2">5</item> </grid> -<grid class="mixed"> +<grid title="Wider 5th item 4ch in col 2-3"> <item>1</item> <item>2</item> <item>3</item> @@ -226,7 +224,7 @@ item { <item style="width:4ch; grid-column:2/span 2">5</item> </grid> -<grid class="mixed"> +<grid title="5th item in col 2-3, wider 6th item 5ch in col 1-3"> <item>1</item> <item>2</item> <item>3</item> @@ -236,7 +234,7 @@ item { </grid> -<grid class="mixed"> +<grid title="5th item 3ch in 2-3, 6th item 5ch in 1-3"> <item>1</item> <item>2</item> <item>3</item> @@ -245,7 +243,7 @@ item { <item style="width:5ch; grid-column:1/span 3">6</item> </grid> -<grid class="mixed"> +<grid title="5th item span 4"> <item>1</item> <item>2</item> <item>3</item> @@ -253,7 +251,7 @@ item { <item style="grid-column:span 4">5</item> </grid> -<grid class="mixed"> +<grid title="5th item 6ch span 4"> <item>1</item> <item>2</item> <item>3</item> @@ -261,13 +259,12 @@ item { <item style="width:6ch; grid-column:span 4">5</item> </grid> -<grid class="mixed"> +<grid title="5th item 6ch span 3"> <item>1</item> <item>2</item> <item>3</item> <item>4</item> <item style="width:6ch; grid-column:span 3">5</item> </grid> +</section> -</body> -</html> diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-002-ref.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-002-ref.html index 4f6519db94..ddae8e7fe3 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-002-ref.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-002-ref.html @@ -3,42 +3,39 @@ Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ --> -<html><head> +<html> <meta charset="utf-8"> <title>Reference: Masonry layout intrinsic sizing</title> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> <link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style> -html,body { - color:black; background-color:white; font:15px/1 Ahem; padding:0; margin:0; -} + +@import "support/masonry-intrinsic-sizing-visual.css"; grid { display: inline-grid; gap: 1px 2px; - grid-template-columns: repeat(4,auto); grid-auto-rows: 1em; border: 1px solid; padding: 0 1px 0 2px; vertical-align: top; width: min-content; } -.fr { +.auto grid { + grid-template-columns: repeat(4,auto); +} +.fr grid { grid-template-columns: 1fr 2fr 1fr 1fr; } -.mixed { +.mixed grid { grid-template-columns: 1fr 2fr min-content max-content; } - -item { - background-color: #444; - color: blue; -} </style> -</head> + <body> -<grid> +<section class="auto"> +<grid style="grid-template-columns: repeat(4, 2ch)"> <item style="width:2ch">1</item> <item>2</item> <item>3</item> @@ -46,7 +43,7 @@ item { <item>5</item> </grid> -<grid style="grid-template-columns: 1ch repeat(3,auto)"> +<grid style="grid-template-columns: repeat(4, 2ch)"> <item>1</item> <item>2</item> <item>3</item> @@ -59,7 +56,7 @@ item { <item>2</item> <item>3</item> <item>4</item> - <item style="width:2ch; grid-column:2">5</item> + <item style="width:2ch; grid-area:1/2">5</item> </grid> <grid> @@ -67,26 +64,28 @@ item { <item>2</item> <item>3</item> <item>4</item> - <item style="width:4ch; grid-column:2/span 2">5</item> + <item style="visibility: hidden">4</item> + <item style="width:4ch; grid-area:1/2/2/4">5</item> </grid> <grid> - <item>1</item> + <item style="grid-column: 4">1</item> <item>2</item> <item>3</item> <item>4</item> - <item style="grid-column:2/span 2">5</item> - <item style="width:5ch; grid-column:1/span 3">6</item> + <item style="visibility: hidden">4</item> + <item style="grid-area: 1/2/2/span 2">5</item> + <item style="width:5ch; grid-area: 2/1/3/4">6</item> </grid> - <grid> - <item>1</item> + <item style="grid-column: 4">1</item> <item>2</item> <item>3</item> <item>4</item> - <item style="width:3ch; grid-column:2/span 2">5</item> - <item style="width:5ch; grid-column:1/span 3">6</item> + <item style="visibility: hidden">4</item> + <item style="width:3ch; grid-area:1/2/2/4">5</item> + <item style="width:5ch; grid-area:2/1/3/4">6</item> </grid> <grid> @@ -105,17 +104,20 @@ item { <item style="width:6ch; grid-column:span 4">5</item> </grid> -<grid style="grid-template-columns: repeat(4,1ch)"> +<grid> <item>1</item> <item>2</item> <item>3</item> <item>4</item> - <item style="width:6ch; grid-column:span 3">5</item> + <item style="width:6ch; grid-area: 2/1/3/4">5</item> + <item style="width:6ch; grid-area: 2/2/3/5; visibility: hidden">5</item> </grid> +</section> <!-- ditto with 'fr' sizing --> -<grid class="fr"> +<section class="fr"> +<grid style="grid-template-columns: repeat(4, 2ch)"> <item style="width:2ch">1</item> <item>2</item> <item>3</item> @@ -123,7 +125,7 @@ item { <item>5</item> </grid> -<grid class="fr" style="grid-template-columns: 1ch 2fr 1fr 1fr"> +<grid style="grid-template-columns: repeat(4, 2ch)"> <item>1</item> <item>2</item> <item>3</item> @@ -131,42 +133,43 @@ item { <item style="width:2ch">5</item> </grid> -<grid class="fr"> +<grid> <item>1</item> <item>2</item> <item>3</item> <item>4</item> - <item style="width:2ch; grid-column:2">5</item> + <item style="width:2ch; grid-area: 1/2">5</item> </grid> -<grid class="fr"> +<grid> <item>1</item> <item>2</item> <item>3</item> <item>4</item> - <item style="width:4ch; grid-column:2/span 2">5</item> + <item style="width:4ch; grid-area: 1/2/2/4">5</item> </grid> -<grid class="fr"> - <item>1</item> +<grid> + <item style="grid-column: 4">1</item> <item>2</item> <item>3</item> <item>4</item> - <item style="grid-column:2/span 2">5</item> - <item style="width:5ch; grid-column:1/span 3">6</item> + <item style="visibility: hidden">4</item> + <item style="grid-area: 1/2/2/span 2">5</item> + <item style="width:5ch; grid-area: 2/1/3/4">6</item> </grid> - -<grid class="fr"> - <item>1</item> +<grid> + <item style="grid-column: 4">1</item> <item>2</item> <item>3</item> <item>4</item> - <item style="width:3ch; grid-column:2/span 2">5</item> - <item style="width:5ch; grid-column:1/span 3">6</item> + <item style="visibility: hidden">4</item> + <item style="width:3ch; grid-area:1/2/2/4">5</item> + <item style="width:5ch; grid-area:2/1/3/4">6</item> </grid> -<grid class="fr"> +<grid> <item>1</item> <item>2</item> <item>3</item> @@ -174,7 +177,7 @@ item { <item style="grid-column:span 4">5</item> </grid> -<grid class="fr"> +<grid> <item>1</item> <item>2</item> <item>3</item> @@ -182,18 +185,20 @@ item { <item style="width:6ch; grid-column:span 4">5</item> </grid> -<grid class="fr" style="grid-template-columns: 1ch 1ch 1ch 1ch"> +<grid> <item>1</item> <item>2</item> <item>3</item> <item>4</item> - <item style="width:6ch; grid-column:span 3">5</item> + <item style="width:6ch; grid-area: 2/1/3/4">5</item> + <item style="width:6ch; grid-area: 2/2/3/5; visibility: hidden">5</item> </grid> - +</section> <!-- ditto with mixed sizing --> -<grid class="mixed" style="grid-template-columns: 2ch 1ch 1ch 1ch"> +<section class="mixed"> +<grid style="grid-template-columns: repeat(4, 2ch)"> <item style="width:2ch">1</item> <item>2</item> <item>3</item> @@ -201,7 +206,7 @@ item { <item>5</item> </grid> -<grid class="mixed" style="grid-template-columns: 1ch 1ch 1ch 1ch"> +<grid style="grid-template-columns: repeat(4, 2ch)"> <item>1</item> <item>2</item> <item>3</item> @@ -209,42 +214,44 @@ item { <item style="width:2ch">5</item> </grid> -<grid class="mixed"> +<grid> <item>1</item> <item>2</item> <item>3</item> <item>4</item> - <item style="width:2ch; grid-column:2">5</item> + <item style="width:2ch; grid-area: 1/2">5</item> </grid> -<grid class="mixed"> +<grid> <item>1</item> <item>2</item> <item>3</item> <item>4</item> - <item style="width:4ch; grid-column:2/span 2">5</item> + <item style="visibility: hidden">4</item> + <item style="width:4ch; grid-area: 1/2/2/4">5</item> </grid> -<grid class="mixed"> - <item>1</item> +<grid> + <item style="grid-column: 4">1</item> <item>2</item> <item>3</item> <item>4</item> - <item style="grid-column:2/span 2">5</item> - <item style="width:5ch; grid-column:1/span 3">6</item> + <item style="visibility: hidden">4</item> + <item style="grid-area: 1/2/2/span 2">5</item> + <item style="width:5ch; grid-area: 2/1/3/4">6</item> </grid> - -<grid class="mixed"> - <item>1</item> +<grid> + <item style="grid-column: 4">1</item> <item>2</item> <item>3</item> <item>4</item> - <item style="width:3ch; grid-column:2/span 2">5</item> - <item style="width:5ch; grid-column:1/span 3">6</item> + <item style="visibility: hidden">4</item> + <item style="width:3ch; grid-area:1/2/2/4">5</item> + <item style="width:5ch; grid-area:2/1/3/4">6</item> </grid> -<grid class="mixed"> +<grid> <item>1</item> <item>2</item> <item>3</item> @@ -252,7 +259,7 @@ item { <item style="grid-column:span 4">5</item> </grid> -<grid class="mixed"> +<grid> <item>1</item> <item>2</item> <item>3</item> @@ -260,13 +267,14 @@ item { <item style="width:6ch; grid-column:span 4">5</item> </grid> -<grid class="mixed" style="grid-template-columns: 1ch 1ch 1ch 1ch"> +<grid> <item>1</item> <item>2</item> <item>3</item> <item>4</item> - <item style="width:6ch; grid-column:span 3">5</item> + <item style="width:6ch; grid-area: 2/1/3/4">5</item> + <item style="width:6ch; grid-area: 2/2/3/5; visibility: hidden">5</item> </grid> +</section> + -</body> -</html> diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-002.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-002.html index db83299bf5..3867bb13c8 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-002.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-002.html @@ -3,44 +3,42 @@ Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ --> -<html><head> +<html> <meta charset="utf-8"> - <title>CSS Grid Test: Masonry layout intrinsic sizing</title> + <title>CSS Grid Test: Masonry layout column sizing - min-content constraint</title> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> - <link rel="help" href="https://drafts.csswg.org/css-grid-2"> + <link rel="help" href="https://drafts.csswg.org/css-grid-3/#track-sizing"> <link rel="match" href="masonry-intrinsic-sizing-002-ref.html"> <link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style> -html,body { - color:black; background-color:white; font:15px/1 Ahem; padding:0; margin:0; -} + +@import "support/masonry-intrinsic-sizing-visual.css"; grid { display: inline-grid; gap: 1px 2px; - grid-template-columns: repeat(4,auto); grid-template-rows: masonry; border: 1px solid; padding: 0 1px 0 2px; vertical-align: top; width: min-content; } -.fr { + +.auto grid { + grid-template-columns: repeat(4,auto); +} +.fr grid { grid-template-columns: 1fr 2fr 1fr 1fr; } -.mixed { +.mixed grid { grid-template-columns: 1fr 2fr min-content max-content; } - -item { - background-color: #444; - color: blue; -} </style> -</head> + <body> -<grid> +<section class="auto"> +<grid title="Wider 1st item 2ch"> <item style="width:2ch">1</item> <item>2</item> <item>3</item> @@ -48,7 +46,7 @@ item { <item>5</item> </grid> -<grid> +<grid title="Wider 5th item 2ch"> <item>1</item> <item>2</item> <item>3</item> @@ -56,7 +54,7 @@ item { <item style="width:2ch">5</item> </grid> -<grid> +<grid title="Wider 5th item 2ch in col 2"> <item>1</item> <item>2</item> <item>3</item> @@ -64,7 +62,7 @@ item { <item style="width:2ch; grid-column:2">5</item> </grid> -<grid> +<grid title="Wider 5th item 4ch in col 2-3"> <item>1</item> <item>2</item> <item>3</item> @@ -72,7 +70,7 @@ item { <item style="width:4ch; grid-column:2/span 2">5</item> </grid> -<grid> +<grid title="5th item in col 2-3, wider 6th item 5ch in col 1-3"> <item>1</item> <item>2</item> <item>3</item> @@ -81,8 +79,7 @@ item { <item style="width:5ch; grid-column:1/span 3">6</item> </grid> - -<grid> +<grid title="5th item 3ch in 2-3, 6th item 5ch in 1-3"> <item>1</item> <item>2</item> <item>3</item> @@ -91,7 +88,7 @@ item { <item style="width:5ch; grid-column:1/span 3">6</item> </grid> -<grid> +<grid title="5th item spanning 4"> <item>1</item> <item>2</item> <item>3</item> @@ -99,7 +96,7 @@ item { <item style="grid-column:span 4">5</item> </grid> -<grid> +<grid title="5th item 6ch spanning 4"> <item>1</item> <item>2</item> <item>3</item> @@ -107,17 +104,19 @@ item { <item style="width:6ch; grid-column:span 4">5</item> </grid> -<grid> +<grid title="5th item 6ch spanning 3"> <item>1</item> <item>2</item> <item>3</item> <item>4</item> <item style="width:6ch; grid-column:span 3">5</item> </grid> +</section> <!-- ditto with 'fr' sizing --> -<grid class="fr"> +<section class="fr"> +<grid title="Wider 1st item 2ch"> <item style="width:2ch">1</item> <item>2</item> <item>3</item> @@ -125,7 +124,7 @@ item { <item>5</item> </grid> -<grid class="fr"> +<grid title="Wider 5th item 2ch"> <item>1</item> <item>2</item> <item>3</item> @@ -133,7 +132,7 @@ item { <item style="width:2ch">5</item> </grid> -<grid class="fr"> +<grid title="Wider 5th item 2ch in col 2"> <item>1</item> <item>2</item> <item>3</item> @@ -141,7 +140,7 @@ item { <item style="width:2ch; grid-column:2">5</item> </grid> -<grid class="fr"> +<grid title="Wider 5th item 4ch in col 2-3"> <item>1</item> <item>2</item> <item>3</item> @@ -149,7 +148,7 @@ item { <item style="width:4ch; grid-column:2/span 2">5</item> </grid> -<grid class="fr"> +<grid title="5th item in col 2-3, wider 6th item 5ch in col 1-3"> <item>1</item> <item>2</item> <item>3</item> @@ -158,8 +157,7 @@ item { <item style="width:5ch; grid-column:1/span 3">6</item> </grid> - -<grid class="fr"> +<grid title="5th item 3ch in 2-3, 6th item 5ch in 1-3"> <item>1</item> <item>2</item> <item>3</item> @@ -168,7 +166,7 @@ item { <item style="width:5ch; grid-column:1/span 3">6</item> </grid> -<grid class="fr"> +<grid title="5th item span 4"> <item>1</item> <item>2</item> <item>3</item> @@ -176,7 +174,7 @@ item { <item style="grid-column:span 4">5</item> </grid> -<grid class="fr"> +<grid title="5th item 6ch span 4"> <item>1</item> <item>2</item> <item>3</item> @@ -184,18 +182,19 @@ item { <item style="width:6ch; grid-column:span 4">5</item> </grid> -<grid class="fr"> +<grid title="5th item 6ch span 3"> <item>1</item> <item>2</item> <item>3</item> <item>4</item> <item style="width:6ch; grid-column:span 3">5</item> </grid> - +</section> <!-- ditto with mixed sizing --> -<grid class="mixed"> +<section class="mixed"> +<grid title="Wider 1st item 2ch"> <item style="width:2ch">1</item> <item>2</item> <item>3</item> @@ -203,7 +202,7 @@ item { <item>5</item> </grid> -<grid class="mixed"> +<grid title="Wider 5th item 2ch"> <item>1</item> <item>2</item> <item>3</item> @@ -211,7 +210,7 @@ item { <item style="width:2ch">5</item> </grid> -<grid class="mixed"> +<grid title="Wider 5th item 2ch in col 2"> <item>1</item> <item>2</item> <item>3</item> @@ -219,7 +218,7 @@ item { <item style="width:2ch; grid-column:2">5</item> </grid> -<grid class="mixed"> +<grid title="Wider 5th item 4ch in col 2-3"> <item>1</item> <item>2</item> <item>3</item> @@ -227,7 +226,7 @@ item { <item style="width:4ch; grid-column:2/span 2">5</item> </grid> -<grid class="mixed"> +<grid title="5th item in col 2-3, wider 6th item 5ch in col 1-3"> <item>1</item> <item>2</item> <item>3</item> @@ -236,8 +235,7 @@ item { <item style="width:5ch; grid-column:1/span 3">6</item> </grid> - -<grid class="mixed"> +<grid title="5th item 3ch in 2-3, 6th item 5ch in 1-3"> <item>1</item> <item>2</item> <item>3</item> @@ -246,7 +244,7 @@ item { <item style="width:5ch; grid-column:1/span 3">6</item> </grid> -<grid class="mixed"> +<grid title="5th item spanning 4"> <item>1</item> <item>2</item> <item>3</item> @@ -254,7 +252,7 @@ item { <item style="grid-column:span 4">5</item> </grid> -<grid class="mixed"> +<grid title="5th item 6ch spanning 4"> <item>1</item> <item>2</item> <item>3</item> @@ -262,13 +260,12 @@ item { <item style="width:6ch; grid-column:span 4">5</item> </grid> -<grid class="mixed"> +<grid title="5th item 6ch spanning 3"> <item>1</item> <item>2</item> <item>3</item> <item>4</item> <item style="width:6ch; grid-column:span 3">5</item> </grid> +</section> -</body> -</html> diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-003-ref.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-003-ref.html index 61eb21570d..044750dc45 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-003-ref.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-003-ref.html @@ -3,267 +3,331 @@ Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ --> -<html><head> +<html> <meta charset="utf-8"> <title>Reference: Masonry layout min-content sizing</title> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> <link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style> -html,body { - color:black; background-color:white; font:15px/1 Ahem; padding:0; margin:0; -} + +@import "support/masonry-intrinsic-sizing-visual.css"; grid { display: inline-grid; gap: 1px 2px; - grid-template-columns: repeat(4,auto); - grid-auto-rows: 1em; border: 1px solid; padding: 0 1px 0 2px; vertical-align: top; width: min-content; } -.fr { +.auto grid { + grid-template-columns: repeat(4,auto); +} +.fr grid { grid-template-columns: 1fr 2fr 1fr 1fr; } -.mixed { +.mixed grid { grid-template-columns: 1fr 2fr min-content max-content; } item { - background-color: #444; - color: blue; + align-self: start; +} +.hidden { + visibility: hidden; + height: 0; } -item.start { align-self: start; } </style> -</head> + <body> -<grid style="grid-template-rows: 1em 2em"> +<section class="auto"> +<grid style="grid-template-columns: repeat(4, 2ch)"> <item style="width:2ch">1</item> - <item>2 2</item> - <item>3 3</item> + <item style="grid-row: span 2">2 2</item> + <item style="grid-row: span 2">3 3</item> <item>4</item> - <item>5 5</item> + <item style="grid-row: span 2">5 5</item> </grid> -<grid style="grid: 1em 2em / 1ch repeat(3,auto); "> +<grid style="grid-template-columns: repeat(4, 2ch)"> <item>1</item> - <item>2 2</item> - <item>3 3</item> + <item style="grid-row: span 2">2 2</item> + <item style="grid-row: span 2">3 3</item> <item>4</item> - <item style="width:2ch">5 5</item> + <item style="grid-row: span 2">5 5</item> </grid> -<grid style="grid-template-rows: 2em 2em"> - <item class="start">1</item> - <item>2 2</item> - <item>3 3</item> - <item class="start">4</item> - <item style="width:2ch; grid-column:2">5 5</item> +<grid> + <item>1</item> + <item style="grid-row: span 2">2 2</item> + <item style="grid-row: span 2">3 3</item> + <item>4</item> + <item style="width:2ch; grid-area: 1/2/3">5 5</item> </grid> -<grid style="grid-template-rows: 2em 1em"> - <item class="start">1</item> - <item>2 2</item> - <item>3 3</item> - <item class="start">4</item> - <item style="width:4ch; grid-column:2/span 2">5 5</item> +<grid> + <item>1</item> + <item style="grid-row: span 2">2 2</item> + <item style="grid-row: span 2">3 3</item> + <item>4</item> + <item style="width:4ch; grid-area: 1/2/auto/4">5 5</item> + + <item class="hidden">0</item> </grid> -<grid style="grid-template-rows: 2em 1em"> - <item class="start">1</item> - <item>2 2</item> - <item>3 3</item> - <item class="start">4</item> - <item style="grid-column:2/span 2">5 5</item> - <item style="width:5ch; grid-column:1/span 3">6</item> +<grid> + <item style="grid-column: 4">1</item> + <item style="grid-row: span 2">2 2</item> + <item style="grid-row: span 2">3 3</item> + <item>4</item> + <item style="grid-area: 1/2/2/4">5 5</item> + <item style="width:5ch; grid-area: 2/1/3/4">6</item> + + <item class="hidden">0</item> + <item class="hidden">0 0</item> + <item class="hidden">0 0</item> </grid> -<grid style="grid-template-rows: 2em 1em"> - <item class="start">1</item> - <item>2 2</item> - <item>3 3</item> - <item class="start">4</item> - <item style="width:3ch; grid-column:2/span 2">5 5</item> - <item style="width:5ch; grid-column:1/span 3">6</item> +<grid> + <item style="grid-column: 4">1</item> + <item style="grid-row: span 2">2 2</item> + <item style="grid-row: span 2">3 3</item> + <item>4</item> + <item style="width:3ch; grid-area: 1/2/2/4">5 5</item> + <item style="width:5ch; grid-area: 2/1/3/4">6</item> + + <item class="hidden">0</item> + <item class="hidden">0 0</item> + <item class="hidden">0 0</item> </grid> -<grid style="grid-template-rows: 2em 1em"> - <item class="start">1</item> - <item>2 2</item> - <item>3 3</item> - <item class="start">4</item> - <item style="grid-column:span 4">5 5</item> +<grid> + <item>1</item> + <item style="grid-row: span 2">2 2</item> + <item style="grid-row: span 2">3 3</item> + <item>4</item> + <item style="grid-area: 3/1/4/5">5 5</item> + + <item class="hidden">0 0</item> + <item class="hidden">0 0</item> </grid> -<grid style="grid-template-rows: 2em 1em"> - <item class="start">1</item> - <item>2 2</item> - <item>3 3</item> - <item class="start">4</item> - <item style="width:6ch; grid-column:span 4">5 5</item> +<grid> + <item>1</item> + <item style="grid-row: span 2">2 2</item> + <item style="grid-row: span 2">3 3</item> + <item>4</item> + <item style="width:6ch; grid-area: 3/1/4/5">5 5</item> + + <item class="hidden">0 0</item> + <item class="hidden">0 0</item> </grid> -<grid style="grid: 2em 1em / repeat(4,1ch)"> - <item class="start">1</item> - <item>2 2</item> - <item>3 3</item> - <item class="start">4</item> - <item style="width:6ch; grid-column:span 3">5 5</item> +<grid> + <item>1</item> + <item style="grid-row: span 2">2 2</item> + <item style="grid-row: span 2">3 3</item> + <item>4</item> + <item style="width:6ch; grid-area: 3/1/4/4">5 5</item> + + <item class="hidden">0 0</item> + <item class="hidden">0 0</item> + <item class="hidden" style="width:6ch; grid-area: 3/2/4/5">0 0</item> </grid> +</section> <!-- ditto with 'fr' sizing --> -<grid class="fr" style="grid: 1em 2em / 2ch 2fr 1fr 1fr"> - <item style="width:2ch" class="start">1</item> - <item>2 2</item> - <item>3 3</item> - <item class="start">4</item> - <item>5 5</item> +<section class="fr"> +<grid style="grid-template-columns: repeat(4, 2ch)"> + <item style="width:2ch">1</item> + <item style="grid-row: span 2">2 2</item> + <item style="grid-row: span 2">3 3</item> + <item>4</item> + <item style="grid-row: span 2">5 5</item> </grid> -<grid class="fr" style="grid: 1em 2em / repeat(4,1ch)"> - <item class="start">1</item> - <item>2 2</item> - <item>3 3</item> - <item class="start">4</item> - <item style="width:2ch">5 5</item> +<grid style="grid-template-columns: repeat(4, 2ch)"> + <item>1</item> + <item style="grid-row: span 2">2 2</item> + <item style="grid-row: span 2">3 3</item> + <item>4</item> + <item style="grid-row: span 2">5 5</item> </grid> -<grid class="fr" style="grid: 2em 2em / 1ch 2ch repeat(2,1ch)"> - <item class="start">1</item> - <item>2 2</item> - <item>3 3</item> - <item class="start">4</item> - <item style="width:2ch; grid-column:2">5 5</item> +<grid> + <item>1</item> + <item style="grid-row: span 2">2 2</item> + <item style="grid-row: span 2">3 3</item> + <item>4</item> + <item style="width:2ch; grid-area: 1/2/3">5 5</item> </grid> -<grid class="fr" style="grid: 2em 1em / repeat(4,1ch)"> - <item class="start">1</item> - <item>2 2</item> - <item>3 3</item> - <item class="start">4</item> - <item style="width:4ch; grid-column:2/span 2">5 5</item> +<grid> + <item>1</item> + <item style="grid-row: span 2">2 2</item> + <item style="grid-row: span 2">3 3</item> + <item>4</item> + <item style="width:4ch; grid-area: 1/2/auto/4">5 5</item> + <item class="hidden">0</item> </grid> -<grid class="fr" style="grid: 2em 2em / repeat(4,1ch)"> - <item class="start">1</item> - <item>2 2</item> - <item>3 3</item> - <item class="start">4</item> - <item style="grid-column:2/span 2">5 5</item> - <item style="width:5ch; grid-column:1/span 3">6</item> +<grid> + <item style="grid-column: 4">1</item> + <item style="grid-row: span 2">2 2</item> + <item style="grid-row: span 2">3 3</item> + <item>4</item> + <item style="grid-area: 1/2/2/4">5 5</item> + <item style="width:5ch; grid-area: 2/1/3/4">6</item> + <item class="hidden">0</item> + <item class="hidden">0 0</item> + <item class="hidden">0 0</item> </grid> -<grid class="fr" style="grid: 2em / repeat(4,1ch)"> - <item class="start">1</item> - <item>2 2</item> - <item>3 3</item> - <item class="start">4</item> - <item style="width:3ch; grid-column:2/span 2">5 5</item> - <item style="width:5ch; grid-column:1/span 3">6</item> +<grid> + <item style="grid-column: 4">1</item> + <item style="grid-row: span 2">2 2</item> + <item style="grid-row: span 2">3 3</item> + <item>4</item> + <item style="width:3ch; grid-area: 1/2/2/4">5 5</item> + <item style="width:5ch; grid-area: 2/1/3/4">6</item> + + <item class="hidden">0</item> + <item class="hidden">0 0</item> + <item class="hidden">0 0</item> </grid> -<grid class="fr" style="grid: 2em / repeat(4,1ch)"> - <item class="start">1</item> - <item>2 2</item> - <item>3 3</item> - <item class="start">4</item> - <item style="grid-column:span 4">5 5</item> +<grid> + <item>1</item> + <item style="grid-row: span 2">2 2</item> + <item style="grid-row: span 2">3 3</item> + <item>4</item> + <item style="grid-area: 3/1/4/5">5 5</item> + + <item class="hidden">0 0</item> + <item class="hidden">0 0</item> </grid> -<grid class="fr" style="grid: 2em / repeat(4,1ch)"> - <item class="start">1</item> - <item>2 2</item> - <item>3 3</item> - <item class="start">4</item> - <item style="width:6ch; grid-column:span 4">5 5</item> +<grid> + <item>1</item> + <item style="grid-row: span 2">2 2</item> + <item style="grid-row: span 2">3 3</item> + <item>4</item> + <item style="width:6ch; grid-area: 3/1/4/5">5 5</item> + + <item class="hidden">0 0</item> + <item class="hidden">0 0</item> </grid> -<grid class="fr" style="grid: 2em / repeat(4,1ch)"> - <item class="start">1</item> - <item>2 2</item> - <item>3 3</item> - <item class="start">4</item> - <item style="width:6ch; grid-column:span 3">5 5</item> +<grid> + <item>1</item> + <item style="grid-row: span 2">2 2</item> + <item style="grid-row: span 2">3 3</item> + <item>4</item> + <item style="width:6ch; grid-area: 3/1/4/4">5 5</item> + + <item class="hidden">0 0</item> + <item class="hidden">0 0</item> + <item class="hidden" style="width:6ch; grid-area: 3/2/4/5">0 0</item> </grid> +</section> <!-- ditto with mixed sizing --> -<grid class="mixed" style="grid: 1em 2em / 2ch repeat(3,1ch)"> - <item style="width:2ch" class="start">1</item> - <item>2 2</item> - <item>3 3</item> - <item class="start">4</item> - <item>5 5</item> +<section class="mixed"> +<grid style="grid-template-columns: repeat(3, 2ch) max-content"> + <item style="width:2ch">1</item> + <item style="grid-row: span 2">2 2</item> + <item style="grid-row: span 2">3 3</item> + <item>4</item> + <item style="grid-row: span 2">5 5</item> + <item class="hidden" style="grid-area: 2/4/4">0 0</item> </grid> -<grid class="mixed" style="grid: 1em 2em / repeat(4,1ch)"> - <item class="start">1</item> - <item>2 2</item> - <item>3 3</item> - <item class="start">4</item> - <item style="width:2ch">5 5</item> +<grid style="grid-template-columns: repeat(3, 2ch) max-content"> + <item>1</item> + <item style="grid-row: span 2">2 2</item> + <item style="grid-row: span 2">3 3</item> + <item>4</item> + <item style="grid-row: span 2">5 5</item> + <item class="hidden" style="grid-area: 2/4/4">0 0</item> </grid> -<grid class="mixed" style="grid: 2em 2em / 1ch 2ch repeat(2,1ch)"> - <item class="start">1</item> - <item>2 2</item> - <item>3 3</item> - <item class="start">4</item> - <item style="width:2ch; grid-column:2">5 5</item> +<grid> + <item>1</item> + <item style="grid-row: span 2">2 2</item> + <item style="grid-row: span 2">3 3</item> + <item>4</item> + <item style="width:2ch; grid-area: 1/2/3">5 5</item> </grid> -<grid class="mixed" style="grid: 2em 1em / repeat(4,1ch)"> - <item class="start">1</item> - <item>2 2</item> - <item>3 3</item> - <item class="start">4</item> - <item style="width:4ch; grid-column:2/span 2">5 5</item> +<grid> + <item>1</item> + <item style="grid-row: span 2">2 2</item> + <item style="grid-row: span 2">3 3</item> + <item>4</item> + <item style="width:4ch; grid-area: 1/2/auto/4">5 5</item> + <item class="hidden">0</item> </grid> -<grid class="mixed" style="grid: 2em 2em / repeat(4,1ch)"> - <item class="start">1</item> - <item>2 2</item> - <item>3 3</item> - <item class="start">4</item> - <item style="grid-column:2/span 2">5 5</item> - <item style="width:5ch; grid-column:1/span 3">6</item> +<grid> + <item style="grid-column: 4">1</item> + <item style="grid-row: span 2">2 2</item> + <item style="grid-row: span 2">3 3</item> + <item>4</item> + <item style="grid-area: 1/2/2/4">5 5</item> + <item style="width:5ch; grid-area: 2/1/3/4">6</item> + <item class="hidden">0</item> + <item class="hidden">0 0</item> + <item class="hidden">0 0</item> </grid> -<grid class="mixed" style="grid: 2em / repeat(4,1ch)"> - <item class="start">1</item> - <item>2 2</item> - <item>3 3</item> - <item class="start">4</item> - <item style="width:3ch; grid-column:2/span 2">5 5</item> - <item style="width:5ch; grid-column:1/span 3">6</item> +<grid> + <item style="grid-column: 4">1</item> + <item style="grid-row: span 2">2 2</item> + <item style="grid-row: span 2">3 3</item> + <item>4</item> + <item style="width:3ch; grid-area: 1/2/2/4">5 5</item> + <item style="width:5ch; grid-area: 2/1/3/4">6</item> + + <item class="hidden">0</item> + <item class="hidden">0 0</item> + <item class="hidden">0 0</item> </grid> -<grid class="mixed" style="grid: 2em / repeat(4,1ch)"> - <item class="start">1</item> - <item>2 2</item> - <item>3 3</item> - <item class="start">4</item> - <item style="grid-column:span 4">5 5</item> +<grid> + <item>1</item> + <item style="grid-row: span 2">2 2</item> + <item style="grid-row: span 2">3 3</item> + <item>4</item> + <item style="grid-area: 3/1/4/5">5 5</item> + + <item class="hidden">0 0</item> + <item class="hidden">0 0</item> </grid> -<grid class="mixed" style="grid: 2em / repeat(4,1ch)"> - <item class="start">1</item> - <item>2 2</item> - <item>3 3</item> - <item class="start">4</item> - <item style="width:6ch; grid-column:span 4">5 5</item> +<grid> + <item>1</item> + <item style="grid-row: span 2">2 2</item> + <item style="grid-row: span 2">3 3</item> + <item>4</item> + <item style="width:6ch; grid-area: 3/1/4/5">5 5</item> + + <item class="hidden">0 0</item> + <item class="hidden">0 0</item> </grid> -<grid class="mixed" style="grid: 2em / repeat(4,1ch)"> - <item class="start">1</item> - <item>2 2</item> - <item>3 3</item> - <item class="start">4</item> - <item style="width:6ch; grid-column:span 3">5 5</item> +<grid> + <item>1</item> + <item style="grid-row: span 2">2 2</item> + <item style="grid-row: span 2">3 3</item> + <item>4</item> + <item style="width:6ch; grid-area: 3/1/4/4">5 5</item> + + <item class="hidden">0 0</item> + <item class="hidden">0 0</item> + <item class="hidden" style="width:6ch; grid-area: 3/2/4/5">0 0</item> </grid> +</section> -</body> -</html> diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-003.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-003.html index e43bc86c9b..48489d3c86 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-003.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-003.html @@ -3,44 +3,41 @@ Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ --> -<html><head> +<html> <meta charset="utf-8"> - <title>CSS Grid Test: Masonry layout min-content sizing</title> + <title>CSS Grid Test: Masonry layout column sizing - min-content</title> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> - <link rel="help" href="https://drafts.csswg.org/css-grid-2"> + <link rel="help" href="https://drafts.csswg.org/css-grid-3/#track-sizing"> <link rel="match" href="masonry-intrinsic-sizing-003-ref.html"> <link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style> -html,body { - color:black; background-color:white; font:15px/1 Ahem; padding:0; margin:0; -} + +@import "support/masonry-intrinsic-sizing-visual.css"; grid { display: inline-grid; gap: 1px 2px; - grid-template-columns: repeat(4,auto); grid-template-rows: masonry; border: 1px solid; padding: 0 1px 0 2px; vertical-align: top; width: min-content; } -.fr { +.auto grid { + grid-template-columns: repeat(4,auto); +} +.fr grid { grid-template-columns: 1fr 2fr 1fr 1fr; } -.mixed { +.mixed grid { grid-template-columns: 1fr 2fr min-content max-content; } - -item { - background-color: #444; - color: blue; -} </style> -</head> + <body> -<grid> +<section class="auto"> +<grid title="Wider 1st item 2ch"> <item style="width:2ch">1</item> <item>2 2</item> <item>3 3</item> @@ -48,7 +45,7 @@ item { <item>5 5</item> </grid> -<grid> +<grid title="Wrapped 5th item 2ch"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -56,7 +53,7 @@ item { <item style="width:2ch">5 5</item> </grid> -<grid> +<grid title="Wrapped 5th item 2ch col 2"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -64,7 +61,7 @@ item { <item style="width:2ch; grid-column:2">5 5</item> </grid> -<grid> +<grid title="5th item 4ch in col 2-3"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -72,7 +69,7 @@ item { <item style="width:4ch; grid-column:2/span 2">5 5</item> </grid> -<grid> +<grid title="5th item in col 2-3, 6th item 5ch in col 1-3"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -81,7 +78,7 @@ item { <item style="width:5ch; grid-column:1/span 3">6</item> </grid> -<grid> +<grid title="5th item 3ch in col 2-3, 6th item 5ch in col 1-3"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -90,7 +87,7 @@ item { <item style="width:5ch; grid-column:1/span 3">6</item> </grid> -<grid> +<grid title="5th item span 4"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -98,7 +95,7 @@ item { <item style="grid-column:span 4">5 5</item> </grid> -<grid> +<grid title="5th item 6ch span 4"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -106,17 +103,19 @@ item { <item style="width:6ch; grid-column:span 4">5 5</item> </grid> -<grid> +<grid title="5th item 6ch span 3"> <item>1</item> <item>2 2</item> <item>3 3</item> <item>4</item> <item style="width:6ch; grid-column:span 3">5 5</item> </grid> +</section> <!-- ditto with 'fr' sizing --> -<grid class="fr"> +<section class="fr"> +<grid title="Wider first item 2ch"> <item style="width:2ch">1</item> <item>2 2</item> <item>3 3</item> @@ -124,7 +123,7 @@ item { <item>5 5</item> </grid> -<grid class="fr"> +<grid title="Wrapped last item 2ch"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -132,7 +131,7 @@ item { <item style="width:2ch">5 5</item> </grid> -<grid class="fr"> +<grid title="Wrapped last item 2ch col 2"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -140,7 +139,7 @@ item { <item style="width:2ch; grid-column:2">5 5</item> </grid> -<grid class="fr"> +<grid title="Last item 4ch col 2-3"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -148,7 +147,7 @@ item { <item style="width:4ch; grid-column:2/span 2">5 5</item> </grid> -<grid class="fr"> +<grid title="Item col 2-3 + Item 5ch col 1-3"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -157,7 +156,7 @@ item { <item style="width:5ch; grid-column:1/span 3">6</item> </grid> -<grid class="fr"> +<grid title="Item 3ch col 2-3 + Item 5ch col 1-3"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -166,7 +165,7 @@ item { <item style="width:5ch; grid-column:1/span 3">6</item> </grid> -<grid class="fr"> +<grid title="Last item span 4"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -174,7 +173,7 @@ item { <item style="grid-column:span 4">5 5</item> </grid> -<grid class="fr"> +<grid title="Last item 6ch span 4"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -182,17 +181,19 @@ item { <item style="width:6ch; grid-column:span 4">5 5</item> </grid> -<grid class="fr"> +<grid title="Last item 6ch span 3"> <item>1</item> <item>2 2</item> <item>3 3</item> <item>4</item> <item style="width:6ch; grid-column:span 3">5 5</item> </grid> +</section> <!-- ditto with mixed sizing --> -<grid class="mixed"> +<section class="mixed"> +<grid title="Wider first item 2ch"> <item style="width:2ch">1</item> <item>2 2</item> <item>3 3</item> @@ -200,7 +201,7 @@ item { <item>5 5</item> </grid> -<grid class="mixed"> +<grid title="Wrapped last item 2ch"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -208,7 +209,7 @@ item { <item style="width:2ch">5 5</item> </grid> -<grid class="mixed"> +<grid title="Wrapped last item 2ch col 2"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -216,7 +217,7 @@ item { <item style="width:2ch; grid-column:2">5 5</item> </grid> -<grid class="mixed"> +<grid title="Last item 4ch col 2-3"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -224,7 +225,7 @@ item { <item style="width:4ch; grid-column:2/span 2">5 5</item> </grid> -<grid class="mixed"> +<grid title="Item col 2-3 + Item 5ch col 1-3"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -233,7 +234,7 @@ item { <item style="width:5ch; grid-column:1/span 3">6</item> </grid> -<grid class="mixed"> +<grid title="Item 3ch col 2-3 + Item 5ch col 1-3"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -242,7 +243,7 @@ item { <item style="width:5ch; grid-column:1/span 3">6</item> </grid> -<grid class="mixed"> +<grid title="Last item span 4"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -250,7 +251,7 @@ item { <item style="grid-column:span 4">5 5</item> </grid> -<grid class="mixed"> +<grid title="Last item 6ch span 4"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -258,13 +259,12 @@ item { <item style="width:6ch; grid-column:span 4">5 5</item> </grid> -<grid class="mixed"> +<grid title="Last item 6ch span 3"> <item>1</item> <item>2 2</item> <item>3 3</item> <item>4</item> <item style="width:6ch; grid-column:span 3">5 5</item> </grid> +</section> -</body> -</html> diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-004-ref.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-004-ref.html index 6a5d81fedb..302dcad116 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-004-ref.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-004-ref.html @@ -3,268 +3,355 @@ Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ --> -<html><head> +<html> <meta charset="utf-8"> <title>Reference: Masonry layout max-content sizing</title> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> <link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style> -html,body { - color:black; background-color:white; font:15px/1 Ahem; padding:0; margin:0; -} + +@import "support/masonry-intrinsic-sizing-visual.css"; grid { display: inline-grid; gap: 1px 2px; - grid-template-columns: 1ch 3ch 3ch 1ch; - grid-auto-rows: 1em; border: 1px solid; padding: 0 1px 0 2px; vertical-align: top; align-items: start; width: max-content; } -.fr { +.auto grid { + grid-template-columns: repeat(4, auto); +} +.fr grid { grid-template-columns: 1fr 2fr 1fr 1fr; } -.mixed { +.mixed grid { grid-template-columns: 1fr 2fr min-content max-content; } item { - background-color: #444; - color: blue; + align-self: start; +} +.hidden { + visibility: hidden; + height: 0; } -item.start { align-self: start; } </style> -</head> + <body> -<grid style="grid: 1em 2em / 2ch 3ch 3ch 1ch"> +<section class="auto"> +<grid> <item style="width:2ch">1</item> <item>2 2</item> <item>3 3</item> <item>4</item> <item>5 5</item> + + <item class="hidden" style="grid-column: 4">0 0</item> </grid> -<grid style="grid: 1em 2em / 1ch 3ch 3ch 1ch; "> +<grid> <item>1</item> <item>2 2</item> <item>3 3</item> <item>4</item> - <item style="width:2ch">5 5</item> + <item style="width: 2ch; grid-area: 2/1">5 5</item> + + <item class="hidden" style="grid-area: 2/1">0 0</item> + <item class="hidden" style="grid-area: 2/4">0 0</item> </grid> -<grid style="grid-template-rows: 1em 2em"> - <item class="start">1</item> +<grid> + <item>1</item> <item>2 2</item> <item>3 3</item> - <item class="start">4</item> - <item style="width:2ch; grid-column:2">5 5</item> + <item style="grid-area: 2/1">4</item> + <item style="width:2ch; grid-area: 1/2/3">5 5</item> + + <item class="hidden" style="grid-area: 2/1">0 0</item> + <item class="hidden" style="grid-area: 2/2">0 0</item> </grid> <grid> - <item class="start">1</item> + <item>1</item> <item>2 2</item> <item>3 3</item> - <item class="start">4</item> - <item style="width:4ch; grid-column:2/span 2">5 5</item> + <item style="grid-area: 2/2">4</item> + <item style="width:4ch; grid-area: 1/2/auto/4">5 5</item> + + <item class="hidden" style="grid-area: 2/2">0 0</item> + <item class="hidden" style="grid-area: 2/3">0 0</item> </grid> <grid> - <item class="start">1</item> + <item style="grid-area: 1/4">1</item> <item>2 2</item> <item>3 3</item> - <item class="start">4</item> - <item style="grid-column:2/span 2">5 5</item> - <item style="width:5ch; grid-column:1/span 3">6</item> + <item>4</item> + <item style="grid-area: 1/2/2/4">5 5</item> + <item style="width:5ch; grid-area: 2/1/3/4">6</item> + + <item class="hidden" style="grid-area: 1/1">0</item> + <item class="hidden" style="grid-area: 2/2">0 0</item> + <item class="hidden" style="grid-area: 2/3">0 0</item> + <item class="hidden" style="grid-area: 1/4">0 0</item> </grid> <grid> - <item class="start">1</item> + <item style="grid-area: 1/4">1</item> <item>2 2</item> <item>3 3</item> - <item class="start">4</item> - <item style="width:3ch; grid-column:2/span 2">5 5</item> - <item style="width:5ch; grid-column:1/span 3">6</item> + <item>4</item> + <item style="width:3ch; grid-area: 1/2/2/4">5 5</item> + <item style="width:5ch; grid-area: 2/1/3/4">6</item> + + <item class="hidden" style="grid-area: 1/1">0</item> + <item class="hidden" style="grid-area: 2/2">0 0</item> + <item class="hidden" style="grid-area: 2/3">0 0</item> + <item class="hidden" style="grid-area: 1/4">0 0</item> </grid> <grid> - <item class="start">1</item> + <item>1</item> <item>2 2</item> <item>3 3</item> - <item class="start">4</item> - <item style="grid-column:span 4">5 5</item> + <item>4</item> + <item style="grid-area: 2/1/3/5">5 5</item> + + <item class="hidden" style="grid-area: 2/1">0 0</item> + <item class="hidden" style="grid-area: 2/4">0 0</item> </grid> <grid> - <item class="start">1</item> + <item>1</item> <item>2 2</item> <item>3 3</item> - <item class="start">4</item> - <item style="width:6ch; grid-column:span 4">5 5</item> + <item>4</item> + <item style="width:6ch; grid-area: 2/1/3/5">5 5</item> + + <item class="hidden" style="grid-area: 2/1">0 0</item> + <item class="hidden" style="grid-area: 2/4">0 0</item> </grid> <grid> - <item class="start">1</item> + <item>1</item> <item>2 2</item> <item>3 3</item> - <item class="start">4</item> - <item style="width:6ch; grid-column:span 3">5 5</item> + <item>4</item> + <item style="width:6ch; grid-area: 2/1/3/4">5 5</item> + + <item class="hidden" style="grid-area: 2/1">0 0</item> + <item class="hidden" style="grid-area: 2/4">0 0</item> + <item class="hidden" style="width:6ch; grid-area: 2/2/3/5">0 0</item> </grid> +</section> <!-- ditto with 'fr' sizing --> -<grid class="fr"> - <item style="width:2ch" class="start">1</item> +<section class="fr"> +<grid> + <item style="width:2ch">1</item> <item>2 2</item> <item>3 3</item> - <item class="start">4</item> + <item>4</item> <item>5 5</item> + <item class="hidden" style="grid-area: 2/4/4">0 0</item> </grid> -<grid class="fr" style="grid: 1em 2em / 3ch 6ch 3ch 3ch"> - <item class="start">1</item> +<grid> + <item>1</item> <item>2 2</item> <item>3 3</item> - <item class="start">4</item> - <item style="width:2ch">5 5</item> + <item>4</item> + <item style="width: 2ch">5 5</item> + <item class="hidden" style="grid-area: 2/4">0 0</item> </grid> -<grid class="fr" style="grid: 1em 2em / 3ch 6ch 3ch 3ch"> - <item class="start">1</item> +<grid> + <item>1</item> <item>2 2</item> <item>3 3</item> - <item class="start">4</item> - <item style="width:2ch; grid-column:2">5 5</item> + <item>4</item> + <item style="width:2ch; grid-area: 1/2/3">5 5</item> </grid> -<grid class="fr"> - <item class="start">1</item> +<grid> + <item>1</item> <item>2 2</item> <item>3 3</item> - <item class="start">4</item> - <item style="width:4ch; grid-column:2/span 2">5 5</item> + <item>4</item> + <item style="width:4ch; grid-area: 1/2/auto/4">5 5</item> + <item class="hidden">0</item> </grid> -<grid class="fr"> - <item class="start">1</item> +<grid> + <item style="grid-area: 1/4">1</item> <item>2 2</item> <item>3 3</item> - <item class="start">4</item> - <item style="grid-column:2/span 2">5 5</item> - <item style="width:5ch; grid-column:1/span 3">6</item> + <item>4</item> + <item style="grid-area: 1/2/2/4">5 5</item> + <item style="width:5ch; grid-area: 2/1/3/4">6</item> + + <item class="hidden" style="grid-area: 1/1">0</item> + <item class="hidden" style="grid-area: 2/2">0 0</item> + <item class="hidden" style="grid-area: 2/3">0 0</item> + <item class="hidden" style="grid-area: 1/4">0 0</item> </grid> -<grid class="fr"> - <item class="start">1</item> +<grid> + <item style="grid-area: 1/4">1</item> <item>2 2</item> <item>3 3</item> - <item class="start">4</item> - <item style="width:3ch; grid-column:2/span 2">5 5</item> - <item style="width:5ch; grid-column:1/span 3">6</item> + <item>4</item> + <item style="width:3ch; grid-area: 1/2/2/4">5 5</item> + <item style="width:5ch; grid-area: 2/1/3/4">6</item> + + <item class="hidden" style="grid-area: 1/1">0</item> + <item class="hidden" style="grid-area: 2/2">0 0</item> + <item class="hidden" style="grid-area: 2/3">0 0</item> + <item class="hidden" style="grid-area: 1/4">0 0</item> </grid> -<grid class="fr"> - <item class="start">1</item> +<grid> + <item>1</item> <item>2 2</item> <item>3 3</item> - <item class="start">4</item> - <item style="grid-column:span 4">5 5</item> + <item>4</item> + <item style="grid-area: 2/1/3/5">5 5</item> + + <item class="hidden" style="grid-area: 2/1">0 0</item> + <item class="hidden" style="grid-area: 2/4">0 0</item> </grid> -<grid class="fr"> - <item class="start">1</item> +<grid> + <item>1</item> <item>2 2</item> <item>3 3</item> - <item class="start">4</item> - <item style="width:6ch; grid-column:span 4">5 5</item> + <item>4</item> + <item style="width:6ch; grid-area: 2/1/3/5">5 5</item> + + <item class="hidden" style="grid-area: 2/1">0 0</item> + <item class="hidden" style="grid-area: 2/4">0 0</item> </grid> -<grid class="fr"> - <item class="start">1</item> +<grid> + <item>1</item> <item>2 2</item> <item>3 3</item> - <item class="start">4</item> - <item style="width:6ch; grid-column:span 3">5 5</item> + <item>4</item> + <item style="width:6ch; grid-area: 2/1/3/4">5 5</item> + + <item class="hidden" style="grid-area: 2/1">0 0</item> + <item class="hidden" style="grid-area: 2/4">0 0</item> + <item class="hidden" style="width:6ch; grid-area: 2/2/3/5">0 0</item> </grid> +</section> <!-- ditto with mixed sizing --> -<grid class="mixed" style="grid: 1em 2em / 2ch 4ch 1ch 1ch"> - <item style="width:2ch" class="start">1</item> +<section class="mixed"> +<grid> + <item style="width:2ch">1</item> <item>2 2</item> - <item>3 3</item> - <item class="start">4</item> - <item>5 5</item> + <item style="grid-area: 1/3/3">3 3</item> + <item>4</item> + <item style="grid-area: 2/1">5 5</item> + + <item class="hidden" style="grid-area: 2/3; width: 2ch">0</item> + <item class="hidden" style="grid-area: 2/4">0 0</item> </grid> -<grid class="mixed" style="grid: 1em 2em / calc(3ch/2) 3ch 1ch 1ch"> - <item class="start">1</item> +<grid> + <item>1</item> <item>2 2</item> - <item>3 3</item> - <item class="start">4</item> - <item style="width:2ch">5 5</item> + <item style="grid-area: 1/3/3">3 3</item> + <item>4</item> + <item style="width: 2ch; grid-area: 2/1">5 5</item> + + <item class="hidden" style="grid-area: 2/3; width: 2ch">0</item> + <item class="hidden" style="grid-area: 2/4">0 0</item> </grid> -<grid class="mixed" style="grid: 1em 2em / calc(3ch/2) 3ch 1ch 1ch"> - <item class="start">1</item> +<grid> + <item>1</item> + <item style="grid-row: span 2">2 2</item> + <item style="grid-row: span 2">3 3</item> + <item style="grid-area: 2/1">4</item> + <item style="width:2ch; grid-area: 1/2/3">5 5</item> + + <item class="hidden" style="grid-area: 2/1">0 0</item> +</grid> + +<grid> + <item>1</item> <item>2 2</item> <item>3 3</item> - <item class="start">4</item> - <item style="width:2ch; grid-column:2">5 5</item> -</grid> + <item>4</item> + <item style="width:4ch; grid-area: 1/2/auto/4">5 5</item> -<grid class="mixed" style="grid: 2em 1em / calc(3ch/2) 3ch 1ch 1ch"> - <item class="start">1</item> - <item class="start">2 2</item> - <item class="start">3 3</item> - <item class="start">4</item> - <item style="width:4ch; grid-column:2/span 2">5 5</item> + <item class="hidden">0</item> </grid> -<grid class="mixed" style="grid: 2em 1em 1em / calc(3ch/2) 3ch 1ch 1ch"> - <item class="start">1</item> - <item class="start">2 2</item> - <item class="start">3 3</item> - <item class="start">4</item> - <item style="grid-column:2/span 2">5 5</item> - <item style="width:5ch; grid-column:1/span 3">6</item> +<grid> + <item style="grid-column: 4">1</item> + <item>2 2</item> + <item>3 3</item> + <item>4</item> + <item style="grid-area: 1/2/2/4">5 5</item> + <item style="width:5ch; grid-area: 2/1/3/4">6</item> + + <item class="hidden">0 0</item> + <item class="hidden" style="grid-area: 2/2">0 0</item> </grid> -<grid class="mixed" style="grid: 2em 1em / calc(3ch/2) 3ch 1ch 1ch"> - <item class="start">1</item> - <item class="start">2 2</item> - <item class="start">3 3</item> - <item class="start">4</item> - <item style="width:3ch; grid-column:2/span 2">5 5</item> - <item style="width:5ch; grid-column:1/span 3">6</item> +<grid> + <item style="grid-column: 4">1</item> + <item>2 2</item> + <item>3 3</item> + <item>4</item> + <item style="width:3ch; grid-area: 1/2/2/4">5 5</item> + <item style="width:5ch; grid-area: 2/1/3/4">6</item> + + <item class="hidden" style="grid-area: 2/3">0 0</item> </grid> -<grid class="mixed" style="grid: 2em 1em / calc(3ch/2) 3ch 1ch 1ch"> - <item class="start">1</item> - <item class="start">2 2</item> - <item class="start">3 3</item> - <item class="start">4</item> - <item style="grid-column:span 4">5 5</item> +<grid> + <item>1</item> + <item>2 2</item> + <item style="grid-row: span 2">3 3</item> + <item>4</item> + <item style="grid-area: 3/1/4/5">5 5</item> + + <item class="hidden">0 0</item> + <item class="hidden">0 0</item> + <item class="hidden">0 0</item> </grid> -<grid class="mixed" style="grid: 2em 1em / calc(3ch/2) 3ch 1ch 1ch"> - <item class="start">1</item> - <item class="start">2 2</item> - <item class="start">3 3</item> - <item class="start">4</item> - <item style="width:6ch; grid-column:span 4">5 5</item> +<grid> + <item>1</item> + <item>2 2</item> + <item style="grid-row: span 2">3 3</item> + <item>4</item> + <item style="width:6ch; grid-area: 3/1/4/5">5 5</item> + + <item class="hidden">0 0</item> + <item class="hidden">0 0</item> + <item class="hidden">0 0</item> </grid> -<grid class="mixed" style="grid: 2em 1em / calc(3ch/2) 3ch 1ch 1ch"> - <item class="start">1</item> - <item class="start">2 2</item> - <item class="start">3 3</item> - <item class="start">4</item> - <item style="width:6ch; grid-column:span 3">5 5</item> +<grid> + <item>1</item> + <item>2 2</item> + <item style="grid-row: span 2">3 3</item> + <item>4</item> + <item style="width:6ch; grid-area: 3/1/4/4">5 5</item> + + <item class="hidden">0 0</item> + <item class="hidden">0 0</item> + <item class="hidden" style="width:6ch; grid-area: 3/2/4/5">0 0</item> </grid> +</section> -</body> -</html> diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-004.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-004.html index 5365208c00..c8bc671bb3 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-004.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-004.html @@ -3,44 +3,41 @@ Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ --> -<html><head> +<html> <meta charset="utf-8"> - <title>CSS Grid Test: Masonry layout max-content sizing</title> + <title>CSS Grid Test: Masonry layout column sizing - max-content</title> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> - <link rel="help" href="https://drafts.csswg.org/css-grid-2"> + <link rel="help" href="https://drafts.csswg.org/css-grid-3"> <link rel="match" href="masonry-intrinsic-sizing-004-ref.html"> <link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style> -html,body { - color:black; background-color:white; font:15px/1 Ahem; padding:0; margin:0; -} + +@import "support/masonry-intrinsic-sizing-visual.css"; grid { display: inline-grid; gap: 1px 2px; - grid-template-columns: repeat(4,auto); grid-template-rows: masonry; border: 1px solid; padding: 0 1px 0 2px; vertical-align: top; width: max-content; } -.fr { +.auto grid { + grid-template-columns: repeat(4,auto); +} +.fr grid { grid-template-columns: 1fr 2fr 1fr 1fr; } -.mixed { +.mixed grid { grid-template-columns: 1fr 2fr min-content max-content; } - -item { - background-color: #444; - color: blue; -} </style> -</head> + <body> -<grid> +<section class="auto"> +<grid title="Wider 1st item 2ch"> <item style="width:2ch">1</item> <item>2 2</item> <item>3 3</item> @@ -48,7 +45,7 @@ item { <item>5 5</item> </grid> -<grid> +<grid title="Wrapped 5th item 2ch"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -56,7 +53,7 @@ item { <item style="width:2ch">5 5</item> </grid> -<grid> +<grid title="Wrapped 5th item 2ch in col 2"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -64,7 +61,7 @@ item { <item style="width:2ch; grid-column:2">5 5</item> </grid> -<grid> +<grid title="5th item 4ch in col 2-3"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -72,7 +69,7 @@ item { <item style="width:4ch; grid-column:2/span 2">5 5</item> </grid> -<grid> +<grid title="4th item in col 2-3, 5th item 5ch in col 1-3"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -81,7 +78,7 @@ item { <item style="width:5ch; grid-column:1/span 3">6</item> </grid> -<grid> +<grid title="5th item 3ch in col 2-3, 6th item 5ch in col 1-3"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -90,7 +87,7 @@ item { <item style="width:5ch; grid-column:1/span 3">6</item> </grid> -<grid> +<grid title="5th item span 4"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -98,7 +95,7 @@ item { <item style="grid-column:span 4">5 5</item> </grid> -<grid> +<grid title="5th item 6ch span 4"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -106,17 +103,19 @@ item { <item style="width:6ch; grid-column:span 4">5 5</item> </grid> -<grid> +<grid title="5th item 6ch span 3"> <item>1</item> <item>2 2</item> <item>3 3</item> <item>4</item> <item style="width:6ch; grid-column:span 3">5 5</item> </grid> +</section> <!-- ditto with 'fr' sizing --> -<grid class="fr"> +<section class="fr"> +<grid title="Wider 1st item 2ch"> <item style="width:2ch">1</item> <item>2 2</item> <item>3 3</item> @@ -124,7 +123,7 @@ item { <item>5 5</item> </grid> -<grid class="fr"> +<grid title="Wrapped 5th item 2ch"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -132,7 +131,7 @@ item { <item style="width:2ch">5 5</item> </grid> -<grid class="fr"> +<grid title="Wrapped 5th item 2ch in col 2"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -140,7 +139,7 @@ item { <item style="width:2ch; grid-column:2">5 5</item> </grid> -<grid class="fr"> +<grid title="5th item 4ch in col 2-3"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -148,7 +147,7 @@ item { <item style="width:4ch; grid-column:2/span 2">5 5</item> </grid> -<grid class="fr"> +<grid title="4th item in col 2-3, 5th item 5ch in col 1-3"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -157,7 +156,7 @@ item { <item style="width:5ch; grid-column:1/span 3">6</item> </grid> -<grid class="fr"> +<grid title="5th item 3ch in col 2-3, 6th item 5ch in col 1-3"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -166,7 +165,7 @@ item { <item style="width:5ch; grid-column:1/span 3">6</item> </grid> -<grid class="fr"> +<grid title="5th item span 4"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -174,7 +173,7 @@ item { <item style="grid-column:span 4">5 5</item> </grid> -<grid class="fr"> +<grid title="5th item 6ch span 4"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -182,17 +181,19 @@ item { <item style="width:6ch; grid-column:span 4">5 5</item> </grid> -<grid class="fr"> +<grid title="5th item 6ch span 3"> <item>1</item> <item>2 2</item> <item>3 3</item> <item>4</item> <item style="width:6ch; grid-column:span 3">5 5</item> </grid> +</section> <!-- ditto with mixed sizing --> -<grid class="mixed"> +<section class="mixed"> +<grid title="Wider 1st item 2ch"> <item style="width:2ch">1</item> <item>2 2</item> <item>3 3</item> @@ -200,7 +201,7 @@ item { <item>5 5</item> </grid> -<grid class="mixed"> +<grid title="Wrapped 5th item 2ch"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -208,7 +209,7 @@ item { <item style="width:2ch">5 5</item> </grid> -<grid class="mixed"> +<grid title="Wrapped 5th item 2ch in col 2"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -216,7 +217,7 @@ item { <item style="width:2ch; grid-column:2">5 5</item> </grid> -<grid class="mixed"> +<grid title="5th item 4ch in col 2-3"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -224,7 +225,7 @@ item { <item style="width:4ch; grid-column:2/span 2">5 5</item> </grid> -<grid class="mixed"> +<grid title="4th item in col 2-3, 5th item 5ch in col 1-3"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -233,7 +234,7 @@ item { <item style="width:5ch; grid-column:1/span 3">6</item> </grid> -<grid class="mixed"> +<grid title="5th item 3ch in col 2-3, 6th item 5ch in col 1-3"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -242,7 +243,7 @@ item { <item style="width:5ch; grid-column:1/span 3">6</item> </grid> -<grid class="mixed"> +<grid title="5th item span 4"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -250,7 +251,7 @@ item { <item style="grid-column:span 4">5 5</item> </grid> -<grid class="mixed"> +<grid title="5th item 6ch span 4"> <item>1</item> <item>2 2</item> <item>3 3</item> @@ -258,13 +259,12 @@ item { <item style="width:6ch; grid-column:span 4">5 5</item> </grid> -<grid class="mixed"> +<grid title="5th item 6ch span 3"> <item>1</item> <item>2 2</item> <item>3 3</item> <item>4</item> <item style="width:6ch; grid-column:span 3">5 5</item> </grid> +</section> -</body> -</html> diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-005-ref.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-005-ref.html index e564fb1b3e..725f646ebd 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-005-ref.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-005-ref.html @@ -3,35 +3,32 @@ Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ --> -<html><head> +<html> <meta charset="utf-8"> - <title>Reference: Masonry layout intrinsic sizing</title> + <title>Reference: Masonry layout row sizing (vertical writing mode)</title> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> <link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style> -html,body { - color:black; background-color:white; font:15px/1 Ahem; padding:0; margin:0; -} + +@import "support/masonry-intrinsic-sizing-visual.css"; grid { display: inline-grid; gap: 1px 2px; + grid-template-rows: repeat(4,auto); grid-auto-flow: column; border: 1px solid; padding: 0 1px 0 2px; vertical-align: top; } - item { - background-color: #444; - color: blue; writing-mode: vertical-lr; } </style> -</head> + <body> -<grid style="grid-template-rows: 3ch repeat(3,1ch)"> +<grid style="grid-template-rows: repeat(4, 3ch)"> <item style="height:3ch">1</item> <item>2</item> <item>3</item> @@ -43,7 +40,7 @@ item { <item>9 9</item> </grid> -<grid style="grid-template-rows: repeat(4,1ch)"> +<grid style="grid-template-rows: repeat(4,3ch)"> <item>1</item> <item>2</item> <item>3</item> @@ -79,5 +76,3 @@ item { <item>9 9</item> </grid> -</body> -</html> diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-005.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-005.html index cf9b680869..83afd5bafa 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-005.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-005.html @@ -3,17 +3,16 @@ Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ --> -<html><head> +<html> <meta charset="utf-8"> - <title>CSS Grid Test: Masonry layout intrinsic sizing</title> + <title>CSS Grid Test: Masonry layout row sizing (vertical writing mode)</title> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> - <link rel="help" href="https://drafts.csswg.org/css-grid-2"> + <link rel="help" href="https://drafts.csswg.org/css-grid-3/#track-sizing"> <link rel="match" href="masonry-intrinsic-sizing-005-ref.html"> <link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style> -html,body { - color:black; background-color:white; font:15px/1 Ahem; padding:0; margin:0; -} + +@import "support/masonry-intrinsic-sizing-visual.css"; grid { display: inline-grid; @@ -26,15 +25,13 @@ grid { } item { - background-color: #444; - color: blue; writing-mode: vertical-lr; } </style> -</head> + <body> -<grid> +<grid title="First item 3ch"> <item style="height:3ch">1</item> <item>2</item> <item>3</item> @@ -46,7 +43,7 @@ item { <item>9 9</item> </grid> -<grid> +<grid title="Fifth item 3ch"> <item>1</item> <item>2</item> <item>3</item> @@ -58,7 +55,7 @@ item { <item>9 9</item> </grid> -<grid> +<grid title="Fifth item 3ch row 1"> <item>1</item> <item>2</item> <item>3</item> @@ -70,7 +67,7 @@ item { <item>9 9</item> </grid> -<grid> +<grid title="Fifth item 3ch col 1 (ignored)"> <item>1</item> <item>2</item> <item>3</item> @@ -82,5 +79,3 @@ item { <item>9 9</item> </grid> -</body> -</html> diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-006-ref.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-006-ref.html index e1cb015cfe..1a88c2b4cb 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-006-ref.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-006-ref.html @@ -3,58 +3,49 @@ Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ --> -<html><head> +<html> <meta charset="utf-8"> - <title>Reference: Masonry layout intrinsic sizing</title> + <title>Reference: Masonry layout row auto-fill sizing</title> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> <link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style> -html,body { - color:black; background-color:white; font:15px/1 Ahem; padding:0; margin:0; -} + +@import "support/masonry-intrinsic-sizing-visual.css"; grid { display: inline-grid; gap: 1px 2px; grid-auto-flow: column; - grid-template-columns: 1ch; grid-template-rows: repeat(4,1em); border: 1px solid; padding: 0 1px 0 2px; vertical-align: top; } - -item { - background-color: #444; - color: blue; -} </style> -</head> + <body> <grid> - <item style="width:3ch">1 1</item> + <item style="width:3ch; grid-column: span 2">1 1</item> <item>2</item> <item>3</item> <item>4</item> - <item style="grid-row:2">5 5</item> + <item style="grid-column: span 2">5 5</item> </grid> <grid> - <item style="width:3ch">1 1</item> + <item style="width:3ch; grid-column: span 2">1 1</item> <item>2</item> <item>3</item> <item>4</item> - <item style="grid-row:2">5 5</item> + <item style="grid-column: span 2">5 5</item> </grid> <grid style="height:5em"> - <item style="width:3ch">1 1</item> + <item style="width:3ch; grid-column: span 2">1 1</item> <item>2</item> <item>3</item> <item>4</item> - <item style="grid-row:2">5 5</item> + <item style="grid-column: span 2">5 5</item> </grid> -</body> -</html> diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-006.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-006.html index 49fd53bb79..ad54800921 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-006.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/masonry-intrinsic-sizing-006.html @@ -3,17 +3,16 @@ Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ --> -<html><head> +<html> <meta charset="utf-8"> - <title>CSS Grid Test: Masonry layout intrinsic sizing</title> + <title>CSS Grid Test: Masonry layout row auto-fill sizing</title> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> - <link rel="help" href="https://drafts.csswg.org/css-grid-2"> + <link rel="help" href="https://drafts.csswg.org/css-grid-3/#track-sizing"> <link rel="match" href="masonry-intrinsic-sizing-006-ref.html"> <link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style> -html,body { - color:black; background-color:white; font:15px/1 Ahem; padding:0; margin:0; -} + +@import "support/masonry-intrinsic-sizing-visual.css"; grid { display: inline-grid; @@ -24,16 +23,12 @@ grid { padding: 0 1px 0 2px; vertical-align: top; } - -item { - background-color: #444; - color: blue; -} </style> -</head> + <body> -<grid style="max-height:5em; grid-template-rows: repeat(auto-fill,1em);"> +<grid title="max-height 5em" + style="max-height:5em; grid-template-rows: repeat(auto-fill,1em);"> <item>1 1</item> <item>2</item> <item>3</item> @@ -41,7 +36,8 @@ item { <item>5 5</item> </grid> -<grid style="min-height:4em; grid-template-rows: repeat(auto-fill,1em);"> +<grid title="min-height 4em" + style="min-height:4em; grid-template-rows: repeat(auto-fill,1em);"> <item>1 1</item> <item>2</item> <item>3</item> @@ -49,7 +45,8 @@ item { <item>5 5</item> </grid> -<grid style="height:5em; grid-template-rows: repeat(auto-fill,1em);"> +<grid title="height 5em" + style="height:5em; grid-template-rows: repeat(auto-fill,1em);"> <item>1 1</item> <item>2</item> <item>3</item> @@ -57,5 +54,3 @@ item { <item>5 5</item> </grid> -</body> -</html> diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/support/masonry-intrinsic-sizing-visual.css b/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/support/masonry-intrinsic-sizing-visual.css new file mode 100644 index 0000000000..150f0f2679 --- /dev/null +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/intrinsic-sizing/support/masonry-intrinsic-sizing-visual.css @@ -0,0 +1,48 @@ +/* Basic Testing Setup */ +html,body { + color: black; background: white; font: 15px/1 Ahem, monospace; + padding: 1em 0; margin: 0; + max-width: 800px; height: calc(600px - 2em); + border-bottom: 1px solid orange; /* Do Not Cross */ +} + + +/* Visualization */ +grid { + margin: 0.5em; +} +item { + background-color: gray; + color: blue; +} + +/* Debugging Aid */ +section { + border-top: 1px solid gray; + counter-reset: grid; +} + +grid { + margin-inline-start: 1em; + counter-increment: grid; +} +grid::before { + position: absolute; + margin: 0 -1.1em; + font: smaller sans-serif; + content: counter(grid); + color: navy; +} + +grid:hover { + outline: navy solid; +} +grid:hover item[style] { + color: navy; +} +grid:hover::after { + content: attr(title); + position: absolute; + inset: 0.1em auto auto 0.5rem; + font: bold smaller sans-serif; +} diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/item-placement/masonry-item-placement-001.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/item-placement/masonry-item-placement-001.html index 649e1edb7c..2438df8bac 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/item-placement/masonry-item-placement-001.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/item-placement/masonry-item-placement-001.html @@ -7,7 +7,7 @@ <meta charset="utf-8"> <title>CSS Grid Test: Masonry layout using `grid-column/row`</title> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> - <link rel="help" href="https://drafts.csswg.org/css-grid-2"> + <link rel="help" href="https://drafts.csswg.org/css-grid-3"> <link rel="match" href="masonry-item-placement-001-ref.html"> <style> html,body { diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/item-placement/masonry-item-placement-002.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/item-placement/masonry-item-placement-002.html index 7d321bf731..8833cdfcfc 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/item-placement/masonry-item-placement-002.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/item-placement/masonry-item-placement-002.html @@ -7,7 +7,7 @@ <meta charset="utf-8"> <title>CSS Grid Test: Masonry layout using `grid-column/row`</title> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> - <link rel="help" href="https://drafts.csswg.org/css-grid-2"> + <link rel="help" href="https://drafts.csswg.org/css-grid-3"> <link rel="match" href="masonry-item-placement-002-ref.html"> <style> html,body { diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/item-placement/masonry-item-placement-003.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/item-placement/masonry-item-placement-003.html index 8a183cffc6..bde2fa0e66 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/item-placement/masonry-item-placement-003.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/item-placement/masonry-item-placement-003.html @@ -7,7 +7,7 @@ <meta charset="utf-8"> <title>CSS Grid Test: Masonry layout using `grid-column/row` and `dense`</title> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> - <link rel="help" href="https://drafts.csswg.org/css-grid-2"> + <link rel="help" href="https://drafts.csswg.org/css-grid-3"> <link rel="match" href="masonry-item-placement-003-ref.html"> <style> html,body { diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/item-placement/masonry-item-placement-004.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/item-placement/masonry-item-placement-004.html index 4d1a454a86..52867cd4a2 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/item-placement/masonry-item-placement-004.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/item-placement/masonry-item-placement-004.html @@ -7,7 +7,7 @@ <meta charset="utf-8"> <title>CSS Grid Test: Masonry layout using `grid-column/row`</title> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> - <link rel="help" href="https://drafts.csswg.org/css-grid-2"> + <link rel="help" href="https://drafts.csswg.org/css-grid-3"> <link rel="match" href="masonry-item-placement-004-ref.html"> <style> html,body { diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/item-placement/masonry-item-placement-005.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/item-placement/masonry-item-placement-005.html index ddfbc9e54e..7d4993fb3a 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/item-placement/masonry-item-placement-005.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/item-placement/masonry-item-placement-005.html @@ -7,7 +7,7 @@ <meta charset="utf-8"> <title>CSS Grid Test: Masonry layout using `grid-column/row`</title> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> - <link rel="help" href="https://drafts.csswg.org/css-grid-2"> + <link rel="help" href="https://drafts.csswg.org/css-grid-3"> <link rel="match" href="masonry-item-placement-005-ref.html"> <style> html,body { diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/item-placement/masonry-item-placement-006.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/item-placement/masonry-item-placement-006.html index 0082d72df2..467e313d33 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/item-placement/masonry-item-placement-006.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/item-placement/masonry-item-placement-006.html @@ -7,7 +7,7 @@ <meta charset="utf-8"> <title>CSS Grid Test: Masonry item placement</title> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> - <link rel="help" href="https://drafts.csswg.org/css-grid-2"> + <link rel="help" href="https://drafts.csswg.org/css-grid-3"> <link rel="match" href="masonry-item-placement-006-ref.html"> <style> html,body { diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/item-placement/masonry-item-placement-007.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/item-placement/masonry-item-placement-007.html index 67a02560f4..4c8053ba66 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/item-placement/masonry-item-placement-007.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/item-placement/masonry-item-placement-007.html @@ -7,7 +7,7 @@ <meta charset="utf-8"> <title>CSS Grid Test: Masonry item placement (RTL)</title> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> - <link rel="help" href="https://drafts.csswg.org/css-grid-2"> + <link rel="help" href="https://drafts.csswg.org/css-grid-3"> <link rel="match" href="masonry-item-placement-007-ref.html"> <style> html,body { diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/item-placement/masonry-item-placement-008-ref.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/item-placement/masonry-item-placement-008-ref.html index e14ca3173a..f3503bf071 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/item-placement/masonry-item-placement-008-ref.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/item-placement/masonry-item-placement-008-ref.html @@ -3,7 +3,7 @@ <meta charset="utf-8"> <title>CSS Grid Test: Masonry item placement w/ Images</title> <link rel="author" title="Brandon Stewart" href="mailto:brandonstewart@apple.com"> - <link rel="help" href="https://drafts.csswg.org/css-grid-2"> + <link rel="help" href="https://drafts.csswg.org/css-grid-3"> </head> <body> diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/item-placement/masonry-item-placement-008.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/item-placement/masonry-item-placement-008.html index c68a9787b8..bdf651d77b 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/item-placement/masonry-item-placement-008.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/item-placement/masonry-item-placement-008.html @@ -3,7 +3,7 @@ <meta charset="utf-8"> <title>CSS Grid Test: Masonry item placement w/ Images</title> <link rel="author" title="Brandon Stewart" href="mailto:brandonstewart@apple.com"> - <link rel="help" href="https://drafts.csswg.org/css-grid-2"> + <link rel="help" href="https://drafts.csswg.org/css-grid-3"> <link rel="match" href="masonry-item-placement-008-ref.html"> </head> diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/masonry-columns-item-containing-block-is-grid-content-width.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/masonry-columns-item-containing-block-is-grid-content-width.html index e48b650253..b5eb7f4984 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/masonry-columns-item-containing-block-is-grid-content-width.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/masonry-columns-item-containing-block-is-grid-content-width.html @@ -4,7 +4,7 @@ <link rel="author" title="Sammy Gill" href="mailto:sammy.gill@apple.com"> <link rel="help" href="https://drafts.csswg.org/css-grid-3/#containing-block"> <link rel="match" href="/css/reference/ref-filled-green-100px-square-only.html"> -<meta name="assert" content="Svg should use grid's content logical width for its containing block size and get sized to 100px x 100px"> +<meta name="assert" content="Test passes if SVG uses grid's content logical width for its containing block size and get sized to 100px x 100px"> <style> grid { display: grid; diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/masonry-grid-template-columns-computed-withcontent.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/masonry-grid-template-columns-computed-withcontent.html index b36efb664d..0ee2ee78c0 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/masonry-grid-template-columns-computed-withcontent.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/masonry-grid-template-columns-computed-withcontent.html @@ -1,34 +1,34 @@ <!DOCTYPE html> <html> <head> -<meta charset="utf-8"> -<title>CSS Masonry Test: getComputedStyle().gridTemplateColumns</title> -<link rel="help" href="https://drafts.csswg.org/css-grid-1/#propdef-grid-template-columns"> -<meta name="assert" content="grid-template-columns computed value is the keyword none or a computed track list."> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="/css/support/computed-testcommon.js"></script> -<style> - #target { - display: grid; - grid-template-rows: masonry; - font-size: 40px; - min-width: 200px; - width: 300px; - max-width: 400px; - min-height: 500px; - height: 600px; - max-height: 700px; - } - #child { - min-width: 20px; - width: 30px; - max-width: 40px; - min-height: 50px; - height: 60px; - max-height: 70px; - } -</style> + <meta charset="utf-8"> + <title>CSS Masonry Test: getComputedStyle().gridTemplateColumns</title> + <link rel="help" href="https://drafts.csswg.org/css-grid-1/#grid-template-masonry"> + <meta name="assert" content="grid-template-columns computed value is the keyword none or a computed track list."> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/css/support/computed-testcommon.js"></script> + <style> + #target { + display: grid; + grid-template-rows: masonry; + font-size: 40px; + min-width: 200px; + width: 300px; + max-width: 400px; + min-height: 500px; + height: 600px; + max-height: 700px; + } + #child { + min-width: 20px; + width: 30px; + max-width: 40px; + min-height: 50px; + height: 60px; + max-height: 70px; + } + </style> </head> <body> <div id="container"> @@ -37,59 +37,59 @@ </div> </div> <script> -test_computed_value("grid-template-rows", 'masonry', 'masonry'); -test_computed_value("grid-template-columns", 'none', 'none'); // "none" without #child + test_computed_value("grid-template-rows", 'masonry', 'masonry'); + test_computed_value("grid-template-columns", 'none', 'none'); // "none" without #child -// track-size <fixed-breadth> = <length-percentage> | <flex> | min-content | max-content | auto -test_computed_value("grid-template-columns", '20%', '60px'); // 20% * width -test_computed_value("grid-template-columns", 'calc(-0.5em + 10px)', '0px'); -test_computed_value("grid-template-columns", 'calc(0.5em + 10px)', '30px'); -test_computed_value("grid-template-columns", 'calc(30% + 40px)', '130px'); // 30% * width + 40px -test_computed_value("grid-template-columns", '5fr', '300px'); // width -test_computed_value("grid-template-columns", 'min-content', '30px'); -test_computed_value("grid-template-columns", 'max-content', '30px'); -test_computed_value("grid-template-columns", 'auto', '300px'); // width + // track-size <fixed-breadth> = <length-percentage> | <flex> | min-content | max-content | auto + test_computed_value("grid-template-columns", '20%', '60px'); // 20% * width + test_computed_value("grid-template-columns", 'calc(-0.5em + 10px)', '0px'); + test_computed_value("grid-template-columns", 'calc(0.5em + 10px)', '30px'); + test_computed_value("grid-template-columns", 'calc(30% + 40px)', '130px'); // 30% * width + 40px + test_computed_value("grid-template-columns", '5fr', '300px'); // width + test_computed_value("grid-template-columns", 'min-content', '30px'); + test_computed_value("grid-template-columns", 'max-content', '30px'); + test_computed_value("grid-template-columns", 'auto', '300px'); // width -// track-size minmax( <inflexible-breadth> , <track-breadth> ) -test_computed_value("grid-template-columns", 'minmax(10px, auto)', '300px'); // width -test_computed_value("grid-template-columns", 'minmax(20%, max-content)', '60px'); // 20% * width -test_computed_value("grid-template-columns", 'minmax(min-content, calc(-0.5em + 10px))', '30px'); -test_computed_value("grid-template-columns", 'minmax(auto, 0)', '30px'); + // track-size minmax( <inflexible-breadth> , <track-breadth> ) + test_computed_value("grid-template-columns", 'minmax(10px, auto)', '300px'); // width + test_computed_value("grid-template-columns", 'minmax(20%, max-content)', '60px'); // 20% * width + test_computed_value("grid-template-columns", 'minmax(min-content, calc(-0.5em + 10px))', '30px'); + test_computed_value("grid-template-columns", 'minmax(auto, 0)', '30px'); -// track-size fit-content( <length-percentage> ) -test_computed_value("grid-template-columns", 'fit-content(70px)', '30px'); -test_computed_value("grid-template-columns", 'fit-content(20%)', '30px'); -test_computed_value("grid-template-columns", 'fit-content(calc(-0.5em + 10px))', '30px'); + // track-size fit-content( <length-percentage> ) + test_computed_value("grid-template-columns", 'fit-content(70px)', '30px'); + test_computed_value("grid-template-columns", 'fit-content(20%)', '30px'); + test_computed_value("grid-template-columns", 'fit-content(calc(-0.5em + 10px))', '30px'); -// <track-repeat> = repeat( [ <positive-integer> ] , [ <line-names>? <track-size> ]+ <line-names>? ) -test_computed_value("grid-template-columns", 'repeat(1, 10px)', '10px'); -test_computed_value("grid-template-columns", 'repeat(1, [one two] 20%)', '[one two] 60px'); -test_computed_value("grid-template-columns", 'repeat(2, minmax(10px, auto))', '160px 140px'); + // <track-repeat> = repeat( [ <positive-integer> ] , [ <line-names>? <track-size> ]+ <line-names>? ) + test_computed_value("grid-template-columns", 'repeat(1, 10px)', '10px'); + test_computed_value("grid-template-columns", 'repeat(1, [one two] 20%)', '[one two] 60px'); + test_computed_value("grid-template-columns", 'repeat(2, minmax(10px, auto))', '150px 150px'); -test_computed_value("grid-template-columns", 'repeat(2, fit-content(20%) [three four] 30px 40px [five six])', - '30px [three four] 30px 40px [five six] 0px [three four] 30px 40px [five six]'); + test_computed_value("grid-template-columns", 'repeat(2, fit-content(20%) [three four] 30px 40px [five six])', + '30px [three four] 30px 40px [five six] 30px [three four] 30px 40px [five six]'); -// <track-list> = [ <line-names>? [ <track-size> | <track-repeat> ] ]+ <line-names>? -test_computed_value("grid-template-columns", 'min-content repeat(5, minmax(10px, auto))', - '30px 54px 54px 54px 54px 54px'); -test_computed_value("grid-template-columns", '[] 150px [] 1fr []', '150px 150px'); + // <track-list> = [ <line-names>? [ <track-size> | <track-repeat> ] ]+ <line-names>? + test_computed_value("grid-template-columns", 'min-content repeat(5, minmax(10px, auto))', + '30px 54px 54px 54px 54px 54px'); + test_computed_value("grid-template-columns", '[] 150px [] 1fr []', '150px 150px'); -// <auto-repeat> = repeat( [ auto-fill | auto-fit ] , [ <line-names>? <fixed-size> ]+ <line-names>? ) -test_computed_value("grid-template-columns", 'repeat(auto-fill, 200px)', '200px'); -test_computed_value("grid-template-columns", 'repeat(auto-fit, [one] 20%)', - '[one] 60px [one] 60px [one] 60px [one] 60px [one] 60px'); -test_computed_value("grid-template-columns", 'repeat(auto-fill, minmax(100px, 5fr) [two])', - '100px [two] 100px [two] 100px [two]'); -test_computed_value("grid-template-columns", 'repeat(auto-fit, [three] minmax(max-content, 6em) [four])', - '[three] 240px [four]'); + // <auto-repeat> = repeat( [ auto-fill | auto-fit ] , [ <line-names>? <fixed-size> ]+ <line-names>? ) + test_computed_value("grid-template-columns", 'repeat(auto-fill, 200px)', '200px'); + test_computed_value("grid-template-columns", 'repeat(auto-fit, [one] 20%)', + '[one] 60px [one] 60px [one] 60px [one] 60px [one] 60px'); + test_computed_value("grid-template-columns", 'repeat(auto-fill, minmax(100px, 5fr) [two])', + '100px [two] 100px [two] 100px [two]'); + test_computed_value("grid-template-columns", 'repeat(auto-fit, [three] minmax(max-content, 6em) [four])', + '[three] 240px [four]'); -// <auto-track-list> = -// [ <line-names>? [ <fixed-size> | <fixed-repeat> ] ]* <line-names>? -// <auto-repeat> -// [ <line-names>? [ <fixed-size> | <fixed-repeat> ] ]* <line-names>? + // <auto-track-list> = + // [ <line-names>? [ <fixed-size> | <fixed-repeat> ] ]* <line-names>? + // <auto-repeat> + // [ <line-names>? [ <fixed-size> | <fixed-repeat> ] ]* <line-names>? -test_computed_value("grid-template-columns", '[one] repeat(2, minmax(50px, auto)) [two] 30px [three] repeat(auto-fill, 10px) 40px [four five] repeat(2, minmax(200px, auto)) [six]', - '[one] 50px 50px [two] 30px [three] 10px 40px [four five] 200px 200px [six]'); + test_computed_value("grid-template-columns", '[one] repeat(2, minmax(50px, auto)) [two] 30px [three] repeat(auto-fill, 10px) 40px [four five] repeat(2, minmax(200px, auto)) [six]', + '[one] 50px 50px [two] 30px [three] 10px 40px [four five] 200px 200px [six]'); </script> </body> </html> diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/masonry-not-inhibited-001.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/masonry-not-inhibited-001.html index 54499d3d69..1c912feb1f 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/masonry-not-inhibited-001.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/masonry-not-inhibited-001.html @@ -2,7 +2,7 @@ <meta charset="utf-8"> <title>CSS Grid Test: Masonry layout shouldn't be inhibited simply due to being an independent formatting context (unlike subgrid)</title> <link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com"> -<link rel="help" href="https://drafts.csswg.org/css-grid-3/"> +<link rel="help" href="https://drafts.csswg.org/css-grid-3/#grid-template-masonry"> <link rel="match" href="masonry-not-inhibited-001-ref.html"> <style> grid { diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/order/masonry-order-001.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/order/masonry-order-001.html index d01f52ea04..37b3d01fb4 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/order/masonry-order-001.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/order/masonry-order-001.html @@ -7,7 +7,8 @@ <meta charset="utf-8"> <title>CSS Grid Test: Masonry layout using `order`</title> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> - <link rel="help" href="https://drafts.csswg.org/css-grid-2"> + <link rel="help" href="https://drafts.csswg.org/css-grid-3"> + <link rel="help" href="https://drafts.csswg.org/css-grid-3/#masonry-layout-algorithm"> <link rel="match" href="masonry-order-001-ref.html"> <style> html,body { diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/order/masonry-order-002.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/order/masonry-order-002.html index abad3d44b8..5ebdec2719 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/order/masonry-order-002.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/order/masonry-order-002.html @@ -7,7 +7,8 @@ <meta charset="utf-8"> <title>CSS Grid Test: Masonry layout using `order` and `masonry-auto-flow: next`</title> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> - <link rel="help" href="https://drafts.csswg.org/css-grid-2"> + <link rel="help" href="https://drafts.csswg.org/css-grid-3/#masonry-layout-algorithm"> + <link rel="help" href="https://drafts.csswg.org/css-grid-3/#masonry-auto-flow"> <link rel="match" href="masonry-order-002-ref.html"> <style> html,body { diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/parsing/masonry-parsing.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/parsing/masonry-parsing.html index e3245095fa..2204c06f72 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/parsing/masonry-parsing.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/parsing/masonry-parsing.html @@ -3,7 +3,8 @@ <head> <meta charset="utf-8"> <title>CSS Masonry Test: parsing properties and shortands</title> -<link rel="help" href="https://drafts.csswg.org/css-grid-2/#propdef-grid-template-columns"> +<link rel="help" href="https://drafts.csswg.org/css-grid-3/#grid-template-masonry"> +<link rel="help" href="https://drafts.csswg.org/css-grid-3/#masonry-auto-flow"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/css/support/parsing-testcommon.js"></script> diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/subgrid/masonry-subgrid-001.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/subgrid/masonry-subgrid-001.html index de07dfb78d..c71ba68612 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/subgrid/masonry-subgrid-001.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/subgrid/masonry-subgrid-001.html @@ -7,7 +7,7 @@ <meta charset="utf-8"> <title>CSS Grid Test: Masonry layout with a subgrid</title> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> - <link rel="help" href="https://drafts.csswg.org/css-grid-2"> + <link rel="help" href="https://drafts.csswg.org/css-grid-3/#subgrids"> <link rel="match" href="masonry-subgrid-001-ref.html"> <style> html,body { diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/subgrid/masonry-subgrid-002.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/subgrid/masonry-subgrid-002.html index 466e95eb03..167f2d4496 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/subgrid/masonry-subgrid-002.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/subgrid/masonry-subgrid-002.html @@ -7,7 +7,7 @@ <meta charset="utf-8"> <title>CSS Grid Test: Masonry layout with a subgrid</title> <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> - <link rel="help" href="https://drats.csswg.org/css-grid-2"> + <link rel="help" href="https://drafts.csswg.org/css-grid-3/#subgrids"> <link rel="match" href="masonry-subgrid-002-ref.html"> <style> html,body { diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/track-sizing/masonry-track-sizing-check-grid-height-on-resize-ref.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/track-sizing/masonry-track-sizing-check-grid-height-on-resize-ref.html index 7196886492..53447e0dad 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/track-sizing/masonry-track-sizing-check-grid-height-on-resize-ref.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/track-sizing/masonry-track-sizing-check-grid-height-on-resize-ref.html @@ -1,16 +1,14 @@ <!DOCTYPE html> <html> - +<title>CSS Reference: Masonry grid container size changes when item sizes change</title> <head> <meta charset="utf-8"> <link rel="author" title="Brandon Stewart" href="mailto:brandonstewart@apple.com"> -<link rel="help" href="https://drafts.csswg.org/css-grid-3"> -<meta name="assert" content="When the height of an element in the grid changes, ensure the grid is properly resized"> </head> <style> grid { - display: grid; + display: inline-grid; grid-template-rows: masonry; grid-template-columns: auto; grid-gap: 10px; @@ -20,7 +18,7 @@ item1 { background-color: grey; height: 125px; - width: 250px; + width: 300px; } item2 { background-color: grey; @@ -35,4 +33,4 @@ <item2>2</item2> </grid> </body> -</html>
\ No newline at end of file +</html> diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/track-sizing/masonry-track-sizing-check-grid-height-on-resize.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/track-sizing/masonry-track-sizing-check-grid-height-on-resize.html index 06c2901f27..dbff19f28e 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/track-sizing/masonry-track-sizing-check-grid-height-on-resize.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/track-sizing/masonry-track-sizing-check-grid-height-on-resize.html @@ -1,17 +1,18 @@ <!DOCTYPE html> -<html> +<html class="reftest-wait"> <head> <meta charset="utf-8"> +<title>CSS Test: Masonry grid container size changes when item sizes change</title> <link rel="author" title="Brandon Stewart" href="mailto:brandonstewart@apple.com"> <link rel="help" href="https://drafts.csswg.org/css-grid-3"> <link rel="match" href="masonry-track-sizing-check-grid-height-on-resize-ref.html"> -<meta name="assert" content="When the height of an element in the grid changes, ensure the grid is properly resized"> +<meta name="assert" content="Test passes if when the size of an item in the masonry grid changes, the grid container is properly resized"> </head> <style> grid { - display: grid; + display: inline-grid; grid-template-rows: masonry; grid-template-columns: auto; grid-gap: 10px; @@ -32,8 +33,11 @@ </grid> </body> <script> - /* Force a relayout */ - document.body.offsetHeight; - document.querySelector("item").style["height"] = "125px"; + document.body.offsetHeight; // Force a relayout + var gridItem = document.querySelector('item'); + gridItem.style.height = '125px'; + gridItem.style.width = '300px'; + document + document.documentElement.className = ''; </script> -</html>
\ No newline at end of file +</html> diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/track-sizing/masonry-track-sizing-overflow-left-side-ref.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/track-sizing/masonry-track-sizing-overflow-left-side-ref.html index 5a31517183..3e973b7fe7 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/track-sizing/masonry-track-sizing-overflow-left-side-ref.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/track-sizing/masonry-track-sizing-overflow-left-side-ref.html @@ -12,7 +12,7 @@ <style> grid { display: grid; - grid-template-columns: 50px 1fr; + grid-template-columns: 100px 1fr; grid-template-rows: 50px 250px; width: 300px; height: 100px; diff --git a/testing/web-platform/tests/css/css-grid/masonry/tentative/track-sizing/masonry-track-sizing-overflow-right-side-ref.html b/testing/web-platform/tests/css/css-grid/masonry/tentative/track-sizing/masonry-track-sizing-overflow-right-side-ref.html index 51e657e2a4..eb84b2e6bd 100644 --- a/testing/web-platform/tests/css/css-grid/masonry/tentative/track-sizing/masonry-track-sizing-overflow-right-side-ref.html +++ b/testing/web-platform/tests/css/css-grid/masonry/tentative/track-sizing/masonry-track-sizing-overflow-right-side-ref.html @@ -12,7 +12,7 @@ <style> grid { display: grid; - grid-template-columns: 1fr 50px; + grid-template-columns: 1fr 100px; grid-template-rows: 1fr 50px; width: 300px; height: 100px; |