Skip to content
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

LibWeb: Propagate margin and offset when computing a box's baseline #649

Merged
merged 1 commit into from
Jul 15, 2024

Conversation

BenJilks
Copy link
Contributor

@BenJilks BenJilks commented Jul 15, 2024

The addresses the issue #610

When traversing the layout tree to find an appropriate box child to derive the baseline from. Only the child's margin and offset was being applied. To fix this I sum each offset on the recursive call.

Because input elements use inlined flexbox, this breaks a lot of tests. Most of the time it just changes the baseline, but has no effect on the layout. Otherwise, I've checked each test and this now produces a more accurate result. For example, the label on file inputs are now vertically aligned with the text in the button.

When traversing the layout tree to find an appropriate box child to
derive the baseline from. Only the child's margin and offset was being
applied. Now we sum each offset on the recursive call.
@awesomekling
Copy link
Member

That's a great catch!

@awesomekling awesomekling merged commit 3c897e7 into LadybirdBrowser:master Jul 15, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants