Update web-platform-tests to revision 4a5223502fa660ce03e470af6a61c8bc26c5a8ee

This commit is contained in:
WPT Sync Bot 2018-04-23 21:13:37 -04:00
parent c5f7c9ccf3
commit e891345f26
1328 changed files with 36632 additions and 20588 deletions

View file

@ -0,0 +1,51 @@
<!DOCTYPE html>
<html>
<head>
<title>CSSOM View - getBoxQuads() returns proper border and margin boxes for block and flex</title>
<link rel="help" href="https://drafts.csswg.org/cssom-view/#the-geometryutils-interface">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
.container {
width: 100px;
height: 50px;
background-color: gray;
}
span {
display: block;
background: gold;
height: 4px;
width: 14px;
margin: auto;
padding: 0px;
border: 3px solid blue;
}
</style>
</head>
<body>
<div class="container">
<span id="block-block"></span>
</div>
<div class="container" style="display:flex">
<span id="flex-block"></span>
</div>
<script>
test(function() {
let bb = document.getElementById("block-block");
assert_equals(bb.getBoxQuads({box: "border"})[0].bounds.width, 20, "Block layout border box is expected width.");
assert_equals(bb.getBoxQuads({box: "margin"})[0].bounds.width, 100, "Block layout margin box is expected width.");
// For containers that expand items to fill block-axis space, measure the box heights also.
let fb = document.getElementById("flex-block");
assert_equals(fb.getBoxQuads({box: "border"})[0].bounds.width, 20, "Flex layout border box is expected width.");
assert_equals(fb.getBoxQuads({box: "margin"})[0].bounds.width, 100, "Flex layout margin box is expected width.");
assert_equals(fb.getBoxQuads({box: "border"})[0].bounds.height, 10, "Flex layout border box is expected height.");
assert_equals(fb.getBoxQuads({box: "margin"})[0].bounds.height, 50, "Flex layout margin box is expected height.");
});
</script>
</body>
</html>

View file

@ -17,11 +17,18 @@
<script>
"use strict";
function doTest([html, dom, cssom, geometry, cssom_view]) {
function doTest([html, dom, uievents, cssom, geometry, cssom_view]) {
var idlArray = new IdlArray();
var svg = "interface SVGElement : Element {};";
idlArray.add_untested_idls(html + dom + svg + cssom + geometry);
idlArray.add_untested_idls(uievents, { only: [
'UIEvent',
'UIEventInit',
'MouseEvent',
'MouseEventInit',
'EventModifierInit']
});
idlArray.add_idls(cssom_view);
idlArray.add_objects({
@ -57,6 +64,7 @@ promise_test(function() {
// Have to wait for onload
return Promise.all([fetchData("/interfaces/html.idl"),
fetchData("/interfaces/dom.idl"),
fetchData("/interfaces/uievents.idl"),
fetchData("/interfaces/cssom.idl"),
fetchData("/interfaces/geometry.idl"),
fetchData("/interfaces/cssom-view.idl"),

View file

@ -14,7 +14,7 @@ add_completion_callback(() => document.getElementById("container").remove());
test(t => {
var shadow = document.getElementById("shadow");
var shadowRoot = shadow.createShadowRoot();
var shadowRoot = shadow.attachShadow({ mode: "open" });
var shadowDiv = document.createElement("div");
shadowDiv.style.height = "200px";
shadowDiv.style.width = "200px";
@ -30,4 +30,4 @@ test(t => {
assert_approx_equals(window.scrollX, expected_x, 1);
assert_approx_equals(window.scrollY, expected_y, 1);
}, "scrollIntoView should behave correctly if applies to shadow dom elements");
</script>
</script>