mirror of
https://github.com/servo/servo.git
synced 2025-08-17 11:25:35 +01:00
Update web-platform-tests to revision e426a6933a05bf144eba06a1d4c47ba876a4e2d1
This commit is contained in:
parent
415b26e4f1
commit
5e5eccabf8
495 changed files with 14920 additions and 784 deletions
|
@ -6,7 +6,6 @@
|
|||
<meta name="viewport" content="width=device-width, minimum-scale=1">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="viewport_support.js"></script>
|
||||
<style>
|
||||
html {
|
||||
height: 100%;
|
||||
|
@ -41,7 +40,9 @@
|
|||
|
||||
// Run the test after load to make sure any resize from load doesn't
|
||||
// interfere.
|
||||
window.onload = requestAnimationFrame(runTest);
|
||||
window.onload = requestAnimationFrame(function() {
|
||||
requestAnimationFrame(runTest);
|
||||
});
|
||||
</script>
|
||||
<div id="log"></div>
|
||||
</body>
|
||||
|
|
|
@ -60,14 +60,14 @@
|
|||
}
|
||||
|
||||
// Run the test after load to make sure any resize from a previous test
|
||||
// doesn't interfere.
|
||||
window.onload = function() {
|
||||
// or from the load doesn't interfere.
|
||||
window.onload = requestAnimationFrame(function() {
|
||||
try {
|
||||
runTest();
|
||||
} finally {
|
||||
done();
|
||||
}
|
||||
};
|
||||
});
|
||||
</script>
|
||||
<div id="log"></div>
|
||||
</body>
|
||||
|
|
|
@ -26,28 +26,40 @@
|
|||
<div id="log"></div>
|
||||
</body>
|
||||
<script>
|
||||
var scrollbarThickness = calculateScrollbarThickness();
|
||||
setup({ explicit_done: true });
|
||||
|
||||
test(function() {
|
||||
assert_equals(frames[0].window.visualViewport.width, 200);
|
||||
}, "window.visualViewport.width of iframe viewport should match iframe width.");
|
||||
test(function() {
|
||||
assert_equals(frames[0].window.visualViewport.height, 300);
|
||||
}, "window.visualViewport.height of iframe viewport should match iframe height.");
|
||||
function runTest() {
|
||||
var scrollbarThickness = calculateScrollbarThickness();
|
||||
|
||||
document.getElementById("size-log").innerText = frames[0].window.visualViewport.width + ", " + frames[0].window.visualViewport.height;
|
||||
test(function() {
|
||||
assert_equals(frames[0].window.visualViewport.width, 200);
|
||||
}, "window.visualViewport.width of iframe viewport should match iframe width.");
|
||||
test(function() {
|
||||
assert_equals(frames[0].window.visualViewport.height, 300);
|
||||
}, "window.visualViewport.height of iframe viewport should match iframe height.");
|
||||
|
||||
// Add overflow so scrollbars appear.
|
||||
window.frames[0].window.document.body.style.width = "2000px";
|
||||
window.frames[0].window.document.body.style.height = "2000px";
|
||||
document.getElementById("size-log").innerText = frames[0].window.visualViewport.width + ", " + frames[0].window.visualViewport.height;
|
||||
|
||||
test(function() {
|
||||
assert_equals(frames[0].window.visualViewport.width, 200 - scrollbarThickness);
|
||||
}, "window.visualViewport.width of iframe viewport should not include scrollbar.");
|
||||
test(function() {
|
||||
assert_equals(frames[0].window.visualViewport.height, 300 - scrollbarThickness);
|
||||
}, "window.visualViewport.height of iframe viewport should not include scrollbar.");
|
||||
// Add overflow so scrollbars appear.
|
||||
window.frames[0].window.document.body.style.width = "2000px";
|
||||
window.frames[0].window.document.body.style.height = "2000px";
|
||||
|
||||
document.getElementById("size-scrollbars-log").innerText = frames[0].window.visualViewport.width + ", " + frames[0].window.visualViewport.height;
|
||||
test(function() {
|
||||
assert_equals(frames[0].window.visualViewport.width, 200 - scrollbarThickness);
|
||||
}, "window.visualViewport.width of iframe viewport should not include scrollbar.");
|
||||
test(function() {
|
||||
assert_equals(frames[0].window.visualViewport.height, 300 - scrollbarThickness);
|
||||
}, "window.visualViewport.height of iframe viewport should not include scrollbar.");
|
||||
|
||||
document.getElementById("size-scrollbars-log").innerText = frames[0].window.visualViewport.width + ", " + frames[0].window.visualViewport.height;
|
||||
}
|
||||
|
||||
window.onload = function() {
|
||||
try {
|
||||
runTest();
|
||||
} finally {
|
||||
done();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue