summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2021-09-10 20:42:50 +0100
committerAndreas Kling <kling@serenityos.org>2021-09-12 16:30:38 +0200
commit8e4a4fd4db56d9e6fd1d16638872d9703b3bb26d (patch)
treed2319b8adf4bc1175a87fa16a9836873630be151
parent2a141600a3176b29a12bb1e18429e3f1e0d7a37c (diff)
downloadserenity-8e4a4fd4db56d9e6fd1d16638872d9703b3bb26d.zip
LibWeb: Remove "takes integer value" concept from parse_css_value()
This was only needed when numeric values had to be wrapped as Lengths, and now serves no purpose.
-rw-r--r--Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp18
1 files changed, 2 insertions, 16 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp
index f22b0a1cab..dc6166e919 100644
--- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp
+++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp
@@ -2872,22 +2872,8 @@ RefPtr<StyleValue> Parser::parse_css_value(PropertyID property_id, TokenStream<S
return {};
}
-RefPtr<StyleValue> Parser::parse_css_value(ParsingContext const& context, PropertyID property_id, StyleComponentValueRule const& component_value)
-{
- // FIXME: Figure out if we still need takes_integer_value, and if so, move this information
- // into Properties.json.
- auto takes_integer_value = [](PropertyID property_id) -> bool {
- return property_id == PropertyID::ZIndex
- || property_id == PropertyID::FontWeight
- || property_id == PropertyID::Custom;
- };
- if (takes_integer_value(property_id) && component_value.is(Token::Type::Number)) {
- auto number = component_value.token();
- if (number.m_number_type == Token::NumberType::Integer) {
- return LengthStyleValue::create(Length::make_px(number.to_integer()));
- }
- }
-
+RefPtr<StyleValue> Parser::parse_css_value(ParsingContext const& context, PropertyID, StyleComponentValueRule const& component_value)
+{
if (auto builtin = parse_builtin_value(context, component_value))
return builtin;