mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02: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:
committed by
Alexander Kalenik
parent
6f39c30704
commit
4ee8110449
Notes:
github-actions[bot]
2025-07-18 15:06:07 +00:00
Author: https://github.com/Calme1709 Commit: https://github.com/LadybirdBrowser/ladybird/commit/4ee8110449b Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5502 Reviewed-by: https://github.com/tcl3 ✅
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:h="http://www.w3.org/1999/xhtml"
|
||||
width="800px" height="800px">
|
||||
<title>Filter Effects Module Level 1: getComputedStyle().floodOpacity</title>
|
||||
<metadata>
|
||||
<h:link rel="help" href="https://drafts.fxtf.org/filter-effects/#propdef-flood-opacity"/>
|
||||
<h:meta name="assert" content="flood-opacity computed value is clamped to the range [0,1]."/>
|
||||
</metadata>
|
||||
<g id="target"></g>
|
||||
<h:script src="../../../resources/testharness.js"/>
|
||||
<h:script src="../../../resources/testharnessreport.js"/>
|
||||
<h:script src="../../../css/support/computed-testcommon.js"/>
|
||||
<script><![CDATA[
|
||||
|
||||
test_computed_value("flood-opacity", "-1", "0");
|
||||
test_computed_value("flood-opacity", "0.5");
|
||||
test_computed_value("flood-opacity", "3", "1");
|
||||
test_computed_value("flood-opacity", "-100%", "0");
|
||||
test_computed_value("flood-opacity", "50%", "0.5");
|
||||
test_computed_value("flood-opacity", "300%", "1");
|
||||
test_computed_value("flood-opacity", "calc(0.5 * sign(10em - 1px))", "0.5");
|
||||
test_computed_value("flood-opacity", "calc(50% * sign(10em - 1px))", "0.5");
|
||||
|
||||
]]></script>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:h="http://www.w3.org/1999/xhtml"
|
||||
width="800px" height="800px">
|
||||
<title>Filter Effects Module Level 1: parsing flood-opacity with valid values</title>
|
||||
<metadata>
|
||||
<h:link rel="help" href="https://drafts.fxtf.org/filter-effects/#propdef-flood-opacity"/>
|
||||
<h:meta name="assert" content="flood-opacity supports the full grammar 'alpha-value'."/>
|
||||
</metadata>
|
||||
<g id="target"></g>
|
||||
<h:script src="../../../resources/testharness.js"/>
|
||||
<h:script src="../../../resources/testharnessreport.js"/>
|
||||
<h:script src="../../../css/support/parsing-testcommon.js"/>
|
||||
<script><![CDATA[
|
||||
|
||||
test_valid_value("flood-opacity", "-1");
|
||||
test_valid_value("flood-opacity", "0.5");
|
||||
test_valid_value("flood-opacity", "3");
|
||||
test_valid_value("flood-opacity", "-100%", "-1");
|
||||
test_valid_value("flood-opacity", "50%", "0.5");
|
||||
test_valid_value("flood-opacity", "300%", "3");
|
||||
test_valid_value("flood-opacity", "calc(0.5 * sign(10em - 1px))");
|
||||
|
||||
]]></script>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
Reference in New Issue
Block a user