summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-properties-values-api
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/css/css-properties-values-api')
-rw-r--r--testing/web-platform/tests/css/css-properties-values-api/crashtests/computed-property-universal-syntax.html20
-rw-r--r--testing/web-platform/tests/css/css-properties-values-api/registered-property-computation.html8
2 files changed, 28 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-properties-values-api/crashtests/computed-property-universal-syntax.html b/testing/web-platform/tests/css/css-properties-values-api/crashtests/computed-property-universal-syntax.html
new file mode 100644
index 0000000000..b87f03b2df
--- /dev/null
+++ b/testing/web-platform/tests/css/css-properties-values-api/crashtests/computed-property-universal-syntax.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<meta charset=utf8>
+<style>
+@property --my-registered-property {
+ syntax: "<color>";
+ inherits: false;
+ initial-value: #f0f2f5;
+}
+
+.outer {
+ --unregistered-property: var(--my-registered-property);
+}
+
+.inner {
+ --unregistered-property: #c6cfdb;
+}
+</style>
+<div class="outer">
+ <div class="inner"></div>
+</div>
diff --git a/testing/web-platform/tests/css/css-properties-values-api/registered-property-computation.html b/testing/web-platform/tests/css/css-properties-values-api/registered-property-computation.html
index f4c718b139..8ca9d4499a 100644
--- a/testing/web-platform/tests/css/css-properties-values-api/registered-property-computation.html
+++ b/testing/web-platform/tests/css/css-properties-values-api/registered-property-computation.html
@@ -155,6 +155,14 @@ test_computed_value('<color>', '#badbee33', 'rgba(186, 219, 238, 0.2)');
test_computed_value('<color>', 'tomato', 'rgb(255, 99, 71)');
test_computed_value('<color>', 'plum', 'rgb(221, 160, 221)');
test_computed_value('<color>', 'currentcolor', 'currentcolor');
+test_computed_value('<color>', 'color-mix(in srgb, black, white)', 'color(srgb 0.5 0.5 0.5)');
+test_computed_value('<color>', 'color-mix(in srgb, currentcolor, red)', 'color-mix(in srgb, currentcolor, rgb(255, 0, 0))');
+test_computed_value('<color>', 'color-mix(in srgb, currentcolor, #ffffff 70%)', 'color-mix(in srgb, currentcolor 30%, rgb(255, 255, 255))');
+test_computed_value('<color>', 'color-mix(in srgb, currentcolor 20%, #ffffff 20%)', 'color-mix(in srgb, currentcolor 20%, rgb(255, 255, 255) 20%)');
+test_computed_value('<color>', 'light-dark(currentcolor, red)', 'currentcolor');
+test_computed_value('<color>', 'light-dark(lime, red)', 'rgb(0, 255, 0)');
+test_computed_value('<color>', 'color(from lime srgb g g g)', 'color(srgb 1 1 1)');
+test_computed_value('<color>', 'color(srgb 1 1 1 / calc(NaN))', 'color(srgb 1 1 1 / 0)');
// Custom ident values that look like color keywords should not be converted.
test_computed_value('*', 'tomato', 'tomato');