mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 18:50:50 +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
|
@ -67,6 +67,8 @@ struct LayoutState {
|
|||
void set_content_width(CSSPixels);
|
||||
void set_content_height(CSSPixels);
|
||||
|
||||
CSSPixelSize content_size() const { return { content_width(), content_height() }; }
|
||||
|
||||
void set_indefinite_content_width();
|
||||
void set_indefinite_content_height();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue