mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 13:36:13 +03:00
LibWeb: Add auto as a recognized argument of flex-basis
There isn't actually any special treatment of this over 'content' in the FlexFormattingContext, for now both are treated the same. This fixes #9225
This commit is contained in:
parent
6852ba4d34
commit
833936f3ec
Notes:
sideshowbarker
2024-07-18 07:19:00 +09:00
Author: https://github.com/TobyAsE Commit: https://github.com/SerenityOS/serenity/commit/833936f3ecc Pull-request: https://github.com/SerenityOS/serenity/pull/9247 Issue: https://github.com/SerenityOS/serenity/issues/9225
@ -41,7 +41,7 @@ public:
|
||||
};
|
||||
|
||||
struct FlexBasisData {
|
||||
CSS::FlexBasis type { CSS::FlexBasis::Content };
|
||||
CSS::FlexBasis type { CSS::FlexBasis::Auto };
|
||||
CSS::Length length {};
|
||||
};
|
||||
|
||||
|
@ -285,6 +285,9 @@ Optional<CSS::FlexBasisData> StyleProperties::flex_basis() const
|
||||
if (value.value()->is_identifier() && value.value()->to_identifier() == CSS::ValueID::Content)
|
||||
return { { CSS::FlexBasis::Content, {} } };
|
||||
|
||||
if (value.value()->is_auto())
|
||||
return { { CSS::FlexBasis::Auto, {} } };
|
||||
|
||||
if (value.value()->is_length())
|
||||
return { { CSS::FlexBasis::Length, value.value()->to_length() } };
|
||||
|
||||
|
@ -96,7 +96,8 @@ enum class FlexWrap {
|
||||
|
||||
enum class FlexBasis {
|
||||
Content,
|
||||
Length
|
||||
Length,
|
||||
Auto,
|
||||
};
|
||||
|
||||
enum class WhiteSpace {
|
||||
|
@ -311,6 +311,7 @@ void FlexFormattingContext::run(Box& box, LayoutMode)
|
||||
} else {
|
||||
// E
|
||||
// FIXME: This is probably too naive.
|
||||
// FIXME: Care about FlexBasis::Auto
|
||||
if (has_definite_main_size(child_box)) {
|
||||
flex_item.flex_base_size = specified_main_size(child_box);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user