mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-13 11:42:38 +03:00
LibWeb: Parse the CSS opacity
property with strtof()
for now
With the new parser, we started interpreting the `opacity` property as a string value, which made it turn into `auto` and so anything with opacity ended up not visible (e.g the header on google.com) This patch restores our old behavior for `opacity` by interpreting it as a numeric value with optional decimals.
This commit is contained in:
parent
ed7a2f21ff
commit
f58e2350dc
Notes:
sideshowbarker
2024-07-18 05:27:29 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/f58e2350dcd
@ -2869,6 +2869,12 @@ 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_or_dynamic = parse_builtin_or_dynamic_value(context, component_value))
|
||||
return builtin_or_dynamic;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user