mirror of
https://github.com/servo/servo.git
synced 2025-08-15 02:15:33 +01:00
Update web-platform-tests to revision 81962ac8802223d038b188b6f9cb88a0a9c5beee
This commit is contained in:
parent
fe1a057bd1
commit
24183668c4
1960 changed files with 29853 additions and 10555 deletions
|
@ -1,36 +1,25 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>CSS Backgrounds and Borders Test: background-clip Reference</title>
|
||||
<link rel="author" title="James Wang" href="mailto:wangjian@ucweb.com">
|
||||
<link rel="help" href="http://www.w3.org/TR/css3-background/#the-background-clip" />
|
||||
<meta name="flags" content="">
|
||||
<meta name="assert" content="background-clip with content-box means paint the background within the content box">
|
||||
|
||||
<link rel="match" href="reference/background-clip-content-box-ref.html">
|
||||
|
||||
<style type="text/css">
|
||||
* { padding: 0; margin: 0; }
|
||||
#test-color-blue {
|
||||
background-color: blue;
|
||||
height: 200px;
|
||||
position: absolute;
|
||||
width: 200px;
|
||||
}
|
||||
#test-color-green {
|
||||
background-clip: content-box;
|
||||
background-color: rgba(0, 255, 0, 1);
|
||||
height: 180px;
|
||||
padding: 10px;
|
||||
position: absolute;
|
||||
width: 180px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p>Test pass if the green box has a 10px width blue edge</p>
|
||||
<!-- background -->
|
||||
<div id="test-color-blue"></div>
|
||||
<div id="test-color-green"></div>
|
||||
</body>
|
||||
</html>
|
||||
<title>CSS Backgrounds and Borders Test: background-clip Reference</title>
|
||||
<link rel="author" title="James Wang" href="mailto:wangjian@ucweb.com">
|
||||
<link rel="help" href="https://www.w3.org/TR/css-backgrounds-3/#the-background-clip">
|
||||
<link rel="match" href="reference/background-clip-content-box-ref.html">
|
||||
<style>
|
||||
#test-color-blue {
|
||||
background-color: blue;
|
||||
height: 200px;
|
||||
position: absolute;
|
||||
width: 200px;
|
||||
}
|
||||
#test-color-orange {
|
||||
background-clip: content-box;
|
||||
background-color: rgba(255, 165, 0, 1);
|
||||
height: 180px;
|
||||
padding: 10px;
|
||||
position: absolute;
|
||||
width: 180px;
|
||||
}
|
||||
</style>
|
||||
<p>Test passes if the orange box has a 10px width blue edge.</p>
|
||||
<!-- background -->
|
||||
<div id="test-color-blue"></div>
|
||||
<div id="test-color-orange"></div>
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>Background Clip Follows Rounded Corner</title>
|
||||
<link rel="match" href="reference/background-rounded-image-clip.html">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-backgrounds-3/#corner-clipping">
|
||||
<style>
|
||||
html {
|
||||
background-color: green;
|
||||
}
|
||||
#a {
|
||||
top: 20px;
|
||||
left: 20px;
|
||||
position: absolute;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background-color: black;
|
||||
}
|
||||
|
||||
#b {
|
||||
position: absolute;
|
||||
width: 300px;
|
||||
height: 200px;
|
||||
background-image: linear-gradient(green, green);
|
||||
background-clip: content-box;
|
||||
border-top-left-radius: 90px;
|
||||
border-width: 10px;
|
||||
border-style: solid;
|
||||
border-color: transparent;
|
||||
}
|
||||
</style>
|
||||
<div id="a"></div>
|
||||
<div id="b"></div>
|
|
@ -5,7 +5,7 @@
|
|||
<meta name="assert" content="Box shadow color, inset, and length parameters can be mixed in any order, but lengths must stay adjacent." />
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="resources/parsing-testcommon.js"></script>
|
||||
<script src="parsing/resources/parsing-testcommon.js"></script>
|
||||
<script>
|
||||
// color only
|
||||
test_valid_value("box-shadow", "4px 4px green", "green 4px 4px");
|
||||
|
|
|
@ -12,18 +12,18 @@ function test_valid_value(property, value, serializedValue) {
|
|||
test(function(){
|
||||
var div = document.createElement('div');
|
||||
div.style[property] = value;
|
||||
assert_not_equals(div.style[property], "", "property should be set");
|
||||
assert_not_equals(div.style.getPropertyValue(property), "", "property should be set");
|
||||
|
||||
var div = document.createElement('div');
|
||||
div.style[property] = value;
|
||||
var readValue = div.style[property];
|
||||
var readValue = div.style.getPropertyValue(property);
|
||||
if (serializedValue instanceof Array)
|
||||
assert_true(serializedValue.includes(readValue), "serialization should be sound");
|
||||
assert_in_array(readValue, serializedValue, "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");
|
||||
assert_equals(div.style.getPropertyValue(property), readValue, "serialization should round-trip");
|
||||
|
||||
}, "e.style['" + property + "'] = " + stringifiedValue + " should set the property value");
|
||||
}
|
||||
|
@ -34,6 +34,6 @@ function test_invalid_value(property, value) {
|
|||
test(function(){
|
||||
var div = document.createElement('div');
|
||||
div.style[property] = value;
|
||||
assert_equals(div.style[property], "");
|
||||
assert_equals(div.style.getPropertyValue(property), "");
|
||||
}, "e.style['" + property + "'] = " + stringifiedValue + " should not set the property value");
|
||||
}
|
||||
|
|
|
@ -1,22 +1,15 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>CSS Backgrounds and Borders Test: background-clip Reference</title>
|
||||
<link rel="author" title="James Wang" href="mailto:wangjian@ucweb.com">
|
||||
<style type="text/css">
|
||||
* { padding: 0; margin: 0; }
|
||||
#test-color-box {
|
||||
position: absolute;
|
||||
width: 180px;
|
||||
height: 180px;
|
||||
background-color: rgba(0, 255, 0, 1);
|
||||
border: 10px solid blue;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p>Test pass if the green box has a 10px width blue edge</p>
|
||||
<!-- background -->
|
||||
<div id="test-color-box"></div>
|
||||
</body>
|
||||
</html>
|
||||
<title>CSS Backgrounds and Borders Test: background-clip Reference</title>
|
||||
<link rel="author" title="James Wang" href="mailto:wangjian@ucweb.com">
|
||||
<style>
|
||||
#test-color-box {
|
||||
position: absolute;
|
||||
width: 180px;
|
||||
height: 180px;
|
||||
background-color: rgba(255, 165, 0, 1);
|
||||
border: 10px solid blue;
|
||||
}
|
||||
</style>
|
||||
<p>Test passes if the orange box has a 10px width blue edge.</p>
|
||||
<!-- background -->
|
||||
<div id="test-color-box"></div>
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>Corner Clipped Background Color</title>
|
||||
<style>
|
||||
html {
|
||||
background-color: green;
|
||||
}
|
||||
#a {
|
||||
top: 20px;
|
||||
left: 20px;
|
||||
position: absolute;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background-color: black;
|
||||
}
|
||||
</style>
|
||||
<div id="a"></div>
|
|
@ -1,39 +0,0 @@
|
|||
'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;
|
||||
|
||||
var stringifiedValue = JSON.stringify(value);
|
||||
|
||||
test(function(){
|
||||
var div = document.createElement('div');
|
||||
div.style[property] = value;
|
||||
assert_not_equals(div.style[property], "", "property should be set");
|
||||
|
||||
var div = document.createElement('div');
|
||||
div.style[property] = value;
|
||||
var readValue = div.style[property];
|
||||
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");
|
||||
|
||||
}, "e.style['" + property + "'] = " + stringifiedValue + " should set the property value");
|
||||
}
|
||||
|
||||
function test_invalid_value(property, value) {
|
||||
var stringifiedValue = JSON.stringify(value);
|
||||
|
||||
test(function(){
|
||||
var div = document.createElement('div');
|
||||
div.style[property] = value;
|
||||
assert_equals(div.style[property], "");
|
||||
}, "e.style['" + property + "'] = " + stringifiedValue + " should not set the property value");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue