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,13 +1,4 @@
[grid-layout-properties.html]
[display: grid]
expected: FAIL
[display: inline-grid]
expected: FAIL
[grid-template-columns]
expected: FAIL
[grid-template-columns.initial]
expected: FAIL
@ -20,9 +11,6 @@
[grid-template-columns.<track-size>.auto]
expected: FAIL
[grid-template-columns.<track-size>.<track-breadth>.<length>]
expected: FAIL
[grid-template-columns.<track-size>.<track-breadth>.<percentage>]
expected: FAIL
@ -41,9 +29,6 @@
[grid-template-columns.reset]
expected: FAIL
[grid-template-rows]
expected: FAIL
[grid-template-rows.initial]
expected: FAIL
@ -77,344 +62,11 @@
[grid-template-rows.reset]
expected: FAIL
[grid-template-areas]
expected: FAIL
[grid-template-areas.initial]
expected: FAIL
[grid-template-areas.none]
expected: FAIL
[grid-template-areas.<string>+]
expected: FAIL
[grid-template-areas.reset]
expected: FAIL
[grid-template]
expected: FAIL
[grid-template.initial]
expected: FAIL
[grid-template.none]
expected: FAIL
[grid-template.<grid-template-rows> / <grid-template-columns>]
expected: FAIL
[grid-template.<line-names>]
expected: FAIL
[grid-template.<string>+]
expected: FAIL
[grid-template.<string><track-size>+]
expected: FAIL
[grid-template.reset]
expected: FAIL
[grid-auto-columns]
expected: FAIL
[grid-auto-columns.initial]
expected: FAIL
[grid-auto-columns.<track-size>.auto]
expected: FAIL
[grid-auto-columns.<track-size>.<track-breadth>.<length>]
expected: FAIL
[grid-auto-columns.<track-size>.<track-breadth>.<percentage>]
expected: FAIL
[grid-auto-columns.<track-size>.<track-breadth>.<flex>]
expected: FAIL
[grid-auto-columns.<track-size>.<track-breadth>.min-content]
expected: FAIL
[grid-auto-columns.<track-size>.<track-breadth>.max-content]
expected: FAIL
[grid-auto-columns.<track-size>.<track-breadth>.minmax()]
expected: FAIL
[grid-auto-columns.reset]
expected: FAIL
[grid-auto-rows]
expected: FAIL
[grid-auto-rows.initial]
expected: FAIL
[grid-auto-rows.<track-size>.auto]
expected: FAIL
[grid-auto-rows.<track-size>.<track-breadth>.<length>]
expected: FAIL
[grid-auto-rows.<track-size>.<track-breadth>.<percentage>]
expected: FAIL
[grid-auto-rows.<track-size>.<track-breadth>.<flex>]
expected: FAIL
[grid-auto-rows.<track-size>.<track-breadth>.min-content]
expected: FAIL
[grid-auto-rows.<track-size>.<track-breadth>.max-content]
expected: FAIL
[grid-auto-rows.<track-size>.<track-breadth>.minmax()]
expected: FAIL
[grid-auto-rows.reset]
expected: FAIL
[grid-auto-flow]
expected: FAIL
[grid-auto-flow.initial]
expected: FAIL
[grid-auto-flow.row]
expected: FAIL
[grid-auto-flow.column]
expected: FAIL
[grid-auto-flow.dense]
expected: FAIL
[grid-auto-flow.row dense]
expected: FAIL
[grid-auto-flow.column dense]
expected: FAIL
[grid-auto-flow.reset]
expected: FAIL
[grid-row-start]
expected: FAIL
[grid-row-start.initial]
expected: FAIL
[grid-row-start.auto]
expected: FAIL
[grid-row-start.<custom-ident>]
expected: FAIL
[grid-row-start.<integer>]
expected: FAIL
[grid-row-start.<integer> <ident>]
expected: FAIL
[grid-row-start.span <integer>]
expected: FAIL
[grid-row-start.span <custom-ident>]
expected: FAIL
[grid-row-start.span <integer> <custom-ident>]
expected: FAIL
[grid-row-start.reset]
expected: FAIL
[grid-column-start]
expected: FAIL
[grid-column-start.initial]
expected: FAIL
[grid-column-start.auto]
expected: FAIL
[grid-column-start.<custom-ident>]
expected: FAIL
[grid-column-start.<integer>]
expected: FAIL
[grid-column-start.<integer> <ident>]
expected: FAIL
[grid-column-start.span <integer>]
expected: FAIL
[grid-column-start.span <custom-ident>]
expected: FAIL
[grid-column-start.span <integer> <custom-ident>]
expected: FAIL
[grid-column-start.reset]
expected: FAIL
[grid-row-end]
expected: FAIL
[grid-row-end.initial]
expected: FAIL
[grid-row-end.auto]
expected: FAIL
[grid-row-end.<custom-ident>]
expected: FAIL
[grid-row-end.<integer>]
expected: FAIL
[grid-row-end.<integer> <ident>]
expected: FAIL
[grid-row-end.span <integer>]
expected: FAIL
[grid-row-end.span <custom-ident>]
expected: FAIL
[grid-row-end.span <integer> <custom-ident>]
expected: FAIL
[grid-row-end.reset]
expected: FAIL
[grid-column-end]
expected: FAIL
[grid-column-end.initial]
expected: FAIL
[grid-column-end.auto]
expected: FAIL
[grid-column-end.<custom-ident>]
expected: FAIL
[grid-column-end.<integer>]
expected: FAIL
[grid-column-end.<integer> <ident>]
expected: FAIL
[grid-column-end.span <integer>]
expected: FAIL
[grid-column-end.span <custom-ident>]
expected: FAIL
[grid-column-end.span <integer> <custom-ident>]
expected: FAIL
[grid-column-end.reset]
expected: FAIL
[grid-column]
expected: FAIL
[grid-column.initial]
expected: FAIL
[grid-column.auto]
expected: FAIL
[grid-column.<custom-ident>]
expected: FAIL
[grid-column.<integer> start]
expected: FAIL
[grid-column.<integer>]
expected: FAIL
[grid-column.<integer> <ident>]
expected: FAIL
[grid-column.span <integer>]
expected: FAIL
[grid-column.span <custom-ident>]
expected: FAIL
[grid-column.span <integer> <custom-ident>]
expected: FAIL
[grid-column.reset]
expected: FAIL
[grid-row]
expected: FAIL
[grid-row.initial]
expected: FAIL
[grid-row.auto]
expected: FAIL
[grid-row.<custom-ident>]
expected: FAIL
[grid-row.<integer> start]
expected: FAIL
[grid-row.<integer>]
expected: FAIL
[grid-row.<integer> <ident>]
expected: FAIL
[grid-row.span <integer>]
expected: FAIL
[grid-row.span <custom-ident>]
expected: FAIL
[grid-row.span <integer> <custom-ident>]
expected: FAIL
[grid-row.reset]
expected: FAIL
[grid-area]
expected: FAIL
[grid-area.initial]
expected: FAIL
[grid-area.auto]
expected: FAIL
[grid-area.<custom-ident>]
expected: FAIL
[grid-area.<integer> start]
expected: FAIL
[grid-area.<integer>]
expected: FAIL
[grid-area.<integer> <ident>]
expected: FAIL
[grid-area.span <integer>]
expected: FAIL
[grid-area.span <custom-ident>]
expected: FAIL
[grid-area.span <integer> <custom-ident>]
expected: FAIL
[grid-area.reset]
expected: FAIL