diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2022-01-14 12:23:54 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-01-20 00:04:10 +0100 |
commit | 01b57fa8b7275cba91e476ea6ba3f079514c4ac7 (patch) | |
tree | 461312b68b372a8a1939afc2d1d203083995e444 /Meta | |
parent | 71ab8fb757f560d50f1c324fbdfa5678597d0b69 (diff) | |
download | serenity-01b57fa8b7275cba91e476ea6ba3f079514c4ac7.zip |
LibWeb: Add CSS::Percentage, PercentageOr and LengthPercentage types
Length and Percentage are different types, and sometimes only one or the
other is allowed in a given CSS property. This is a first step towards
separating them.
Diffstat (limited to 'Meta')
-rw-r--r-- | Meta/Lagom/Tools/CodeGenerators/LibWeb/Generate_CSS_PropertyID_cpp.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/Generate_CSS_PropertyID_cpp.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/Generate_CSS_PropertyID_cpp.cpp index 12b0a84e38..e1ac87163f 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/Generate_CSS_PropertyID_cpp.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/Generate_CSS_PropertyID_cpp.cpp @@ -311,8 +311,9 @@ bool property_accepts_value(PropertyID property_id, StyleValue& style_value) return true; )~~~"); } else if (type_name == "percentage") { + // FIXME: Detecting lengths here is temporary until Length/Percentage are fully separated. property_generator.append(R"~~~( - if ((style_value.has_length() && style_value.to_length().is_percentage()) || style_value.is_calculated()) + if (style_value.is_percentage() || style_value.is_calculated() || (style_value.has_length() && !style_value.to_length().is_percentage())) return true; )~~~"); } else if (type_name == "number" || type_name == "integer") { |