summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorTobias Christiansen <tobi@tobyase.de>2021-08-06 22:00:25 +0200
committerAndreas Kling <kling@serenityos.org>2021-08-07 15:21:34 +0200
commit833936f3ecc635d39c5fa092e88e2056ed749089 (patch)
treec9c841851d59cf4092892428512ed8035aa38590 /Userland/Libraries
parent6852ba4d34306109d746cfb57651d76f3b88a2c6 (diff)
downloadserenity-833936f3ecc635d39c5fa092e88e2056ed749089.zip
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
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibWeb/CSS/ComputedValues.h2
-rw-r--r--Userland/Libraries/LibWeb/CSS/StyleProperties.cpp3
-rw-r--r--Userland/Libraries/LibWeb/CSS/StyleValue.h3
-rw-r--r--Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp1
4 files changed, 7 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/ComputedValues.h b/Userland/Libraries/LibWeb/CSS/ComputedValues.h
index 24321e83b1..d328ad71c8 100644
--- a/Userland/Libraries/LibWeb/CSS/ComputedValues.h
+++ b/Userland/Libraries/LibWeb/CSS/ComputedValues.h
@@ -41,7 +41,7 @@ public:
};
struct FlexBasisData {
- CSS::FlexBasis type { CSS::FlexBasis::Content };
+ CSS::FlexBasis type { CSS::FlexBasis::Auto };
CSS::Length length {};
};
diff --git a/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp b/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp
index 8be326dd77..caefdc203e 100644
--- a/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp
+++ b/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp
@@ -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() } };
diff --git a/Userland/Libraries/LibWeb/CSS/StyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValue.h
index 52fe6fa632..407becce3b 100644
--- a/Userland/Libraries/LibWeb/CSS/StyleValue.h
+++ b/Userland/Libraries/LibWeb/CSS/StyleValue.h
@@ -96,7 +96,8 @@ enum class FlexWrap {
enum class FlexBasis {
Content,
- Length
+ Length,
+ Auto,
};
enum class WhiteSpace {
diff --git a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp
index 3f9b5f51ef..9407030d3f 100644
--- a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp
+++ b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp
@@ -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 {