Update web-platform-tests to revision e45156b5e558c062a609356905c83a0258c516e3

This commit is contained in:
WPT Sync Bot 2019-05-02 21:47:51 -04:00
parent 9f6005be16
commit 5fcf52d946
199 changed files with 4430 additions and 530 deletions

View file

@ -0,0 +1,26 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSSOM: resolved values of the inset properties for sticky positioning</title>
<link rel="help" href="https://drafts.csswg.org/cssom/#resolved-value">
<link rel="help" href="https://drafts.csswg.org/css-position/#sticky-pos">
<link rel="author" title="Joonghun Park" href="mailto:pjh0718@gmail.com">
<style>
#container-for-abspos {
height: 200px;
width: 400px;
overflow: hidden;
}
</style>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script type="module">
import {runTests, containerForAbspos} from "./support/getComputedStyle-insets.js";
runTests({
style: "position: sticky;",
containingBlockElement: containerForAbspos,
containingBlockArea: "content",
preservesPercentages: false,
preservesAuto: true,
canStretchAutoSize: false,
});
</script>

View file

@ -4,12 +4,15 @@
<link rel="help" href="https://drafts.csswg.org/cssom/#resolved-value">
<link rel="help" href="https://drafts.csswg.org/css-position/#pos-sch">
<link rel="author" title="Oriol Brufau" href="mailto:obrufau@igalia.com">
<style>
#container-for-inflow { overflow: hidden; }
</style>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script type="module">
import {runTests, containerForInflow} from "./support/getComputedStyle-insets.js";
runTests({
style: "position: sticky; position: -webkit-sticky",
style: "position: sticky;",
containingBlockElement: containerForInflow,
containingBlockArea: "content",
preservesPercentages: false,

View file

@ -0,0 +1,22 @@
<!DOCTYPE html>
<title>CSS Test: resolve top percentage value against proper box</title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/3115" />
<link rel="help" href="https://drafts.csswg.org/css-position/#sticky-pos" />
<link rel="help" href="https://drafts.csswg.org/cssom/#resolved-values" />
<meta name="assert" content="Test that the sticky percentage insets are
resolved against the right ancestor, i.e. the nearest scrollport." />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div style="height: 500px; background: purple; overflow: hidden;">
<div style="height: 400px; background: yellow;">
<div id="target" style="height: 100px; position: sticky; left: 0; top: 50%; background: blue;">
</div>
</div>
</div>
<script>
test(() => {
assert_equals(getComputedStyle(target).top, '250px');
}, "Sticky element's top property percentage value should be resolved against the div with overflow: hidden");
</script>

View file

@ -22,7 +22,6 @@ stylesheet.textContent = `
padding: 1px 2px;
border-width: 2px 4px;
margin: 4px 8px;
overflow: hidden;
}
#container-for-abspos {
/* Padding area: 200px tall, 400px wide */
@ -48,7 +47,7 @@ stylesheet.textContent = `
border-style: solid;
}
`;
document.head.appendChild(stylesheet);
document.head.prepend(stylesheet);
function runTestsWithWM(data, testWM, cbWM) {
const {
@ -149,10 +148,10 @@ function runTestsWithWM(data, testWM, cbWM) {
bottom: "50%",
right: "75%",
}, {
top: .1 * cbHeight + "px",
left: .25 * cbWidth + "px",
bottom: .5 * cbHeight + "px",
right: .75 * cbWidth + "px",
top: cbHeight * 10 / 100 + "px",
left: cbWidth * 25 / 100 + "px",
bottom: cbHeight * 50 / 100 + "px",
right: cbWidth * 75 / 100 + "px",
}, "Percentages are absolutized into pixels");
checkStyle({
@ -161,10 +160,10 @@ function runTestsWithWM(data, testWM, cbWM) {
bottom: "calc(50% - 3px)",
right: "calc(75% - 4px)",
}, {
top: .1 * cbHeight - 1 + "px",
left: .25 * cbWidth - 2 + "px",
bottom: .5 * cbHeight - 3 + "px",
right: .75 * cbWidth - 4 + "px",
top: cbHeight * 10 / 100 - 1 + "px",
left: cbWidth * 25 / 100 - 2 + "px",
bottom: cbHeight * 50 / 100 - 3 + "px",
right: cbWidth * 75 / 100 - 4 + "px",
}, "calc() is absolutized into pixels");
}