Layout: Implement CSS Grid using taffy (#32619)

* Add layout.grid.enabled pref

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Add taffy dependency

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Import taffy <-> stylo conversion code from taffy_stylo crate

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Add `Grid` variant to DisplayInside

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Implement CSS Grid using Taffy

Signed-off-by: Nico Burns <nico@nicoburns.com>

Import full stylo_taffy crate

Signed-off-by: Nico Burns <nico@nicoburns.com>

Squashed PR feedback changes

Deduplicate is_document_only_whitespace

Signed-off-by: Nico Burns <nico@nicoburns.com>

Import taffy::AvailableSpace

Signed-off-by: Nico Burns <nico@nicoburns.com>

Rename FlexContext to TaffyContainerContext

Signed-off-by: Nico Burns <nico@nicoburns.com>

Eliminate references to flexbox in taffy/layout module

Signed-off-by: Nico Burns <nico@nicoburns.com>

Use constructors for geom types

Signed-off-by: Nico Burns <nico@nicoburns.com>

Remove comment about abspos elements splitting contiguous text runs

Signed-off-by: Nico Burns <nico@nicoburns.com>

Remove reference to flexbox in taffy/construct

Signed-off-by: Nico Burns <nico@nicoburns.com>

Deduplicate construction of flexbox/grid containers

Signed-off-by: Nico Burns <nico@nicoburns.com>

Make anonymous text runs InFlow

Signed-off-by: Nico Burns <nico@nicoburns.com>

Remove commented code

Signed-off-by: Nico Burns <nico@nicoburns.com>

Update comments

Signed-off-by: Nico Burns <nico@nicoburns.com>

Inline/vendor the stylo/taffy interop code

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Update test expectations

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Fix nits from PR review

Signed-off-by: Nico Burns <nico@nicoburns.com>

---------

Signed-off-by: Nico Burns <nico@nicoburns.com>
This commit is contained in:
Nico Burns 2024-11-22 09:21:01 +13:00 committed by GitHub
parent 339062c890
commit 6cbd89dbb0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
508 changed files with 2057 additions and 10408 deletions

View file

@ -1,6 +1,3 @@
[align-self-baseline-with-subgrid-mbp.html]
[.first-baseline 1]
expected: FAIL
[.first-baseline 2]
expected: FAIL

View file

@ -0,0 +1,2 @@
[auto-track-sizing-001.html]
expected: [PASS, TIMEOUT]

View file

@ -0,0 +1,2 @@
[contain-strict-nested-subgrid.html]
expected: [PASS, TIMEOUT]

View file

@ -0,0 +1,2 @@
[grid-gap-004.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[grid-gap-005.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[grid-gap-006.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[grid-gap-larger-001.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[grid-gap-larger-002.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[grid-gap-normal-001.html]
expected: FAIL

View file

@ -1,2 +1,2 @@
[line-names-001.html]
expected: FAIL
expected: CRASH

View file

@ -0,0 +1,2 @@
[line-names-002.html]
expected: CRASH

View file

@ -0,0 +1,2 @@
[line-names-003.html]
expected: CRASH

View file

@ -1,2 +1,2 @@
[line-names-004.html]
expected: FAIL
expected: CRASH

View file

@ -1,2 +1,2 @@
[line-names-005.html]
expected: FAIL
expected: CRASH

View file

@ -0,0 +1,2 @@
[line-names-006.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[line-names-007.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[line-names-009.html]
expected: CRASH

View file

@ -0,0 +1,2 @@
[line-names-010.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[line-names-011.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[line-names-012.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[line-names-013.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[orthogonal-writing-mode-001.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[orthogonal-writing-mode-002.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[orthogonal-writing-mode-003.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[orthogonal-writing-mode-004.html]
expected: FAIL

View file

@ -1,2 +1,2 @@
[parent-repeat-auto-fit-001.html]
expected: FAIL
expected: CRASH

View file

@ -0,0 +1,2 @@
[parent-repeat-auto-fit-002.html]
expected: CRASH

View file

@ -1,2 +0,0 @@
[percentage-track-sizing.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[placement-implicit-001.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[repeat-auto-fill-002.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[repeat-auto-fill-003.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[repeat-auto-fill-004.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[scrollbar-gutter-001.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[scrollbar-gutter-002.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[standalone-axis-size-003.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[standalone-axis-size-004.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[standalone-axis-size-008.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[standalone-axis-size-009.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[subgrid-baseline-003.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[subgrid-baseline-004.html]
expected: FAIL

View file

@ -1,7 +1,4 @@
[subgrid-baseline-005.html]
[.item 1]
expected: FAIL
[.item 2]
expected: FAIL
@ -14,9 +11,6 @@
[.item 5]
expected: FAIL
[.item 6]
expected: FAIL
[.item 7]
expected: FAIL

View file

@ -1,7 +1,4 @@
[subgrid-baseline-007.html]
[.item 1]
expected: FAIL
[.item 2]
expected: FAIL
@ -20,9 +17,6 @@
[.item 7]
expected: FAIL
[.item 8]
expected: FAIL
[.item 9]
expected: FAIL

View file

@ -1,6 +1,3 @@
[subgrid-baseline-011.html]
[.item 1]
expected: FAIL
[.item 2]
expected: FAIL

View file

@ -1,2 +0,0 @@
[subgrid-button.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[subgrid-no-items-on-edges-001.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[writing-directions-002.html]
expected: FAIL