layout: Use Au in ResolvedMargins and CollapsedMargin (#31848)

* change ResolvedMargins to use Au instead of length

* made suggested changes

removed whitespace changes

made suggested changes

* Update components/layout_2020/flexbox/layout.rs

Co-authored-by: Oriol Brufau <obrufau@igalia.com>

* Update components/layout_2020/flow/mod.rs

Co-authored-by: Oriol Brufau <obrufau@igalia.com>

* fixed errors

fixed errors

fixed formatting

fixed errors

* modified changes

made suggested changes

* Update components/layout_2020/fragment_tree/fragment.rs

Co-authored-by: Oriol Brufau <obrufau@igalia.com>

updated components/layout_2020/fragment_tree/fragment.rs

* Update components/layout_2020/flow/mod.rs

Co-authored-by: Oriol Brufau <obrufau@igalia.com>

* Update components/layout_2020/flow/mod.rs

Co-authored-by: Oriol Brufau <obrufau@igalia.com>

* updated changes

updated changes

* unified all the suggested changes here

* fixed formatting

* reverted unnecessary changes

* fixed unnecessary warnings

---------

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Ekta Siwach 2024-03-28 19:50:14 +05:30 committed by GitHub
parent 66ad795014
commit 5d518ca8dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 62 additions and 70 deletions

View file

@ -847,7 +847,7 @@ impl FlexLine<'_> {
.zip(&item_margins)
.map(|(((item, item_result), content_rect), margin)| {
let content_rect = flex_context.rect_to_flow_relative(line_size, content_rect);
let margin = flex_context.sides_to_flow_relative(*margin);
let margin = flex_context.sides_to_flow_relative(*margin).into();
let collapsed_margin = CollapsedBlockMargins::from_margin(&margin);
(
// TODO: We should likely propagate baselines from `display: flex`.
@ -858,7 +858,7 @@ impl FlexLine<'_> {
content_rect,
flex_context.sides_to_flow_relative(item.padding),
flex_context.sides_to_flow_relative(item.border),
margin.into(),
margin,
None, /* clearance */
collapsed_margin,
),