Bug 1504389 [wpt PR 13871] - [filter-effects] Parsing of backdrop-filter, a=testonly

Automatic update from web-platform-tests[filter-effects] Parsing of backdrop-filter (#13871)

Test parsing, serialization and computed value for backdrop-filter
https://drafts.fxtf.org/filter-effects-2/#BackdropFilterProperty
--

wpt-commits: 208508bfdb7a8a9692394488bec2237102e16962
wpt-pr: 13871
This commit is contained in:
Eric Willigers 2018-11-13 11:54:07 +00:00 коммит произвёл moz-wptsync-bot
Родитель 9381e5825c
Коммит 084f810cd4
3 изменённых файлов: 183 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,62 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Filter Effects Module Level 2: getComputedValue().backdropFilter</title>
<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org">
<link rel="help" href="https://drafts.fxtf.org/filter-effects-2/#BackdropFilterProperty">
<meta name="assert" content="backdrop-filter supports omitted arguments'.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/computed-testcommon.js"></script>
</head>
<body>
<style>
#target {
color: lime;
}
</style>
<div id="target"></div>
<script>
test_computed_value("backdrop-filter", "none");
test_computed_value("backdrop-filter", "blur(100px)");
test_computed_value("backdrop-filter", "blur()", "blur(0px)");
test_computed_value("backdrop-filter", "brightness(0)");
test_computed_value("backdrop-filter", "brightness(300%)", "brightness(3)");
test_computed_value("backdrop-filter", "brightness()", "brightness(0)");
test_computed_value("backdrop-filter", "contrast(0)");
test_computed_value("backdrop-filter", "contrast(300%)", "contrast(3)");
test_computed_value("backdrop-filter", "contrast()", "contrast(1)");
test_computed_value("backdrop-filter", "drop-shadow(1px 2px)", "drop-shadow(rgb(0, 255, 0) 1px 2px 0px)");
test_computed_value("backdrop-filter", "drop-shadow(rgb(4, 5, 6) 1px 2px 0px)");
test_computed_value("backdrop-filter", "grayscale(50%)", "grayscale(0.5)");
test_computed_value("backdrop-filter", "grayscale()", "grayscale(1)");
test_computed_value("backdrop-filter", "hue-rotate(90deg)");
test_computed_value("backdrop-filter", "hue-rotate()", "hue-rotate(0deg)");
test_computed_value("backdrop-filter", "invert(0)");
test_computed_value("backdrop-filter", "invert(100%)", "invert(1)");
test_computed_value("backdrop-filter", "invert()", "invert(0)");
test_computed_value("backdrop-filter", "opacity(0)");
test_computed_value("backdrop-filter", "opacity(100%)", "opacity(1)");
test_computed_value("backdrop-filter", "opacity()", "opacity(1)");
test_computed_value("backdrop-filter", "saturate(0)");
test_computed_value("backdrop-filter", "saturate(300%)", "saturate(3)");
test_computed_value("backdrop-filter", "saturate()", "saturate(1)");
test_computed_value("backdrop-filter", "sepia(0)");
test_computed_value("backdrop-filter", "sepia(100%)", "sepia(1)");
test_computed_value("backdrop-filter", "sepia()", "sepia(1)");
test_computed_value("backdrop-filter", 'blur(10px) url("https://www.example.com/picture.svg#f") contrast(20) brightness(30)');
</script>
</body>
</html>

Просмотреть файл

