mirror of
https://github.com/servo/servo.git
synced 2025-08-28 08:38:20 +01:00
Update web-platform-tests to revision 2e7a549d07c54cbdb9002634bf5a4cc6ce8f9acb
This commit is contained in:
parent
e5da0ebd1d
commit
0371218e22
33 changed files with 694 additions and 146 deletions
|
@ -0,0 +1,62 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Filter Effects Module Level 1: getComputedValue().filter</title>
|
||||
<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org">
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#FilterProperty">
|
||||
<meta name="assert" content="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("filter", "none");
|
||||
|
||||
test_computed_value("filter", "blur(100px)");
|
||||
test_computed_value("filter", "blur()", "blur(0px)");
|
||||
|
||||
test_computed_value("filter", "brightness(0)");
|
||||
test_computed_value("filter", "brightness(300%)", "brightness(3)");
|
||||
test_computed_value("filter", "brightness()", "brightness(0)");
|
||||
|
||||
test_computed_value("filter", "contrast(0)");
|
||||
test_computed_value("filter", "contrast(300%)", "contrast(3)");
|
||||
test_computed_value("filter", "contrast()", "contrast(1)");
|
||||
|
||||
test_computed_value("filter", "drop-shadow(1px 2px)", "drop-shadow(rgb(0, 255, 0) 1px 2px 0px)");
|
||||
test_computed_value("filter", "drop-shadow(rgb(4, 5, 6) 1px 2px 0px)");
|
||||
|
||||
test_computed_value("filter", "grayscale(50%)", "grayscale(0.5)");
|
||||
test_computed_value("filter", "grayscale()", "grayscale(1)");
|
||||
|
||||
test_computed_value("filter", "hue-rotate(90deg)");
|
||||
test_computed_value("filter", "hue-rotate()", "hue-rotate(0deg)");
|
||||
|
||||
test_computed_value("filter", "invert(0)");
|
||||
test_computed_value("filter", "invert(100%)", "invert(1)");
|
||||
test_computed_value("filter", "invert()", "invert(0)");
|
||||
|
||||
test_computed_value("filter", "opacity(0)");
|
||||
test_computed_value("filter", "opacity(100%)", "opacity(1)");
|
||||
test_computed_value("filter", "opacity()", "opacity(1)");
|
||||
|
||||
test_computed_value("filter", "saturate(0)");
|
||||
test_computed_value("filter", "saturate(300%)", "saturate(3)");
|
||||
test_computed_value("filter", "saturate()", "saturate(1)");
|
||||
|
||||
test_computed_value("filter", "sepia(0)");
|
||||
test_computed_value("filter", "sepia(100%)", "sepia(1)");
|
||||
test_computed_value("filter", "sepia()", "sepia(1)");
|
||||
|
||||
test_computed_value("filter", 'blur(10px) url("https://www.example.com/picture.svg#f") contrast(20) brightness(30)');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -19,15 +19,12 @@ test_invalid_value("filter", "none hue-rotate(0deg)");
|
|||
|
||||
test_invalid_value("filter", "blur(10)");
|
||||
test_invalid_value("filter", "blur(-100px)");
|
||||
test_invalid_value("filter", "blur()"); // crbug.com/618960 Blink/WebKit accept no arguments for all but drop-shadow.
|
||||
|
||||
test_invalid_value("filter", "brightness(-20)"); // crbug.com/776208 Blink/WebKit accept negative brightness.
|
||||
test_invalid_value("filter", "brightness(30px)");
|
||||
test_invalid_value("filter", "brightness()");
|
||||
|
||||
test_invalid_value("filter", "contrast(-20)");
|
||||
test_invalid_value("filter", "contrast(30px)");
|
||||
test_invalid_value("filter", "contrast()");
|
||||
|
||||
test_invalid_value("filter", "drop-shadow(10 20)");
|
||||
test_invalid_value("filter", "drop-shadow(10% 20%)");
|
||||
|
@ -38,26 +35,20 @@ test_invalid_value("filter", "drop-shadow()");
|
|||
|
||||
test_invalid_value("filter", "grayscale(-20)");
|
||||
test_invalid_value("filter", "grayscale(30px)");
|
||||
test_invalid_value("filter", "grayscale()");
|
||||
|
||||
test_invalid_value("filter", "hue-rotate(90)");
|
||||
test_invalid_value("filter", "hue-rotate()");
|
||||
|
||||
test_invalid_value("filter", "invert(-20)");
|
||||
test_invalid_value("filter", "invert(30px)");
|
||||
test_invalid_value("filter", "invert()");
|
||||
|
||||
test_invalid_value("filter", "opacity(-20)");
|
||||
test_invalid_value("filter", "opacity(30px)");
|
||||
test_invalid_value("filter", "opacity()");
|
||||
|
||||
test_invalid_value("filter", "saturate(-20)");
|
||||
test_invalid_value("filter", "saturate(30px)");
|
||||
test_invalid_value("filter", "saturate()");
|
||||
|
||||
test_invalid_value("filter", "sepia(-20)");
|
||||
test_invalid_value("filter", "sepia(30px)");
|
||||
test_invalid_value("filter", "sepia()");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -16,12 +16,15 @@ test_valid_value("filter", "none");
|
|||
|
||||
test_valid_value("filter", "blur(100px)");
|
||||
test_valid_value("filter", "blur(0)", "blur(0px)");
|
||||
test_valid_value("filter", "blur()");
|
||||
|
||||
test_valid_value("filter", "brightness(0)");
|
||||
test_valid_value("filter", "brightness(300%)");
|
||||
test_valid_value("filter", "brightness()");
|
||||
|
||||
test_valid_value("filter", "contrast(0)");
|
||||
test_valid_value("filter", "contrast(300%)");
|
||||
test_valid_value("filter", "contrast()");
|
||||
|
||||
test_valid_value("filter", "drop-shadow(1px 2px)");
|
||||
test_valid_value("filter", "drop-shadow(1px 2px 3px)");
|
||||
|
@ -33,21 +36,27 @@ test_valid_value("filter", "drop-shadow(rgba(4, 5, 6, 0.75) 1px 2px 3px)");
|
|||
|
||||
test_valid_value("filter", "grayscale(0)");
|
||||
test_valid_value("filter", "grayscale(300%)", "grayscale(100%)");
|
||||
test_valid_value("filter", "grayscale()");
|
||||
|
||||
test_valid_value("filter", "hue-rotate(90deg)");
|
||||
test_valid_value("filter", "hue-rotate(0)", "hue-rotate(0deg)"); // https://github.com/w3c/fxtf-drafts/issues/228
|
||||
test_valid_value("filter", "hue-rotate()");
|
||||
|
||||
test_valid_value("filter", "invert(0)");
|
||||
test_valid_value("filter", "invert(300%)", "invert(100%)");
|
||||
test_valid_value("filter", "invert()");
|
||||
|
||||
test_valid_value("filter", "opacity(0)");
|
||||
test_valid_value("filter", "opacity(300%)", "opacity(100%)");
|
||||
test_valid_value("filter", "opacity()");
|
||||
|
||||
test_valid_value("filter", "saturate(0)");
|
||||
test_valid_value("filter", "saturate(300%)");
|
||||
test_valid_value("filter", "saturate()");
|
||||
|
||||
test_valid_value("filter", "sepia(0)");
|
||||
test_valid_value("filter", "sepia(300%)", "sepia(100%)");
|
||||
test_valid_value("filter", "sepia()");
|
||||
|
||||
// Edge serializes url(...) without quotes. Blink/WebKit and Firefox use quotes.
|
||||
test_valid_value("filter", "url(picture.svg#f)", ['url("picture.svg#f")', 'url(picture.svg#f)']);
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
'use strict';
|
||||
|
||||
/**
|
||||
* Create test that a CSS property computes to the expected value.
|
||||
* The document element #target is used to perform the test.
|
||||
*
|
||||
* @param {string} property The name of the CSS property being tested.
|
||||
* @param {string} specified A specified value for the property.
|
||||
* @param {string} computed The expected computed value. If omitted,
|
||||
defaults to specified.
|
||||
*/
|
||||
function test_computed_value(property, specified, computed) {
|
||||
if (!computed)
|
||||
computed = specified;
|
||||
test(() => {
|
||||
if (!getComputedStyle(target)[property])
|
||||
return;
|
||||
target.style[property] = '';
|
||||
target.style[property] = specified;
|
||||
assert_equals(getComputedStyle(target)[property], computed);
|
||||
}, "Property " + property + " value '" + specified + "' computes to '" + computed + "'");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue