-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
layout: use Au
in BoxFragment
#32349
base: main
Are you sure you want to change the base?
Conversation
🔨 Triggering try run (#9196209058) for Linux WPT, MacOS, Windows, Android |
Test results for linux-wpt-layout-2013 from try job (#9196209058): Flaky unexpected result (14)
Stable unexpected results that are known to be intermittent (10)
|
Test results for linux-wpt-layout-2020 from try job (#9196209058): Flaky unexpected result (8)
Stable unexpected results that are known to be intermittent (17)
Stable unexpected results (5)
|
|
au
in box_fragement
Au
in box_fragement
🔨 Triggering try run (#9209851487) for Linux WPT |
let list = &self.style.get_box().transform; | ||
match list.to_transform_3d_matrix(Some(containing_block)) { | ||
match list.to_transform_3d_matrix(Some(&au_rect_to_length_rect(containing_block))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to a convert here because it is expected to be ComputedType
as can be noticed here. It was trickier to keep &Rect<Length>
as it was!
same of calculate_transform_matrix
in this same file!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this makes sense I think. Transforms use f32.
Test results for linux-wpt-layout-2020 from try job (#9209851487): Flaky unexpected result (18)
Stable unexpected results that are known to be intermittent (18)
Stable unexpected results (2)
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good! Just a couple quick high-level comments.
16a746c
to
3c1467f
Compare
🔨 Triggering try run (#9365574631) for Linux WPT |
Test results for linux-wpt-layout-2020 from try job (#9365574631): Flaky unexpected result (16)
Stable unexpected results that are known to be intermittent (10)
Stable unexpected results (2)
|
|
let physical_rect = euclid::default::Rect::new( | ||
euclid::default::Point2D::new( | ||
Au::from_f32_px(rect.origin.x.to_f32_px()), | ||
Au::from_f32_px(rect.origin.y.to_f32_px()), | ||
), | ||
euclid::default::Size2D::new( | ||
Au::from_f32_px(rect.size.width.to_f32_px()), | ||
Au::from_f32_px(rect.size.height.to_f32_px()), | ||
), | ||
); | ||
|
||
content_boxes.push(physical_rect); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is equivalent:
let physical_rect = euclid::default::Rect::new( | |
euclid::default::Point2D::new( | |
Au::from_f32_px(rect.origin.x.to_f32_px()), | |
Au::from_f32_px(rect.origin.y.to_f32_px()), | |
), | |
euclid::default::Size2D::new( | |
Au::from_f32_px(rect.size.width.to_f32_px()), | |
Au::from_f32_px(rect.size.height.to_f32_px()), | |
), | |
); | |
content_boxes.push(physical_rect); | |
content_boxes.push(rect.to_untyped()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I didn't know about to_untyped()
. Looks very helpful.
There is also the "fragement" typo in the issue title and description |
Au
in box_fragement
Au
in BoxFragment
🔨 Triggering try run (#9489484091) for Linux WPT, MacOS, Windows, Android |
Test results for linux-wpt-layout-2020 from try job (#9489484091): Flaky unexpected result (15)
Stable unexpected results that are known to be intermittent (11)
Stable unexpected results (1)
|
Test results for linux-wpt-layout-2013 from try job (#9489484091): Flaky unexpected result (12)
Stable unexpected results that are known to be intermittent (7)
Stable unexpected results (1)
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are merge conflicts, you need to rebase.
🔨 Triggering try run (#9497848844) for Linux WPT |
Test results for linux-wpt-layout-2020 from try job (#9497848844): Flaky unexpected result (9)
Stable unexpected results that are known to be intermittent (16)
Stable unexpected results (6)
|
|
🔨 Triggering try run (#9501088006) for Linux WPT |
Test results for linux-wpt-layout-2020 from try job (#9501088006): Flaky unexpected result (17)
Stable unexpected results that are known to be intermittent (9)
Stable unexpected results (1)
|
|
🔨 Triggering try run (#9502276872) for Linux WPT |
|
||
[clientWidth, offsetWidth and scrollWidth round 5.5 to 6] | ||
expected: FAIL | ||
|
||
[clientWidth, offsetWidth and scrollWidth round 5.9 to 6] | ||
expected: FAIL | ||
|
||
[clientHeight, offsetHeight and scrollHeight round 5.5 to 6] | ||
expected: FAIL | ||
|
||
[clientHeight, offsetHeight and scrollHeight round 5.9 to 6] | ||
expected: FAIL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this should be failing. Was it passing before my suggestions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it was also failing before your suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you try to fix it?
Test results for linux-wpt-layout-2020 from try job (#9502276872): Flaky unexpected result (10)
Stable unexpected results that are known to be intermittent (16)
|
✨ Try run (#9502276872) succeeded. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Just a couple suggestions to apply before landing.
let row_group_start_corner: LogicalVec2<Au> = row_group_layout.rect.start_corner; | ||
self.rect.start_corner -= row_group_start_corner; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let row_group_start_corner: LogicalVec2<Au> = row_group_layout.rect.start_corner; | |
self.rect.start_corner -= row_group_start_corner; | |
self.rect.start_corner -= row_group_layout.rect.start_corner; |
@@ -711,7 +712,7 @@ impl<'a> BuilderForBoxFragment<'a> { | |||
// is used). | |||
if let BackgroundMode::Extra(ref extra_backgrounds) = self.fragment.background_mode { | |||
for extra_background in extra_backgrounds { | |||
let positioning_area: LogicalRect<Length> = extra_background.rect.clone().into(); | |||
let positioning_area: LogicalRect<Au> = extra_background.rect.clone(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let positioning_area: LogicalRect<Au> = extra_background.rect.clone(); | |
let positioning_area = extra_background.rect.clone(); |
@@ -1209,7 +1209,7 @@ impl SequentialLayoutState { | |||
); | |||
|
|||
let pbm_sums = &(&box_fragment.padding + &box_fragment.border) + &box_fragment.margin; | |||
let content_rect: LogicalRect<Au> = box_fragment.content_rect.clone().into(); | |||
let content_rect: LogicalRect<Au> = box_fragment.content_rect.clone(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let content_rect: LogicalRect<Au> = box_fragment.content_rect.clone(); | |
let content_rect = box_fragment.content_rect.clone(); |
Use app units in
BoxFragment
,fragment_tree
and at some other places in layout2020./mach build -d
does not report any errors./mach test-tidy
does not report any errors