@ -0,0 +1,54 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Filter Effects Module Level 2: parsing backdrop-filter with invalid values</title>
<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org">
<link rel="help" href="https://drafts.fxtf.org/filter-effects-2/#BackdropFilterProperty">
<meta name="assert" content="backdrop-filter supports only the grammar 'none | <backdrop-filter-function-list>'.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
</head>
<body>
<script>
// Edge fails: expected "" but got "none"
test_invalid_value("backdrop-filter", "auto");
test_invalid_value("backdrop-filter", "none hue-rotate(0deg)");
test_invalid_value("backdrop-filter", "blur(10)");
test_invalid_value("backdrop-filter", "blur(-100px)");
test_invalid_value("backdrop-filter", "brightness(-20)");
test_invalid_value("backdrop-filter", "brightness(30px)");
test_invalid_value("backdrop-filter", "contrast(-20)");
test_invalid_value("backdrop-filter", "contrast(30px)");
test_invalid_value("backdrop-filter", "drop-shadow(10 20)");
test_invalid_value("backdrop-filter", "drop-shadow(10% 20%)");
test_invalid_value("backdrop-filter", "drop-shadow(1px)");
test_invalid_value("backdrop-filter", "drop-shadow(1px 2px 3px 4px)");
test_invalid_value("backdrop-filter", "drop-shadow(rgb(4, 5, 6))");
test_invalid_value("backdrop-filter", "drop-shadow()");
test_invalid_value("backdrop-filter", "grayscale(-20)");
test_invalid_value("backdrop-filter", "grayscale(30px)");
test_invalid_value("backdrop-filter", "hue-rotate(90)");
test_invalid_value("backdrop-filter", "invert(-20)");
test_invalid_value("backdrop-filter", "invert(30px)");
test_invalid_value("backdrop-filter", "opacity(-20)");
test_invalid_value("backdrop-filter", "opacity(30px)");
test_invalid_value("backdrop-filter", "saturate(-20)");
test_invalid_value("backdrop-filter", "saturate(30px)");
test_invalid_value("backdrop-filter", "sepia(-20)");
test_invalid_value("backdrop-filter", "sepia(30px)");
</script>
</body>
</html>

Просмотреть файл

@ -0,0 +1,67 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Filter Effects Module Level 2: parsing backdrop-filter with valid values</title>
<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org">
<link rel="help" href="https://drafts.fxtf.org/filter-effects-2/#BackdropFilterProperty">
<meta name="assert" content="backdrop-filter supports the full grammar 'none | <backdrop-filter-function-list>'.">
<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("backdrop-filter", "none");
test_valid_value("backdrop-filter", "blur(100px)");
test_valid_value("backdrop-filter", "blur(0)", "blur(0px)");
test_valid_value("backdrop-filter", "blur()");
test_valid_value("backdrop-filter", "brightness(0)");
test_valid_value("backdrop-filter", "brightness(300%)");
test_valid_value("backdrop-filter", "brightness()");
test_valid_value("backdrop-filter", "contrast(0)");
test_valid_value("backdrop-filter", "contrast(300%)");
test_valid_value("backdrop-filter", "contrast()");
test_valid_value("backdrop-filter", "drop-shadow(1px 2px)");
test_valid_value("backdrop-filter", "drop-shadow(1px 2px 3px)");
test_valid_value("backdrop-filter", "drop-shadow(0 0 0)", "drop-shadow(0px 0px 0px)");
test_valid_value("backdrop-filter", "drop-shadow(rgb(4, 5, 6) 1px 2px)");
test_valid_value("backdrop-filter", "drop-shadow(1px 2px rgb(4, 5, 6))", "drop-shadow(rgb(4, 5, 6) 1px 2px)");
test_valid_value("backdrop-filter", "drop-shadow(rgba(4, 5, 6, 0.75) 1px 2px 3px)");
test_valid_value("backdrop-filter", "grayscale(0)");
test_valid_value("backdrop-filter", "grayscale(300%)", "grayscale(100%)");
test_valid_value("backdrop-filter", "grayscale()");
test_valid_value("backdrop-filter", "hue-rotate(90deg)");
test_valid_value("backdrop-filter", "hue-rotate(0)", "hue-rotate(0deg)");
test_valid_value("backdrop-filter", "hue-rotate()");
test_valid_value("backdrop-filter", "invert(0)");
test_valid_value("backdrop-filter", "invert(300%)", "invert(100%)");
test_valid_value("backdrop-filter", "invert()");
test_valid_value("backdrop-filter", "opacity(0)");
test_valid_value("backdrop-filter", "opacity(300%)", "opacity(100%)");
test_valid_value("backdrop-filter", "opacity()");
test_valid_value("backdrop-filter", "saturate(0)");
test_valid_value("backdrop-filter", "saturate(300%)");
test_valid_value("backdrop-filter", "saturate()");
test_valid_value("backdrop-filter", "sepia(0)");
test_valid_value("backdrop-filter", "sepia(300%)", "sepia(100%)");
test_valid_value("backdrop-filter", "sepia()");
test_valid_value("backdrop-filter", 'url("picture.svg#f")');
test_valid_value("backdrop-filter", 'url("https://www.example.com/picture.svg#f")');
test_valid_value("backdrop-filter", 'blur(10px) url("picture.svg#f") contrast(20) brightness(30)');
</script>
</body>
</html>