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

@ -13,9 +13,3 @@
[.grid 6]
expected: FAIL
[.grid 7]
expected: FAIL
[.grid 8]
expected: FAIL

View file

@ -1,2 +0,0 @@
[flex-and-intrinsic-sizes-002.html]
expected: FAIL

View file

@ -1,36 +1,3 @@
[flex-sizing-columns-min-max-width-001.html]
[.grid 1]
expected: FAIL
[.grid 2]
expected: FAIL
[.grid 3]
expected: FAIL
[.grid 4]
expected: FAIL
[.grid 5]
expected: FAIL
[.grid 6]
expected: FAIL
[.grid 7]
expected: FAIL
[.grid 8]
expected: FAIL
[.grid 9]
expected: FAIL
[.grid 10]
expected: FAIL
[.grid 11]
expected: FAIL
[.grid 12]
expected: FAIL

View file

@ -5,32 +5,8 @@
[.grid 2]
expected: FAIL
[.grid 3]
expected: FAIL
[.grid 4]
expected: FAIL
[.grid 5]
expected: FAIL
[.grid 6]
expected: FAIL
[.grid 7]
expected: FAIL
[.grid 8]
expected: FAIL
[.grid 9]
expected: FAIL
[.grid 10]
expected: FAIL
[.grid 11]
expected: FAIL
[.grid 12]
expected: FAIL

View file

@ -1,2 +0,0 @@
[flex-tracks-with-fractional-size.html]
expected: FAIL

View file

@ -8,12 +8,6 @@
[.grid 5]
expected: FAIL
[.grid 6]
expected: FAIL
[.grid 7]
expected: FAIL
[.grid 8]
expected: FAIL
@ -23,12 +17,6 @@
[.grid 10]
expected: FAIL
[.grid 11]
expected: FAIL
[.grid 12]
expected: FAIL
[.grid 13]
expected: FAIL
@ -38,12 +26,6 @@
[.grid 15]
expected: FAIL
[.grid 16]
expected: FAIL
[.grid 17]
expected: FAIL
[.grid 18]
expected: FAIL

View file

@ -2,9 +2,6 @@
[.grid 1]
expected: FAIL
[.grid 2]
expected: FAIL
[.grid 4]
expected: FAIL
@ -17,9 +14,6 @@
[.grid 7]
expected: FAIL
[.grid 8]
expected: FAIL
[.grid 9]
expected: FAIL
@ -35,9 +29,6 @@
[.grid 13]
expected: FAIL
[.grid 14]
expected: FAIL
[.grid 15]
expected: FAIL
@ -53,9 +44,6 @@
[.grid 19]
expected: FAIL
[.grid 20]
expected: FAIL
[.grid 21]
expected: FAIL

View file

@ -1,3 +0,0 @@
[grid-content-distribution-must-account-for-track-sizing-003.html]
[.grid 1]
expected: FAIL

View file

@ -1,48 +0,0 @@
[grid-find-fr-size-gutters-001.html]
[.grid 1]
expected: FAIL
[.grid 2]
expected: FAIL
[.grid 3]
expected: FAIL
[.grid 4]
expected: FAIL
[.grid 5]
expected: FAIL
[.grid 6]
expected: FAIL
[.grid 7]
expected: FAIL
[.grid 8]
expected: FAIL
[.grid 9]
expected: FAIL
[.grid 10]
expected: FAIL
[.grid 11]
expected: FAIL
[.grid 12]
expected: FAIL
[.grid 13]
expected: FAIL
[.grid 14]
expected: FAIL
[.grid 15]
expected: FAIL
[.grid 16]
expected: FAIL

View file

@ -1,18 +0,0 @@
[grid-find-fr-size-gutters-002.html]
[.grid 1]
expected: FAIL
[.grid 2]
expected: FAIL
[.grid 3]
expected: FAIL
[.grid 4]
expected: FAIL
[.grid 5]
expected: FAIL
[.grid 6]
expected: FAIL

View file

@ -1,2 +0,0 @@
[grid-layout-free-space-unit.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[grid-percent-rows-filled-shrinkwrap-001.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[grid-percent-rows-spanned-shrinkwrap-001.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[grid-stretch-respects-min-size-001.html]
expected: FAIL