Bug 288283
| Summary: | Encapsulate containing block calculations for positioned layout | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | fantasai <fantasai.bugs> |
| Component: | Layout and Rendering | Assignee: | fantasai <fantasai.bugs> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | bfulgham, kiet.ho, simon.fraser, webkit-bug-importer, zalan |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Local Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Bug Depends on: | 288398 | ||
| Bug Blocks: | 275447 | ||
fantasai
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
<rdar://problem/145348582>
fantasai
https://github.com/WebKit/WebKit/pull/41180
EWS
Committed 291088@main (6512cb0009b0): <https://commits.webkit.org/291088@main>
Reviewed commits have been landed. Closing PR #41180 and removing active labels.