diff options
Diffstat (limited to 'testing/web-platform/tests/css/compositing/parsing')
10 files changed, 296 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/compositing/parsing/background-blend-mode-computed-multiple.html b/testing/web-platform/tests/css/compositing/parsing/background-blend-mode-computed-multiple.html new file mode 100644 index 0000000000..0e582310c3 --- /dev/null +++ b/testing/web-platform/tests/css/compositing/parsing/background-blend-mode-computed-multiple.html @@ -0,0 +1,49 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>Compositing and Blending Level 1: getComputedStyle().backgroundBlendMode</title> +<link rel="help" href="https://drafts.fxtf.org/compositing-1/#propdef-background-blend-mode"> +<meta name="assert" content="background-blend-mode computed value is as specified even when the number of images vary."> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/computed-testcommon.js"></script> +<style> + #target { + background-image: linear-gradient(green, green), linear-gradient(green, green), linear-gradient(green, green); + } +</style> +</head> +<body> +<div id="target"></div> +<script> +// This is testing the case with multiple background images +// +// see https://drafts.fxtf.org/compositing-1/#background-blend-mode +// and https://drafts.csswg.org/css-backgrounds-3/#layering +// > The lists are matched up from the first value: excess values at the end are not used. +// and +// > If a property doesn’t have enough comma-separated values +// > to match the number of layers, the UA must calculate its used value +// > by repeating the list of values until there are enough. +// but in https://drafts.csswg.org/css-values-4/#linked-properties +// it was decided that +// > The computed values of the coordinating list properties are not affected by such truncation or repetition. +// +// There is a distinction between specified values, used values, and computed values. + +// if three images and one value, just send back the specified list. +test_computed_value("background-blend-mode", "normal"); +test_computed_value("background-blend-mode", "multiply"); + +// if three images and two values, just send back the specified list. +test_computed_value("background-blend-mode", "normal, luminosity"); +test_computed_value("background-blend-mode", "screen, overlay"); +test_computed_value("background-blend-mode", "color, saturation"); + +// if three images and three values, just send back the specified list. +test_computed_value("background-blend-mode", "normal, luminosity, color"); +test_computed_value("background-blend-mode", "screen, overlay, screen"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/compositing/parsing/background-blend-mode-computed.html b/testing/web-platform/tests/css/compositing/parsing/background-blend-mode-computed.html new file mode 100644 index 0000000000..934159d8a6 --- /dev/null +++ b/testing/web-platform/tests/css/compositing/parsing/background-blend-mode-computed.html @@ -0,0 +1,48 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>Compositing and Blending Level 1: getComputedStyle().backgroundBlendMode</title> +<link rel="help" href="https://drafts.fxtf.org/compositing-1/#propdef-background-blend-mode"> +<meta name="assert" content="background-blend-mode computed value is as specified."> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/computed-testcommon.js"></script> +</head> +<body> +<div id="target"></div> +<script> +test_computed_value("background-blend-mode", "normal"); +test_computed_value("background-blend-mode", "multiply"); +test_computed_value("background-blend-mode", "screen"); +test_computed_value("background-blend-mode", "overlay"); +test_computed_value("background-blend-mode", "darken"); +test_computed_value("background-blend-mode", "lighten"); +test_computed_value("background-blend-mode", "color-dodge"); +test_computed_value("background-blend-mode", "color-burn"); +test_computed_value("background-blend-mode", "hard-light"); +test_computed_value("background-blend-mode", "soft-light"); +test_computed_value("background-blend-mode", "difference"); +test_computed_value("background-blend-mode", "exclusion"); +test_computed_value("background-blend-mode", "hue"); +test_computed_value("background-blend-mode", "saturation"); +test_computed_value("background-blend-mode", "color"); +test_computed_value("background-blend-mode", "luminosity"); + +// Per spec, excess values should not be used, +// BUT the computed style should be similar to the specified values. +// see https://drafts.fxtf.org/compositing-1/#background-blend-mode +// and https://drafts.csswg.org/css-backgrounds-3/#layering +// > The lists are matched up from the first value: excess values at the end are not used. +// but in https://drafts.csswg.org/css-values-4/#linked-properties +// it was decided that +// > The computed values of the coordinating list properties are not affected by such truncation or repetition. +// +// There is a distinction between specified values, used values, and computed values. + +test_computed_value("background-blend-mode", "normal, luminosity"); +test_computed_value("background-blend-mode", "screen, overlay"); +test_computed_value("background-blend-mode", "color, saturation"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/compositing/parsing/background-blend-mode-invalid.html b/testing/web-platform/tests/css/compositing/parsing/background-blend-mode-invalid.html new file mode 100644 index 0000000000..4fdd3d36ed --- /dev/null +++ b/testing/web-platform/tests/css/compositing/parsing/background-blend-mode-invalid.html @@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>Compositing and Blending Level 1: parsing background-blend-mode with invalid values</title> +<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> +<link rel="help" href="https://drafts.fxtf.org/compositing-1/#propdef-background-blend-mode"> +<meta name="assert" content="background-blend-mode supports only the grammar '<blend-mode>#'."> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/parsing-testcommon.js"></script> +</head> +<body> +<script> +test_invalid_value("background-blend-mode", "auto"); +test_invalid_value("background-blend-mode", "normal luminosity"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/compositing/parsing/background-blend-mode-valid.html b/testing/web-platform/tests/css/compositing/parsing/background-blend-mode-valid.html new file mode 100644 index 0000000000..151a01c75a --- /dev/null +++ b/testing/web-platform/tests/css/compositing/parsing/background-blend-mode-valid.html @@ -0,0 +1,35 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>Compositing and Blending Level 1: parsing background-blend-mode with valid values</title> +<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> +<link rel="help" href="https://drafts.fxtf.org/compositing-1/#propdef-background-blend-mode"> +<meta name="assert" content="background-blend-mode supports the full grammar '<blend-mode>#'."> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/parsing-testcommon.js"></script> +</head> +<body> +<script> +test_valid_value("background-blend-mode", "normal"); +test_valid_value("background-blend-mode", "multiply"); +test_valid_value("background-blend-mode", "screen"); +test_valid_value("background-blend-mode", "overlay"); +test_valid_value("background-blend-mode", "darken"); +test_valid_value("background-blend-mode", "lighten"); +test_valid_value("background-blend-mode", "color-dodge"); +test_valid_value("background-blend-mode", "color-burn"); +test_valid_value("background-blend-mode", "hard-light"); +test_valid_value("background-blend-mode", "soft-light"); +test_valid_value("background-blend-mode", "difference"); +test_valid_value("background-blend-mode", "exclusion"); +test_valid_value("background-blend-mode", "hue"); +test_valid_value("background-blend-mode", "saturation"); +test_valid_value("background-blend-mode", "color"); +test_valid_value("background-blend-mode", "luminosity"); + +test_valid_value("background-blend-mode", "normal, luminosity"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/compositing/parsing/isolation-computed.html b/testing/web-platform/tests/css/compositing/parsing/isolation-computed.html new file mode 100644 index 0000000000..2f7a6e7924 --- /dev/null +++ b/testing/web-platform/tests/css/compositing/parsing/isolation-computed.html @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>Compositing and Blending Level 1: getComputedStyle().isolation</title> +<link rel="help" href="https://drafts.fxtf.org/compositing-1/#propdef-isolation"> +<meta name="assert" content="isolation computed value is as specified."> + +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/computed-testcommon.js"></script> +</head> +<body> +<div id="target"></div> +<script> +test_computed_value("isolation", "auto"); +test_computed_value("isolation", "isolate"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/compositing/parsing/isolation-invalid.html b/testing/web-platform/tests/css/compositing/parsing/isolation-invalid.html new file mode 100644 index 0000000000..d5b8f49c61 --- /dev/null +++ b/testing/web-platform/tests/css/compositing/parsing/isolation-invalid.html @@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>Compositing and Blending Level 1: parsing isolation with invalid values</title> +<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> +<link rel="help" href="https://drafts.fxtf.org/compositing-1/#propdef-isolation"> +<meta name="assert" content="isolation supports only the grammar '<isolation-mode>'."> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/parsing-testcommon.js"></script> +</head> +<body> +<script> +test_invalid_value("isolation", "none"); +test_invalid_value("isolation", "auto isolate"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/compositing/parsing/isolation-valid.html b/testing/web-platform/tests/css/compositing/parsing/isolation-valid.html new file mode 100644 index 0000000000..252ff138e0 --- /dev/null +++ b/testing/web-platform/tests/css/compositing/parsing/isolation-valid.html @@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>Compositing and Blending Level 1: parsing isolation with valid values</title> +<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> +<link rel="help" href="https://drafts.fxtf.org/compositing-1/#propdef-isolation"> +<meta name="assert" content="isolation supports the full grammar '<isolation-mode>'."> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/parsing-testcommon.js"></script> +</head> +<body> +<script> +test_valid_value("isolation", "auto"); +test_valid_value("isolation", "isolate"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/compositing/parsing/mix-blend-mode-computed.html b/testing/web-platform/tests/css/compositing/parsing/mix-blend-mode-computed.html new file mode 100644 index 0000000000..38a2c86351 --- /dev/null +++ b/testing/web-platform/tests/css/compositing/parsing/mix-blend-mode-computed.html @@ -0,0 +1,34 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>Compositing and Blending Level 1: getComputedStyle().mixBlendMode</title> +<link rel="help" href="https://drafts.fxtf.org/compositing-1/#propdef-mix-blend-mode"> +<meta name="assert" content="mix-blend-mode computed value is as specified."> + +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/computed-testcommon.js"></script> +</head> +<body> +<div id="target"></div> +<script> +test_computed_value("mix-blend-mode", "normal"); +test_computed_value("mix-blend-mode", "multiply"); +test_computed_value("mix-blend-mode", "screen"); +test_computed_value("mix-blend-mode", "overlay"); +test_computed_value("mix-blend-mode", "darken"); +test_computed_value("mix-blend-mode", "lighten"); +test_computed_value("mix-blend-mode", "color-dodge"); +test_computed_value("mix-blend-mode", "color-burn"); +test_computed_value("mix-blend-mode", "hard-light"); +test_computed_value("mix-blend-mode", "soft-light"); +test_computed_value("mix-blend-mode", "difference"); +test_computed_value("mix-blend-mode", "exclusion"); +test_computed_value("mix-blend-mode", "hue"); +test_computed_value("mix-blend-mode", "saturation"); +test_computed_value("mix-blend-mode", "color"); +test_computed_value("mix-blend-mode", "luminosity"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/compositing/parsing/mix-blend-mode-invalid.html b/testing/web-platform/tests/css/compositing/parsing/mix-blend-mode-invalid.html new file mode 100644 index 0000000000..e73d28e585 --- /dev/null +++ b/testing/web-platform/tests/css/compositing/parsing/mix-blend-mode-invalid.html @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>Compositing and Blending Level 1: parsing mix-blend-mode with invalid values</title> +<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> +<link rel="help" href="https://drafts.fxtf.org/compositing-1/#propdef-mix-blend-mode"> +<meta name="assert" content="mix-blend-mode supports only the grammar '<blend-mode>'."> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/parsing-testcommon.js"></script> +</head> +<body> +<script> +test_invalid_value("mix-blend-mode", "auto"); +test_invalid_value("mix-blend-mode", "normal luminosity"); +test_invalid_value("mix-blend-mode", "normal, luminosity"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/compositing/parsing/mix-blend-mode-valid.html b/testing/web-platform/tests/css/compositing/parsing/mix-blend-mode-valid.html new file mode 100644 index 0000000000..c6393343df --- /dev/null +++ b/testing/web-platform/tests/css/compositing/parsing/mix-blend-mode-valid.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>Compositing and Blending Level 1: parsing mix-blend-mode with valid values</title> +<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> +<link rel="help" href="https://drafts.fxtf.org/compositing-1/#propdef-mix-blend-mode"> +<meta name="assert" content="mix-blend-mode supports the full grammar '<blend-mode>'."> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/parsing-testcommon.js"></script> +</head> +<body> +<script> +test_valid_value("mix-blend-mode", "normal"); +test_valid_value("mix-blend-mode", "multiply"); +test_valid_value("mix-blend-mode", "screen"); +test_valid_value("mix-blend-mode", "overlay"); +test_valid_value("mix-blend-mode", "darken"); +test_valid_value("mix-blend-mode", "lighten"); +test_valid_value("mix-blend-mode", "color-dodge"); +test_valid_value("mix-blend-mode", "color-burn"); +test_valid_value("mix-blend-mode", "hard-light"); +test_valid_value("mix-blend-mode", "soft-light"); +test_valid_value("mix-blend-mode", "difference"); +test_valid_value("mix-blend-mode", "exclusion"); +test_valid_value("mix-blend-mode", "hue"); +test_valid_value("mix-blend-mode", "saturation"); +test_valid_value("mix-blend-mode", "color"); +test_valid_value("mix-blend-mode", "luminosity"); +</script> +</body> +</html> |