-
Notifications
You must be signed in to change notification settings - Fork 30
Palm/rework layout calls #83
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
base: main
Are you sure you want to change the base?
Conversation
|
||
// these 2 sizes do NOT account margins | ||
Math::Insets<Au> borders; | ||
Math::Insets<Au> padding; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we be storing these values vs computing on the fly? discuss with the team
Au availableXSpace; | ||
Au containingBlockX; | ||
Au capmin; | ||
Opt<Au> knownSizeX; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
benchmark this
890e084
to
b5af72d
Compare
b5af72d
to
d5e8d3d
Compare
d5e8d3d
to
e5044d5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the layout system to improve how layout calls are handled, specifically focusing on separating content box and border box layout operations. The key changes include introducing a new UsedSpacings
structure and reorganizing layout function responsibilities.
- Introduces
UsedSpacings
struct to manage padding, borders, and margins consistently - Separates content box and border box layout operations into distinct functions
- Updates table, flex, inline, and block layout contexts to use the new layout API
- Adds comprehensive test cases for table padding resolution and flex/block intrinsic sizing
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/vaev-engine/layout/layout.cpp |
Defines new UsedSpacings struct and exports for layout functions |
src/vaev-engine/layout/layout-impl.cpp |
Major refactoring with new layout functions and spacing computation logic |
src/vaev-engine/layout/table.cpp |
Updates table layout to use new border box layout functions and spacing system |
src/vaev-engine/layout/replaced.cpp |
Simplifies replaced element layout by removing unnecessary function call |
src/vaev-engine/layout/flex.cpp |
Refactors flex layout to use UsedSpacings and new layout API |
src/vaev-engine/layout/inline.cpp |
Updates inline layout to compute spacings explicitly and use new layout functions |
src/vaev-engine/layout/block.cpp |
Refactors block layout to use UsedSpacings and new child layout pattern |
tests/css/display-table.xhtml |
Adds test case for table padding resolution behavior |
tests/css/display-flex.xhtml |
Adds test case for flex intrinsic sizes with inline children |
tests/css/display-block.xhtml |
Adds test case for intrinsic sizing across element trees |
Comments suppressed due to low confidence (3)
src/vaev-engine/layout/layout-impl.cpp:11
- Remove the empty line at the beginning of the struct scope.
import :layout.block;
src/vaev-engine/layout/layout-impl.cpp:286
- Function name
_adaptToContentBox
uses underscore prefix which should be reserved for private methods, but this appears to be a helper function. Consider renaming toadaptToContentBox
or making it properly private.
Input _adaptToContentBox(Input input, UsedSpacings const& usedSpacings) {
src/vaev-engine/layout/block.cpp:125
- Function name
_populateChildSpecifiedSizes
uses underscore prefix which should be reserved for private methods, but this appears to be a helper function. Consider renaming topopulateChildSpecifiedSizes
or making it properly private.
void _populateChildSpecifiedSizes(Tree& tree, Box& child, Input& childInput, Au horizontalMargins, Opt<Au> blockInlineSize) {
818433e
to
c2862da
Compare
c2862da
to
bfd53f5
Compare
…mputation to parent.
bfd53f5
to
cd700dd
Compare
No description provided.