Update web-platform-tests to revision c5dd38e18824f16f48b0c1703f43ff33359d9947

This commit is contained in:
WPT Sync Bot 2021-01-27 08:22:03 +00:00
parent 74e3a4b0c5
commit ec9472572a
129 changed files with 2532 additions and 324 deletions

View file

@ -2,49 +2,35 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
body {
margin: 0px;
height: 2000px;
width: 2000px;
}
#first {
height: 1000px;
background-color: #FFA5D2;
}
#anchor {
position: absolute;
background-color: #84BE6A;
height: 600px;
width: 100%;
}
</style>
<div id="first"></div>
<div id="changer"></div>
<div id="anchor"></div>
<script>
var win;
var messageCount = 0;
// Navigation steps:
// 1- page gets loaded and anchor element gets scrolled into view.
// 2- loaded page refreshed.
async_test(function(t) {
if (window.name == 'second/load') {
assert_equals(window.scrollY, 1000);
// Change height of content above anchor.
var ch = document.getElementById('changer');
ch.style.height = 100;
// Height of first + height changer.
assert_equals(window.scrollY, 1100)
t.done();
} else {
var anchor = document.getElementById('anchor');
anchor.scrollIntoView();
assert_equals(window.scrollY, 1000);
window.name = "second/load";
window.location.reload();
}
window.onmessage = function() {
if (++messageCount == 1) {
t.step(() => {
var anchor = win.document.getElementById('anchor');
anchor.scrollIntoView();
assert_equals(win.scrollY, 1000);
win.location.reload();
});
} else {
t.step(() => {
assert_equals(win.scrollY, 1000);
// Change height of content above anchor.
var ch = win.document.getElementById('changer');
ch.style.height = 100;
// Height of first + height changer.
assert_equals(win.scrollY, 1100)
t.done();
});
win.close();
}
};
win = window.open('support/history-restore-anchors-new-window.html');
}, 'Verify scroll anchoring interaction with history restoration');
</script>

View file

@ -0,0 +1,29 @@
<style>
body {
margin: 0px;
height: 2000px;
width: 2000px;
}
#first {
height: 1000px;
background-color: #FFA5D2;
}
#anchor {
position: absolute;
background-color: #84BE6A;
height: 600px;
width: 100%;
}
</style>
<div id="first"></div>
<div id="changer"></div>
<div id="anchor"></div>
<script>
onload = function() {
opener.postMessage("loaded", "*");
}
</script>