mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Update web-platform-tests to revision 10168e9a5d44efbc6e7d416d1d454eb9c9f1396c
This commit is contained in:
parent
c88dc51d03
commit
0e1caebaf4
791 changed files with 23381 additions and 5501 deletions
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Transform Module Level 2: parsing perspective-origin with invalid values</title>
|
||||
<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-transforms-2/#perspective-origin-property">
|
||||
<meta name="assert" content="perspective-origin supports only the '<position>' grammar.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="resources/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test_invalid_value("perspective-origin", "auto");
|
||||
test_invalid_value("perspective-origin", "1px 2px 3px");
|
||||
test_invalid_value("perspective-origin", "left right");
|
||||
test_invalid_value("perspective-origin", "bottom 10% top 20%");
|
||||
|
||||
// The following were supported in an earlier version of the spec.
|
||||
// https://github.com/w3c/csswg-drafts/issues/2140
|
||||
// Deprecated in Blink with support to be removed in M68, around July 2018.
|
||||
test_invalid_value("perspective-origin", "center left 1px");
|
||||
test_invalid_value("perspective-origin", "center top 2px");
|
||||
test_invalid_value("perspective-origin", "right 3% center");
|
||||
test_invalid_value("perspective-origin", "left 4px top");
|
||||
test_invalid_value("perspective-origin", "right top 5px");
|
||||
test_invalid_value("perspective-origin", "bottom 6% center");
|
||||
test_invalid_value("perspective-origin", "bottom 7% left");
|
||||
test_invalid_value("perspective-origin", "bottom right 8%");
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Transform Module Level 2: parsing perspective-origin with valid values</title>
|
||||
<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-transforms-2/#perspective-origin-property">
|
||||
<meta name="assert" content="perspective-origin supports the full '<position>' grammar.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="resources/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
// Blink and WebKit append center. Edge and Firefox append 50%
|
||||
test_valid_value("perspective-origin", "10%", ["10% center", "10% 50%"]);
|
||||
test_valid_value("perspective-origin", "20% 30px");
|
||||
test_valid_value("perspective-origin", "30px center");
|
||||
test_valid_value("perspective-origin", "40px top");
|
||||
test_valid_value("perspective-origin", "bottom 10% right 20%", "right 20% bottom 10%");
|
||||
test_valid_value("perspective-origin", "bottom right", "right bottom");
|
||||
test_valid_value("perspective-origin", "center", ["center center", "center 50%"]);
|
||||
test_valid_value("perspective-origin", "center 50px");
|
||||
test_valid_value("perspective-origin", "center bottom");
|
||||
test_valid_value("perspective-origin", "center center");
|
||||
test_valid_value("perspective-origin", "center left", "left center");
|
||||
test_valid_value("perspective-origin", "left", ["left center", "left 50%"]);
|
||||
test_valid_value("perspective-origin", "left bottom");
|
||||
test_valid_value("perspective-origin", "left center");
|
||||
test_valid_value("perspective-origin", "right 40%");
|
||||
test_valid_value("perspective-origin", "right 30% top 60px");
|
||||
test_valid_value("perspective-origin", "top", ["center top", "50% top"]);
|
||||
test_valid_value("perspective-origin", "top center", "center top");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,5 +1,8 @@
|
|||
'use strict';
|
||||
|
||||
// serializedValue can be the expected serialization of value,
|
||||
// or an array of permitted serializations,
|
||||
// or omitted if value should serialize as value.
|
||||
function test_valid_value(property, value, serializedValue) {
|
||||
if (arguments.length < 3)
|
||||
serializedValue = value;
|
||||
|
@ -9,17 +12,20 @@ function test_valid_value(property, value, serializedValue) {
|
|||
test(function(){
|
||||
var div = document.createElement('div');
|
||||
div.style[property] = value;
|
||||
assert_not_equals(div.style[property], "");
|
||||
}, "e.style['" + property + "'] = " + stringifiedValue + " should set the property value");
|
||||
assert_not_equals(div.style[property], "", "property should be set");
|
||||
|
||||
test(function(){
|
||||
var div = document.createElement('div');
|
||||
div.style[property] = value;
|
||||
var readValue = div.style[property];
|
||||
assert_equals(readValue, serializedValue);
|
||||
if (serializedValue instanceof Array)
|
||||
assert_true(serializedValue.includes(readValue), "serialization should be sound");
|
||||
else
|
||||
assert_equals(readValue, serializedValue, "serialization should be canonical");
|
||||
|
||||
div.style[property] = readValue;
|
||||
assert_equals(div.style[property], readValue);
|
||||
}, "Serialization should round-trip after setting e.style['" + property + "'] = " + stringifiedValue);
|
||||
assert_equals(div.style[property], readValue, "serialization should round-trip");
|
||||
|
||||
}, "e.style['" + property + "'] = " + stringifiedValue + " should set the property value");
|
||||
}
|
||||
|
||||
function test_invalid_value(property, value) {
|
||||
|
|
|
@ -23,7 +23,7 @@ test_valid_value("translate", "100% 200px");
|
|||
test_valid_value("translate", "100px 200px 300px");
|
||||
test_valid_value("translate", "100% 200% 300px");
|
||||
|
||||
test_valid_value("translate", "calc(10px + 10%) calc(20px + 20%) calc(30px + 30em)");
|
||||
test_valid_value("translate", "calc(10% + 10px) calc(20% + 20px) calc(30em + 30px)");
|
||||
|
||||
test_valid_value("translate", "0", "0px");
|
||||
test_valid_value("translate", "1px 2px 0", "1px 2px 0px");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue