Update web-platform-tests to revision 6d85a3b422cab97d032ad3db47cb741ca364185f

This commit is contained in:
WPT Sync Bot 2018-02-08 20:20:17 -05:00
parent cd663ea332
commit b524b7c279
37 changed files with 1446 additions and 178 deletions

View file

@ -0,0 +1,12 @@
<!DOCTYPE html>
<title>Collapse bottom margin from previous sibling through zero height block to next sibling</title>
<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org">
<link rel="help" href="https://www.w3.org/TR/CSS22/box.html#collapsing-margins" title="8.3.1 Collapsing margins">
<link rel="match" href="../../reference/ref-filled-green-200px-square.html">
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div style="overflow:hidden; width:200px; height:400px; background:green;">
<div style="margin-bottom:200px;"></div>
<div style="height:0;"></div>
<div style="height:200px; margin-top:100px; background:white;"></div>
<div style="height:200px; background:red;"></div>
</div>

View file

@ -47,6 +47,12 @@
checkInvalidValues("start auto")
}, "Verify 'auto' values are invalid");
test(function() {
checkInvalidValues("self-start")
checkInvalidValues("center self-end")
checkInvalidValues("self-end start")
}, "Verify self-position values are invalid");
test(function() {
checkInvalidValues("")
}, "Verify empty declaration is invalid");

View file

@ -19,39 +19,39 @@ document.body.appendChild(container);
test(function() {
element = document.createElement("div");
document.body.appendChild(element);
checkValues(element, "justifyItems", "justify-items", "", "legacy");
checkValues(element, "justifyItems", "justify-items", "", "normal");
}, "Test 'initial' value when nothing is specified");
test(function() {
container.style.display = "";
checkInitialValues(element, "justifyItems", "justify-items", "center", "legacy");
checkInitialValues(element, "justifyItems", "justify-items", "center", "normal");
}, "Test justify-items: 'initial'");
test(function() {
container.style.display = "grid";
checkInitialValues(element, "justifyItems", "justify-items", "safe start", "legacy");
checkInitialValues(element, "justifyItems", "justify-items", "safe start", "normal");
}, "Test grid items justify-items: 'initial'");
test(function() {
container.style.display = "flex";
checkInitialValues(element, "justifyItems", "justify-items", "unsafe end", "legacy");
checkInitialValues(element, "justifyItems", "justify-items", "unsafe end", "normal");
}, "Test flex items justify-items: 'initial'");
test(function() {
container.style.display = "";
element.style.position = "absolute";
checkInitialValues(element, "justifyItems", "justify-items", "start", "legacy");
checkInitialValues(element, "justifyItems", "justify-items", "start", "normal");
}, "Test absolute positioned elements justify-items: 'initial'");
test(function() {
container.style.display = "grid";
element.style.position = "absolute";
checkInitialValues(element, "justifyItems", "justify-items", "end", "legacy");
checkInitialValues(element, "justifyItems", "justify-items", "end", "normal");
}, "Test absolute positioned grid items justify-items: 'initial'");
test(function() {
container.style.display = "flex";
element.style.position = "absolute";
checkInitialValues(element, "justifyItems", "justify-items", "end", "legacy");
checkInitialValues(element, "justifyItems", "justify-items", "end", "normal");
}, "Test absolute positioned flex items justify-items: 'initial'");
</script>

View file

