diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/css/css-color/parsing/color-computed-hex-color.html | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/css-color/parsing/color-computed-hex-color.html')
-rw-r--r-- | testing/web-platform/tests/css/css-color/parsing/color-computed-hex-color.html | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-color/parsing/color-computed-hex-color.html b/testing/web-platform/tests/css/css-color/parsing/color-computed-hex-color.html new file mode 100644 index 0000000000..7485b34a1d --- /dev/null +++ b/testing/web-platform/tests/css/css-color/parsing/color-computed-hex-color.html @@ -0,0 +1,38 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Color Level 4: Computation of colors using hex color notation</title> +<link rel="help" href="https://drafts.csswg.org/css-color-4/#hex-notation"> +<link rel="help" href="https://drafts.csswg.org/css-color-4/#resolving-sRGB-values"> +<link rel="help" href="https://drafts.csswg.org/css-color-4/#serializing-sRGB-values"> +<link rel="author" title="Chris Nardi" href="mailto:cnardi@chromium.org"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/computed-testcommon.js"></script> +</head> +<body> +<div id="container"> + <div id="target"></div> +</div> +<style> + #container { + color: rgb(255, 0, 0); + } +</style> +<script> +tests = [ + ["#fff", "rgb(255, 255, 255)", "Valid 3-digit hex"], + ["#ffff", "rgb(255, 255, 255)", "Valid 4-digit hex"], + ["#ffffff", "rgb(255, 255, 255)", "Valid 6-digit hex"], + ["#ffffffff", "rgb(255, 255, 255)", "Valid 8-digit hex"], + ["#FFCc99", "rgb(255, 204, 153)", "Valid 6-digit hex"], + ["#369", "rgb(51, 102, 153)", "Valid 3-digit hex"], +]; + +for (const test of tests) { + test_computed_value("color", test[0], test[1], test[2] ? `[${test[2]}]` : undefined); +} +</script> +</body> +</html> |