mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-16 23:39:44 +00:00
LibWeb: Only apply box offset if the box is not already the ancestor
When determining the content/margin box rects within their ancestor's coordinate space, we were returning early if the passed in values already belonged to the requested ancestor. Unfortunately, we had already applied the used values' offset to the rect, which is the offset to the ancestor's ancestor. This simplifies the logic to always apply the rect offset after checking if we've reached the ancestor. Fixes determining float intrusions inside block elements with `margin: auto` set. Fixes #4083.
This commit is contained in:
parent
28d5d982ce
commit
99df80f81e
Notes:
github-actions[bot]
2025-04-04 13:36:19 +00:00
Author: https://github.com/gmta
Commit: 99df80f81e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4219
5 changed files with 57 additions and 16 deletions
|
@ -82,7 +82,6 @@ public:
|
|||
|
||||
[[nodiscard]] CSSPixelRect absolute_content_rect(Box const&) const;
|
||||
[[nodiscard]] CSSPixelRect margin_box_rect_in_ancestor_coordinate_space(Box const&, Box const& ancestor_box) const;
|
||||
[[nodiscard]] CSSPixelRect margin_box_rect(LayoutState::UsedValues const&) const;
|
||||
[[nodiscard]] CSSPixelRect margin_box_rect_in_ancestor_coordinate_space(LayoutState::UsedValues const&, Box const& ancestor_box) const;
|
||||
[[nodiscard]] CSSPixelRect content_box_rect(Box const&) const;
|
||||
[[nodiscard]] CSSPixelRect content_box_rect(LayoutState::UsedValues const&) const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue