Commit 9f9c66c9 authored by Eric Willigers's avatar Eric Willigers Committed by Commit Bot

CSS: Parsing tests for flood-color

flood-color accepts <<color>> values.
https://drafts.fxtf.org/filter-effects/#propdef-flood-color

The computed flood-color value for rgb() and rgba() is as specified.
The computed flood-color value for color keywords, hex values
and 'transparent' is an rgb() or rgba() function.
https://drafts.csswg.org/css-color-3/#foreground

Change-Id: Iae210734d3829964ad64ae4a7ba7899c391b1898
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1619518
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Auto-Submit: Eric Willigers <ericwilligers@chromium.org>
Reviewed-by: default avatarRune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#661305}
parent 08a376d9
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Filter Effects Module Level 1: getComputedValue().floodColor</title>
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#FloodColorProperty">
<meta name="assert" content="flood-color 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>
<style>
#target {
color: lime;
}
</style>
</head>
<body>
<div id="target"></div>
<script>
test_computed_value("flood-color", "currentcolor", "rgb(0, 255, 0)");
test_computed_value("flood-color", "red", "rgb(255, 0, 0)");
test_computed_value("flood-color", "#00FF00", "rgb(0, 255, 0)");
test_computed_value("flood-color", "rgb(0, 0, 255)");
test_computed_value("flood-color", "rgb(100%, 100%, 0%)", "rgb(255, 255, 0)");
test_computed_value("flood-color", "hsl(120, 100%, 50%)", "rgb(0, 255, 0)");
test_computed_value("flood-color", "teal", "rgb(0, 128, 128)");
test_computed_value("flood-color", "transparent", "rgba(0, 0, 0, 0)");
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Filter Effects Module Level 1: parsing flood-color with invalid values</title>
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#FloodColorProperty">
<meta name="assert" content="flood-color supports only the grammar '<color>'.">
<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("flood-color", "none");
test_invalid_value("flood-color", "black white");
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Filter Effects Module Level 1: parsing flood-color with valid values</title>
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#FloodColorProperty">
<meta name="assert" content="flood-color supports the full grammar '<color>'.">
<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("flood-color", "currentcolor");
test_valid_value("flood-color", "red");
test_valid_value("flood-color", "#00FF00", "rgb(0, 255, 0)");
test_valid_value("flood-color", "rgb(0, 0, 255)");
test_valid_value("flood-color", "rgb(100%, 100%, 0%)", "rgb(255, 255, 0)");
test_valid_value("flood-color", "hsl(120, 100%, 50%)", "rgb(0, 255, 0)");
test_valid_value("flood-color", "teal");
test_valid_value("flood-color", "transparent");
</script>
</body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment