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

@ -0,0 +1,2 @@
[masonry-align-content-001.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[masonry-align-content-002.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[masonry-align-content-003.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[masonry-align-content-004.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[masonry-justify-content-001.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[masonry-justify-content-002.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[masonry-justify-content-003.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[masonry-justify-content-004.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[masonry-grid-item-self-baseline-001.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[masonry-grid-item-self-baseline-002a.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[masonry-grid-item-self-baseline-002b.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[masonry-fragmentation-003.html]
expected: FAIL

View file

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

View file

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

View file

@ -1,2 +1,2 @@
[masonry-grid-placement-named-lines-002.html]
expected: FAIL
expected: CRASH

View file

@ -0,0 +1,2 @@
[masonry-intrinsic-sizing-cols-006.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[masonry-intrinsic-sizing-rows-005.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[masonry-intrinsic-sizing-rows-006.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[masonry-columns-item-placement-auto-flow-next-001.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[masonry-item-placement-003.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[masonry-item-placement-006.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[masonry-item-placement-007.html]
expected: FAIL

View file

@ -2,18 +2,9 @@
[Property grid-template-rows value 'masonry']
expected: FAIL
[Property grid-template-columns value 'none']
expected: FAIL
[Property grid-template-columns value '20%']
expected: FAIL
[Property grid-template-columns value 'calc(-0.5em + 10px)']
expected: FAIL
[Property grid-template-columns value 'calc(0.5em + 10px)']
expected: FAIL
[Property grid-template-columns value 'calc(30% + 40px)']
expected: FAIL

View file

@ -0,0 +1,2 @@
[masonry-not-inhibited-001.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[masonry-order-001.html]
expected: FAIL

View file

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