mirror of
https://github.com/servo/servo.git
synced 2025-08-13 17:35:36 +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 + "'");
|
||||
}
|
|
@ -3,7 +3,7 @@ suggested_reviewers:
|
|||
- marcoscaceres
|
||||
- rsolomakhin
|
||||
- domenic
|
||||
- MSFTkihans
|
||||
- zouhir
|
||||
- mnoorenberghe
|
||||
- romandev
|
||||
- edenchuang
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
<!DOCTYPE html>
|
||||
<div>Expected: a solid green square.</div>
|
||||
<svg style="width: 200px; height: 200px; background: green;"></svg>
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<title>'mix-blend-mode' for <svg:pattern></title>
|
||||
<link rel="help" href="https://www.w3.org/TR/SVG2/render.html#PaintersModel">
|
||||
<link rel="help" href="https://github.com/w3c/fxtf-drafts/issues/309">
|
||||
<link rel="match" href="filter-effects-on-pattern-ref.html">
|
||||
<div>Expected: a solid green square.</div>
|
||||
<svg style="width: 200px; height: 200px; background: green;">
|
||||
<defs>
|
||||
<pattern id="pattern" x="0" y="0" width=".25" height=".25" style="mix-blend-mode: difference;">
|
||||
<rect x="0" y="0" width="25" height="25" fill="green"/>
|
||||
</pattern>
|
||||
</defs>
|
||||
<rect fill="url(#pattern)" width="200" height="200"/>
|
||||
</svg>
|
|
@ -0,0 +1,3 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">
|
||||
</svg>
|
After Width: | Height: | Size: 112 B |
9
tests/wpt/web-platform-tests/svg/shapes/circle-01.svg
Normal file
9
tests/wpt/web-platform-tests/svg/shapes/circle-01.svg
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">
|
||||
<metadata>
|
||||
<link xmlns="http://www.w3.org/1999/xhtml" rel="help" href="https://www.w3.org/TR/SVG2/shapes.html#CircleElement"/>
|
||||
<link xmlns="http://www.w3.org/1999/xhtml" rel="match" href="circle-01-ref.svg"/>
|
||||
<meta xmlns="http://www.w3.org/1999/xhtml" name="assert" content="r 0 disables rendering."/>
|
||||
</metadata>
|
||||
<circle cx="50" cy="50" r="0" fill="red" stroke="red" stroke-width="5"/>
|
||||
</svg>
|
After Width: | Height: | Size: 517 B |
11
tests/wpt/web-platform-tests/svg/shapes/ellipse-09.svg
Normal file
11
tests/wpt/web-platform-tests/svg/shapes/ellipse-09.svg
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">
|
||||
<metadata>
|
||||
<link xmlns="http://www.w3.org/1999/xhtml" rel="help" href="https://www.w3.org/TR/SVG2/shapes.html#EllipseElement"/>
|
||||
<link xmlns="http://www.w3.org/1999/xhtml" rel="match" href="ellipse-04-ref.svg"/>
|
||||
<meta xmlns="http://www.w3.org/1999/xhtml" name="assert" content="rx or ry 0 disables rendering."/>
|
||||
</metadata>
|
||||
<ellipse cx="30" cy="50" rx="0" ry="10" fill="red" stroke="red" stroke-width="5"/>
|
||||
<ellipse cx="50" cy="50" rx="10" ry="0" fill="red" stroke="red" stroke-width="5"/>
|
||||
<ellipse cx="70" cy="50" rx="0" ry="0" fill="red" stroke="red" stroke-width="5"/>
|
||||
</svg>
|
After Width: | Height: | Size: 705 B |
3
tests/wpt/web-platform-tests/svg/shapes/rect-05-ref.svg
Normal file
3
tests/wpt/web-platform-tests/svg/shapes/rect-05-ref.svg
Normal file
|
@ -0,0 +1,3 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">
|
||||
</svg>
|
After Width: | Height: | Size: 112 B |
11
tests/wpt/web-platform-tests/svg/shapes/rect-05.svg
Normal file
11
tests/wpt/web-platform-tests/svg/shapes/rect-05.svg
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">
|
||||
<metadata>
|
||||
<link xmlns="http://www.w3.org/1999/xhtml" rel="help" href="http://www.w3.org/TR/SVG2/shapes.html#RectElement"/>
|
||||
<link xmlns="http://www.w3.org/1999/xhtml" rel="match" href="rect-05-ref.svg"/>
|
||||
<meta xmlns="http://www.w3.org/1999/xhtml" name="assert" content="width or height 0 disables rendering."/>
|
||||
</metadata>
|
||||
<rect x="30" y="50" width="0" height="10" fill="red" stroke="red" stroke-width="4"/>
|
||||
<rect x="50" y="50" width="10" height="0" fill="red" stroke="red" stroke-width="4"/>
|
||||
<rect x="70" y="50" width="0" height="0" fill="red" stroke="red" stroke-width="4"/>
|
||||
</svg>
|
After Width: | Height: | Size: 711 B |
Loading…
Add table
Add a link
Reference in a new issue