layout: grid template getComputedStyle resolved value (#34885)

* Store taffy detailed info into fragment

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

* Fix info propagation and resolved grid track query

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

* Fix import

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

* Fix tracklist matching logic and type optimization

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

* Run fmt

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

* Update wpt expectations

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

* Optimizing info propagation and minor qol

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

* Run fmt

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>

---------

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>
This commit is contained in:
Steven Novaryo 2025-01-09 18:49:27 +08:00 committed by GitHub
parent 040e29415b
commit 76fa456a9a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 297 additions and 778 deletions

View file

@ -23,7 +23,8 @@ use crate::formatting_contexts::{
IndependentFormattingContext, IndependentFormattingContextContents,
};
use crate::fragment_tree::{
BoxFragment, CollapsedBlockMargins, Fragment, FragmentFlags, HoistedSharedFragment,
BoxFragment, CollapsedBlockMargins, DetailedLayoutInfo, Fragment, FragmentFlags,
HoistedSharedFragment,
};
use crate::geom::{
AuOrAuto, LengthPercentageOrAuto, LogicalRect, LogicalSides, LogicalVec2, PhysicalPoint,
@ -561,6 +562,7 @@ impl HoistedAbsolutelyPositionedBox {
let mut new_fragment = {
let content_size: LogicalVec2<Au>;
let fragments;
let mut detailed_layout_info: Option<DetailedLayoutInfo> = None;
match &context.contents {
IndependentFormattingContextContents::Replaced(replaced) => {
// https://drafts.csswg.org/css2/visudet.html#abs-replaced-width
@ -629,6 +631,7 @@ impl HoistedAbsolutelyPositionedBox {
block: block_size,
};
fragments = independent_layout.fragments;
detailed_layout_info = independent_layout.detailed_layout_info;
},
};
@ -676,6 +679,7 @@ impl HoistedAbsolutelyPositionedBox {
// elements are not inflow.
CollapsedBlockMargins::zero(),
)
.with_detailed_layout_info(detailed_layout_info)
};
positioning_context.layout_collected_children(layout_context, &mut new_fragment);