mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-10 19:46:03 +00:00
LibWeb: Modernize handling of the CSS flex-basis property
Instead of a custom struct, use an AK::Variant for flex-basis. A flex-basis is either `content` or a CSS size value, so we don't need anything custom for that. By using a CSS size, we also avoid having to convert in and out of size in various places, simplifying the code. This finally gets rid of the "Unsupported main size for flex-basis" debug spam. :^)
This commit is contained in:
parent
8c980cf75b
commit
8648355783
Notes:
sideshowbarker
2024-07-17 10:39:39 +09:00
Author: https://github.com/awesomekling
Commit: 8648355783
Pull-request: https://github.com/SerenityOS/serenity/pull/19540
6 changed files with 44 additions and 89 deletions
|
@ -53,7 +53,7 @@ private:
|
|||
|
||||
struct FlexItem {
|
||||
JS::NonnullGCPtr<Box> box;
|
||||
CSS::FlexBasisData used_flex_basis {};
|
||||
Optional<CSS::FlexBasis> used_flex_basis {};
|
||||
bool used_flex_basis_is_definite { false };
|
||||
CSSPixels flex_base_size { 0 };
|
||||
CSSPixels hypothetical_main_size { 0 };
|
||||
|
@ -214,7 +214,7 @@ private:
|
|||
|
||||
virtual void parent_context_did_dimension_child_root_box() override;
|
||||
|
||||
CSS::FlexBasisData used_flex_basis_for_item(FlexItem const&) const;
|
||||
CSS::FlexBasis used_flex_basis_for_item(FlexItem const&) const;
|
||||
|
||||
LayoutState::UsedValues& m_flex_container_state;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue