summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/CSS/Parser
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2021-09-10 20:23:57 +0100
committerAndreas Kling <kling@serenityos.org>2021-09-12 16:30:38 +0200
commitb8c4320ffa3e2080b5fdd2aaf673193536b888b0 (patch)
tree4d02d94858663b3a686e89bb576fd6153381c633 /Userland/Libraries/LibWeb/CSS/Parser
parent8dc4f3763ddc343a25f2997b2a334619598df9de (diff)
downloadserenity-b8c4320ffa3e2080b5fdd2aaf673193536b888b0.zip
LibWeb: Fix CSS opacity parsing
The StyleProperties code for opacity existed before NumericStyleValue was a thing, and was affected by over-enthusiastic unitless-length parsing, so it assumed everything was a length. Now it matches the Color4 spec instead, accepting either a number, or a percentage. We also get to remove the hack! :^)
Diffstat (limited to 'Userland/Libraries/LibWeb/CSS/Parser')
-rw-r--r--Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp6
1 files changed, 0 insertions, 6 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp
index c03b7ada14..f22b0a1cab 100644
--- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp
+++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp
@@ -2888,12 +2888,6 @@ RefPtr<StyleValue> Parser::parse_css_value(ParsingContext const& context, Proper
}
}
- // FIXME: This is a hack for the `opacity` property which should really take an <alpha-value>
- if (property_id == PropertyID::Opacity && component_value.is(Token::Type::Number)) {
- String string = component_value.token().number_string_value();
- return LengthStyleValue::create(Length::make_px(strtof(string.characters(), nullptr)));
- }
-
if (auto builtin = parse_builtin_value(context, component_value))
return builtin;