mirror of
https://github.com/servo/servo.git
synced 2025-08-08 23:15:33 +01:00
Update web-platform-tests to revision 1aaada4bbc936024441fe7995b77c21a2c554da1
This commit is contained in:
parent
1e1eca07ed
commit
5e9d150c07
140 changed files with 3413 additions and 553 deletions
|
@ -1,12 +1,22 @@
|
|||
<script src="/common/PrefixedPostMessage.js"></script>
|
||||
<script>
|
||||
var prefixedMessage = new PrefixedMessageResource();
|
||||
window.addEventListener('load', () => {
|
||||
var max = 50, attempts = 0;
|
||||
function sendCoordinates() {
|
||||
// Certain windowing systems position windows asynchronously.
|
||||
// As a result, the window may not be positioned yet when the
|
||||
// load event fires. To accommodate this, allow waiting up to
|
||||
// 5 seconds for positioning to take place.
|
||||
if (!window.screenX && !window.screenY && ++attempts < max) {
|
||||
setTimeout(sendCoordinates, 100);
|
||||
return;
|
||||
}
|
||||
prefixedMessage.postToOpener({
|
||||
left: window.screenX,
|
||||
top: window.screenY,
|
||||
width: window.innerWidth,
|
||||
height: window.innerHeight
|
||||
});
|
||||
});
|
||||
}
|
||||
window.addEventListener('load', sendCoordinates);
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue