WebKit export of https://bugs.webkit.org/show_bug.cgi?id=325684 (#63140) * Convert some fast/css-grid-layout tests to WPT checkLayout tests These legacy check-layout tests in fast/css-grid-layout cover cases that are missing from WPT and need only mechanical changes to become WPT testharness tests. Convert them and remove the legacy versions. Three more legacy tests overlap existing WPT tests but check cases they do not (see below), so they are rewritten as new WPT testharness tests: grid-item-margin-auto-columns-rows-vertical-ltr (a reftest), relayout-align-items-changed and relayout-justify-items-changed. In the mechanical conversions, the data-* expectations and test styles are unchanged. A few markup cleanups do not affect what the tests check: undefined or misspelled classes (fixedWidth, fixedHeight, border, justfyContentStart) and a duplicate <body> tag are dropped, mistyped </div--> end tags and unclosed wrapper divs are fixed, and descriptions are reworded. The relayout-{align,justify}-{items,self}-changed tests are each split into two grid-alignment-implies-size-change tests (037 to 044), one for each change the legacy test made. Each checks size and position both before and after the change. grid-auto-columns-rows-auto-flow-resolution had a doctype that put it in quirks mode; the WPT version runs in standards mode with the same results. quirks-mode-percent-resolution-grid-item stays in quirks mode on purpose. Removed test (fast/css-grid-layout/) -> new WPT test (css/css-grid/): auto-content-resolution-columns -> layout-algorithm/grid-auto-columns-content-resolution-001 auto-content-resolution-rows -> layout-algorithm/grid-auto-rows-content-resolution-001 grid-auto-columns-rows-auto-flow-resolution -> implicit-grids/grid-auto-columns-rows-auto-flow-resolution-001 grid-auto-columns-rows-resolution -> implicit-grids/grid-auto-columns-rows-resolution-001 grid-auto-flow-resolution -> placement/grid-auto-flow-resolution-001 grid-auto-flow-update -> placement/grid-auto-flow-dynamic-change-001 grid-content-alignment-stretch-with-different-sized-tracks -> alignment/grid-content-distribution-stretch-different-sized-tracks-001 grid-element-empty-row-column -> grid-model/grid-container-rows-or-columns-only-001 grid-element-min-max-width -> grid-model/grid-min-max-width-001 grid-element-padding-margin -> grid-model/grid-container-padding-border-size-001 grid-item-addition-auto-placement-update -> placement/grid-auto-placement-item-addition-001 grid-item-addition-track-breadth-update -> layout-algorithm/grid-track-sizing-item-addition-001 grid-item-auto-margins-and-stretch -> alignment/grid-item-auto-margins-and-stretch-001 grid-item-auto-margins-must-respect-specified-margins -> alignment/grid-item-auto-margins-and-specified-margins-001 grid-item-auto-placement-automatic-span -> placement/grid-auto-placement-automatic-span-001 grid-item-auto-placement-definite-span -> placement/grid-auto-placement-definite-span-001 grid-item-auto-placement-fixed-row-column -> placement/grid-auto-placement-fixed-row-column-001 grid-item-bad-named-area-auto-placement -> placement/grid-placement-unknown-named-area-001 grid-item-bad-resolution-double-span -> placement/grid-placement-invalid-double-span-001 grid-item-change-order-auto-flow -> placement/grid-auto-placement-order-change-001 grid-item-margin-auto-columns-rows-vertical-ltr -> layout-algorithm/grid-item-margin-auto-columns-rows-vertical-lr-002, layout-algorithm/grid-item-margin-auto-columns-rows-vertical-rl-002 The existing -001 tests only put margin-bottom on first-row items and only check the size of a fit-content grid. These add margin-bottom on second-row items in a grid with a definite block size, and check where each item is placed. grid-item-multiple-minmax-content-resolution -> layout-algorithm/grid-minmax-content-tracks-multiple-items-001 grid-item-named-grid-area-resolution -> placement/grid-placement-named-grid-area-resolution-001 grid-item-negative-indexes -> placement/grid-placement-huge-negative-indexes-001 grid-item-negative-integer-explicit-grid-resolution -> placement/grid-placement-negative-integer-explicit-grid-001 grid-item-negative-position-resolution -> placement/grid-placement-negative-position-resolution-001 grid-item-position-changed-dynamic -> placement/grid-placement-dynamic-change-001 grid-item-positioning-with-orthogonal-flows -> layout-algorithm/grid-item-positioning-orthogonal-flows-001 grid-item-removal-auto-placement-update -> placement/grid-auto-placement-item-removal-001 grid-item-removal-track-breadth-update -> layout-algorithm/grid-track-sizing-item-removal-001 grid-item-sizing-with-orthogonal-flows -> layout-algorithm/grid-item-sizing-orthogonal-flows-001 grid-item-spanning-and-orthogonal-flows -> layout-algorithm/grid-spanning-items-orthogonal-flows-001 grid-item-spanning-resolution -> layout-algorithm/grid-spanning-items-percentage-grid-001 grid-item-stretch-with-margins-borders-padding -> alignment/grid-item-stretch-margin-border-padding-001 grid-item-stretch-with-margins-borders-padding-vertical-lr -> alignment/grid-item-stretch-margin-border-padding-vertical-lr-001 grid-item-stretch-with-margins-borders-padding-vertical-rl -> alignment/grid-item-stretch-margin-border-padding-vertical-rl-001 grid-item-unknown-named-grid-line-resolution -> placement/grid-placement-unknown-named-grid-line-001 grid-item-with-border-in-fr -> layout-algorithm/grid-flex-tracks-item-with-border-001 grid-item-with-border-in-intrinsic -> layout-algorithm/grid-intrinsic-tracks-item-with-border-001 grid-item-with-percent-height-in-auto-height-grid-resolution -> grid-items/grid-item-percentage-height-auto-height-grid-001 grid-items-should-not-be-stretched-when-height-or-width-or-margin-change -> alignment/grid-item-stretch-dynamic-size-margin-change-001 grid-justify-content -> alignment/grid-justify-content-001 grid-justify-content-distribution -> alignment/grid-justify-content-distribution-001 grid-justify-content-distribution-vertical-lr -> alignment/grid-justify-content-distribution-vertical-lr-001 grid-justify-content-distribution-vertical-rl -> alignment/grid-justify-content-distribution-vertical-rl-001 grid-justify-content-vertical-lr -> alignment/grid-justify-content-vertical-lr-001 grid-justify-content-vertical-rl -> alignment/grid-justify-content-vertical-rl-001 grid-percent-track-margin-border-padding -> layout-algorithm/grid-percentage-tracks-container-margin-border-padding-001 grid-preferred-logical-widths -> layout-algorithm/grid-intrinsic-width-minmax-tracks-001 implicit-columns-auto-resolution -> implicit-grids/grid-implicit-columns-auto-resolution-001 implicit-rows-auto-resolution -> implicit-grids/grid-implicit-rows-auto-resolution-001 implicit-tracks-before-explicit -> implicit-grids/grid-implicit-tracks-before-explicit-001 justify-self-cell -> alignment/grid-justify-self-cell-001 min-height-border-box -> grid-items/grid-item-min-height-border-box-001 min-width-height-auto -> grid-items/grid-item-min-width-height-auto-001 min-width-margin-box -> grid-items/grid-item-min-width-margin-box-001 minmax-spanning-resolution-columns -> layout-algorithm/grid-minmax-spanning-items-columns-001 minmax-spanning-resolution-rows -> layout-algorithm/grid-minmax-spanning-items-rows-001 named-grid-lines-with-named-grid-areas-resolution -> placement/grid-placement-named-lines-and-areas-001 percent-intrinsic-track-breadth -> layout-algorithm/grid-percentage-tracks-intrinsic-container-001 percent-of-indefinite-track-size -> layout-algorithm/grid-percentage-of-indefinite-track-size-001 percent-of-indefinite-track-size-in-auto -> layout-algorithm/grid-percentage-of-indefinite-auto-track-size-001 percent-padding-margin-resolution-grid-item -> grid-items/grid-items-percentage-paddings-margins-writing-modes-001 percent-padding-margin-resolution-grid-item-update -> grid-items/grid-items-percentage-paddings-margins-track-change-001 percent-resolution-grid-item -> grid-items/grid-item-percentage-resolution-writing-modes-001 percent-resolution-grid-item-children -> grid-items/grid-item-children-percentage-resolution-001 percent-track-breadths-regarding-container-size -> layout-algorithm/grid-percentage-tracks-container-size-001 quirks-mode-percent-resolution-grid-item -> grid-items/grid-item-percentage-resolution-writing-modes-quirks-001 relayout-align-items-changed -> alignment/grid-alignment-implies-size-change-037, alignment/grid-alignment-implies-size-change-038 relayout-align-self-changed -> alignment/grid-alignment-implies-size-change-041, alignment/grid-alignment-implies-size-change-042 relayout-indefinite-heights -> layout-algorithm/grid-flex-rows-container-height-change-001 relayout-justify-items-changed -> alignment/grid-alignment-implies-size-change-039, alignment/grid-alignment-implies-size-change-040 The existing -001 to -036 tests only change between start, normal and stretch, and only check sizes. These, and 041 to 044 for align-self and justify-self, cover end -> stretch and stretch -> center. relayout-justify-self-changed -> alignment/grid-alignment-implies-size-change-043, alignment/grid-alignment-implies-size-change-044 repeating-layout-must-produce-the-same-results -> layout-algorithm/grid-relayout-orthogonal-items-same-result-001 WebKit-Bug: https://bugs.webkit.org/show_bug.cgi?id=325684 WebKit-Canonical-Link: https://commits.webkit.org/322300@main
The web-platform-tests Project is a cross-browser test suite for the Web-platform stack. Writing tests in a way that allows them to be run in all browsers gives browser projects confidence that they are shipping software that is compatible with other implementations, and that later implementations will be compatible with their implementations. This in turn gives Web authors/developers confidence that they can actually rely on the Web platform to deliver on the promise of working across browsers and devices without needing extra layers of abstraction to paper over the gaps left by specification editors and implementors.
The most important sources of information and activity are:
wpt:matrix.org matrix channel; includes participants located around the world, but busiest during the European working day.If you'd like clarification about anything, don't hesitate to ask in the chat room or on the mailing list.
Clone or otherwise get https://github.com/web-platform-tests/wpt.
Note: because of the frequent creation and deletion of branches in this repo, it is recommended to “prune” stale branches when fetching updates, i.e. use git pull --prune (or git fetch -p && git merge).
See the documentation website and in particular the system setup for running tests locally.
The wpt command provides a frontend to a variety of tools for working with and running web-platform-tests. Some of the most useful commands are:
wpt serve - For starting the wpt http serverwpt run - For running tests in a browserwpt lint - For running the lint against all testswpt manifest - For updating or generating a MANIFEST.json test manifestwpt install - For installing the latest release of a browser or webdriver server on the local machine.wpt serve-wave - For starting the wpt http server and the WAVE test runner. For more details on how to use the WAVE test runner see the documentation.On Windows wpt commands must be prefixed with python or the path to the python binary (if python is not in your %PATH%).
python wpt [command]
Alternatively, you may also use Bash on Ubuntu on Windows in the Windows 10 Anniversary Update build, then access your windows partition from there to launch wpt commands.
Please make sure git and your text editor do not automatically convert line endings, as it will cause lint errors. For git, please set git config core.autocrlf false in your working tree.
The master branch is automatically synced to wpt.live and w3c-test.org.
Save the Web, Write Some Tests!
Absolutely everyone is welcome to contribute to test development. No test is too small or too simple, especially if it corresponds to something for which you've noted an interoperability bug in a browser.
The way to contribute is just as usual:
git checkout -b topic../wpt lint as described above.Use of LLMs to help author tests is generally acceptable, but every change must be attributable to a human who understands and can take responsibility for the proposed change.
Use of LLMs to participate in discussions is generally not acceptable; any LLM-generated content must either be from a bot account or contained inside a <blockquote> (for short contributions of at most one paragraph) or <details> element.
For full details see the Policy for LLM Use
If you spot an issue with a test and are not comfortable providing a pull request per above to fix it, please file a new issue. Thank you!