@ -37,7 +37,18 @@
checkInvalidValues("auto")
checkInvalidValues("auto right")
checkInvalidValues("auto auto")
}, "Verify 'auto' value is invalid as first longhand value.");
checkInvalidValues("center auto")
}, "Verify 'auto' value is invalid.");
test(function() {
checkInvalidValues("legacy")
checkInvalidValues("legacy start")
checkInvalidValues("end legacy")
checkInvalidValues("legacy left")
checkInvalidValues("center legacy")
checkInvalidValues("start legacy center")
}, "Verify 'legacy' value is invalid.");
test(function() {
checkInvalidValues("")

View file

@ -0,0 +1,53 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Color 4: color() parsing</title>
<link rel="help" href="https://drafts.csswg.org/css-color-4/#color-function">
<meta name="assert" content="Tests basic parsing of the color function">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="test"></div>
<script>
const div = document.querySelector("#test");
function testColorFunction(description, rule, expectedValue) {
test(function() {
div.style.color = "black";
div.style.color = rule;
assert_equals(getComputedStyle(div).color, expectedValue);
}, description);
}
testColorFunction("Basic sRGB white", "color(srgb 1 1 1)", "color(srgb 1 1 1)");
testColorFunction("White with lots of space", "color( srgb 1 1 1 )", "color(srgb 1 1 1)");
testColorFunction("sRGB color", "color(srgb 0.25 0.5 0.75)", "color(srgb 0.25 0.5 0.75)");
testColorFunction("Different case for sRGB", "color(SrGb 0.25 0.5 0.75)", "color(srgb 0.25 0.5 0.75)");
testColorFunction("sRGB color with unnecessary decimals", "color(srgb 1.00000 0.500000 0.20)", "color(srgb 1 0.5 0.2)");
testColorFunction("sRGB white with 0.5 alpha", "color(srgb 1 1 1 / 0.5)", "color(srgb 1 1 1 / 0.5)");
testColorFunction("sRGB white with 0 alpha", "color(srgb 1 1 1 / 0)", "color(srgb 1 1 1 / 0)");
testColorFunction("sRGB white with 50% alpha", "color(srgb 1 1 1 / 50%)", "color(srgb 1 1 1 / 0.5)");
testColorFunction("sRGB white with 0% alpha", "color(srgb 1 1 1 / 0%)", "color(srgb 1 1 1 / 0)");
testColorFunction("One missing component is 0", "color(srgb 1 1)", "color(srgb 1 1 0)");
testColorFunction("Two missing components are 0", "color(srgb 1)", "color(srgb 1 0 0)");
testColorFunction("All components missing", "color(srgb)", "color(srgb 0 0 0)");
testColorFunction("Display P3 color", "color(display-p3 0.6 0.7 0.8)", "color(display-p3 0.6 0.7 0.8)");
testColorFunction("Different case for Display P3", "color(dIspLaY-P3 0.6 0.7 0.8)", "color(display-p3 0.6 0.7 0.8)");
testColorFunction("Unknown color space should fallback", "color(unknown 1 2 3, red)", "color(unknown 1 2 3, red)");
testColorFunction("sRGB color with negative component should clamp to 0", "color(srgb -0.25 0.5 0.75)", "color(srgb 0 0.5 0.75)");
testColorFunction("sRGB color with component > 1 should clamp", "color(srgb 0.25 1.5 0.75)", "color(srgb 0.25 1 0.75)");
testColorFunction("Display P3 color with negative component should clamp to 0", "color(display-p3 0.5 -199 0.75)", "color(display-p3 0.5 0 0.75)");
testColorFunction("Display P3 color with component > 1 should clamp", "color(display-p3 184 1.00001 2347329746587)", "color(display-p3 1 1 1)");
testColorFunction("Alpha > 1 should clamp", "color(srgb 0.1 0.2 0.3 / 1.9)", "color(srgb 0.1 0.2 0.3)");
testColorFunction("Negative alpha should clamp", "color(srgb 1 1 1 / -0.2)", "color(srgb 1 1 1 / 0)");
// Invalid properties
testColorFunction("Empty", "color()", "rgb(0, 0, 0)");
testColorFunction("Bad color space", "color(banana 1 1 1)", "rgb(0, 0, 0)");
testColorFunction("Bad Display P3 color space", "color(displayp3 1 1 1)", "rgb(0, 0, 0)");
testColorFunction("No color space", "color(1 1 1)", "rgb(0, 0, 0)");
testColorFunction("Too many parameters", "color(srgb 1 1 1 1)", "rgb(0, 0, 0)");
testColorFunction("Way too many parameters", "color(srgb 1 1 1 1 1)", "rgb(0, 0, 0)");
testColorFunction("Bad parameters", "color(srgb 1 eggs 1)", "rgb(0, 0, 0)");
testColorFunction("Bad alpha", "color(srgb 1 1 1 / bacon)", "rgb(0, 0, 0)");
testColorFunction("Junk after alpha", "color(srgb 1 1 1 / 1 cucumber)", "rgb(0, 0, 0)");
</script>