WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
288283
Encapsulate containing block calculations for positioned layout
https://bugs.webkit.org/show_bug.cgi?id=288283
Summary
Encapsulate containing block calculations for positioned layout
fantasai
Reported
2025-02-21 22:31:31 PST
Positioned layout in RenderBox is tangled up in ways that make it hard to build on: * Setting and calculating values from containing block geometry is scattered throughout the code. * Offset calculations for converting to/from container coordinates are unnecessarily confusing and not well separated from layout rule implementations. * We repeat some calculations for no other reason that someone happened to put them in a function that's called multiple times. * We pass around long lists of parameters in order to pass cached information from one function to another, which makes it hard to notice the parameters that actually changed between function calls. To have a better foundation for adding position-area and alignment code, we should: * Encapsulate containing block geometry logic and data. * Package up cached values into a single struct so they can be passed as a single parameter. * Better organize calculations into phases so that position-area adjustments to the containing block and alignment logic can be more easily and correctly integrated.
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2025-02-21 22:31:39 PST
<
rdar://problem/145348582
>
fantasai
Comment 2
2025-02-23 19:40:07 PST
https://github.com/WebKit/WebKit/pull/41180
EWS
Comment 3
2025-02-25 20:34:31 PST
Committed
291088@main
(6512cb0009b0): <
https://commits.webkit.org/291088@main
> Reviewed commits have been landed. Closing PR #41180 and removing active labels.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug