mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
LibWeb: Handle flood-opacity
in line with other opacity properties
We now do the proper thing in terms of: - Allowing percentages - Returning the computed value in getComputedStyle - Handling values out of the [0,1] range Gains us 13 WPT passes in the imported tests.
This commit is contained in:
parent
6f39c30704
commit
4ee8110449
Notes:
github-actions[bot]
2025-07-18 15:06:07 +00:00
Author: https://github.com/Calme1709
Commit: 4ee8110449
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5502
Reviewed-by: https://github.com/tcl3 ✅
7 changed files with 84 additions and 1 deletions
|
@ -830,6 +830,10 @@ RefPtr<CSSStyleValue const> CSSStyleProperties::style_value_for_computed_propert
|
|||
auto opacity = layout_node.computed_values().stroke_opacity();
|
||||
return NumberStyleValue::create(opacity);
|
||||
}
|
||||
case PropertyID::FloodOpacity: {
|
||||
auto opacity = layout_node.computed_values().flood_opacity();
|
||||
return NumberStyleValue::create(opacity);
|
||||
}
|
||||
case PropertyID::OutlineWidth: {
|
||||
auto outline_width = layout_node.computed_values().outline_width();
|
||||
return LengthStyleValue::create(outline_width);
|
||||
|
|
|
@ -662,6 +662,7 @@ Parser::ParseErrorOr<NonnullRefPtr<CSSStyleValue const>> Parser::parse_css_value
|
|||
return ParseError::SyntaxError;
|
||||
case PropertyID::Opacity:
|
||||
case PropertyID::FillOpacity:
|
||||
case PropertyID::FloodOpacity:
|
||||
case PropertyID::StopOpacity:
|
||||
case PropertyID::StrokeOpacity:
|
||||
if (auto parsed_value = parse_opacity_value(property_id, tokens); parsed_value && !tokens.has_next_token())
|
||||
|
|
|
@ -1561,7 +1561,8 @@
|
|||
"inherited": false,
|
||||
"initial": "1",
|
||||
"valid-types": [
|
||||
"number [0,1]"
|
||||
"number [-∞,∞]",
|
||||
"percentage [-∞,∞]"
|
||||
]
|
||||
},
|
||||
"font": {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue