Skip to content

Truly independent web browser

LibWeb: Import percentage calculation context coverage

Andreas Kling8b6333b63ce4
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-values/percentage-without-context.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-values/percentage-without-context.txt
new file mode 100644
index 00000000000..ef52045860a
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-values/percentage-without-context.txt
@@ -0,0 +1,17 @@
+Harness status: OK
+
+Found 12 tests
+
+12 Fail
+Fail e.style['font-style'] = "oblique calc(sign(50%) * 1deg)" should not set the property value
+Fail e.style['background'] = "linear-gradient(calc(sign(50%) * 1turn), #3f87a6, #ebf8e1, #f69d3c)" should not set the property value
+Fail e.style['background'] = "conic-gradient(from calc(sign(50%) * 1rad) at 10% 50%, #e66465, #9198e5)" should not set the property value
+Fail e.style['filter'] = "hue-rotate(calc(sign(50%) * 1deg))" should not set the property value
+Fail e.style['offset-rotate'] = "calc(sign(50%) * 1deg)" should not set the property value
+Fail e.style['offset-path'] = "ray(calc(sign(50%) * 1deg))" should not set the property value
+Fail e.style['color'] = "hsl(calc(sign(50%) * 1deg) 82% 43%)" should not set the property value
+Fail e.style['transform'] = "rotate(calc(sign(50%) * 1deg))" should not set the property value
+Fail e.style['animation-duration'] = "calc(sign(50%) * 1s)" should not set the property value
+Fail e.style['animation-delay'] = "calc(sign(50%) * 1s)" should not set the property value
+Fail e.style['transition-duration'] = "calc(sign(50%) * 1s)" should not set the property value
+Fail e.style['transition-delay'] = "calc(sign(50%) * 1s)" should not set the property value
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-values/percentage-without-context.html b/Tests/LibWeb/Text/input/wpt-import/css/css-values/percentage-without-context.html
new file mode 100644
index 00000000000..22e2db2114e
--- /dev/null
+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-values/percentage-without-context.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<title>CSS Values: percentages without calculation context</title>
+<link rel="help" href="https://drafts.csswg.org/css-values-4/#calc-context">
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../../css/support/parsing-testcommon.js"></script>
+<div id="target"></div>
+<script>
+test_invalid_value("font-style", "oblique calc(sign(50%) * 1deg)");
+test_invalid_value("background", "linear-gradient(calc(sign(50%) * 1turn), #3f87a6, #ebf8e1, #f69d3c)");
+test_invalid_value("background", "conic-gradient(from calc(sign(50%) * 1rad) at 10% 50%, #e66465, #9198e5)");
+test_invalid_value("filter", "hue-rotate(calc(sign(50%) * 1deg))");
+test_invalid_value("offset-rotate", "calc(sign(50%) * 1deg)");
+test_invalid_value("offset-path", "ray(calc(sign(50%) * 1deg))");
+test_invalid_value("color", "hsl(calc(sign(50%) * 1deg) 82% 43%)");
+test_invalid_value("transform", "rotate(calc(sign(50%) * 1deg))");
+test_invalid_value("animation-duration", "calc(sign(50%) * 1s)");
+test_invalid_value("animation-delay", "calc(sign(50%) * 1s)");
+test_invalid_value("transition-duration", "calc(sign(50%) * 1s)");
+test_invalid_value("transition-delay", "calc(sign(50%) * 1s)");
+</script>