зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1564668 [wpt PR 17566] - Fix wpt/inert/inert-retargeting-iframe.tentative.html, a=testonly
Automatic update from web-platform-tests Fix wpt/inert/inert-retargeting-iframe.tentative.html TBR=poromov@chromium.org TBR=schenney@chromium.org Bug: 979193 Change-Id: I12f73886f3fc42ef5da205ae6f4387ed2a0ed13d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1680471 Reviewed-by: Alice Boxhall <aboxhall@chromium.org> Commit-Queue: Alice Boxhall <aboxhall@chromium.org> Cr-Commit-Position: refs/heads/master@{#673212} -- wpt-commits: 1878c9f7b2c77319f821656c36120da7b09f8478 wpt-pr: 17566
This commit is contained in:
Родитель
2cf08d6ac5
Коммит
aa4215a7ca
|
@ -80,14 +80,6 @@ button.clicked::after {
|
||||||
.clicked > legend::after {
|
.clicked > legend::after {
|
||||||
content: " (clicked)";
|
content: " (clicked)";
|
||||||
}
|
}
|
||||||
|
|
||||||
#adjacent {
|
|
||||||
position: absolute;
|
|
||||||
top: 250px;
|
|
||||||
left: 100px;
|
|
||||||
height: 20px;
|
|
||||||
width: 100px;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@ -108,7 +100,6 @@ button.clicked::after {
|
||||||
<button id="foreground">foreground</button>
|
<button id="foreground">foreground</button>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<button id="adjacent">adjacent</button>
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -170,7 +161,7 @@ function expectEventsOn(events, element) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
element.removeEventListener(event, f, { capture: true });
|
element.removeEventListener(event, f, { capture: true });
|
||||||
reject("did not get " + event + " on " + element.id);
|
reject("did not get " + event + " on " + element.id);
|
||||||
}, 500);
|
}, 1000);
|
||||||
});
|
});
|
||||||
promises.push(promise);
|
promises.push(promise);
|
||||||
})(event, element);
|
})(event, element);
|
||||||
|
@ -193,7 +184,7 @@ function unexpectEventsOn(events, element) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
element.removeEventListener(event, f, { capture: true });
|
element.removeEventListener(event, f, { capture: true });
|
||||||
resolve();
|
resolve();
|
||||||
}, 250);
|
}, 1000);
|
||||||
});
|
});
|
||||||
promises.push(promise);
|
promises.push(promise);
|
||||||
})(event, element);
|
})(event, element);
|
||||||
|
@ -219,7 +210,11 @@ promise_test(async () => {
|
||||||
await clickOn(foreground);
|
await clickOn(foreground);
|
||||||
await auxClickOn(foreground);
|
await auxClickOn(foreground);
|
||||||
await dblClickOn(foreground);
|
await dblClickOn(foreground);
|
||||||
await movePointerOver(adjacent);
|
let ancestorBox = ancestorContainer.getBoundingClientRect();
|
||||||
|
let inertBox = inertContainer.getBoundingClientRect();
|
||||||
|
let x = ancestorBox.left + (ancestorBox.width / 2);
|
||||||
|
let y = inertBox.bottom + ((ancestorBox.bottom - inertBox.bottom) / 2);
|
||||||
|
await movePointerTo(x, y);
|
||||||
await Promise.all(promises);
|
await Promise.all(promises);
|
||||||
}, "Tests that any mouse event on a non-inert element is correctly targeted to that element");
|
}, "Tests that any mouse event on a non-inert element is correctly targeted to that element");
|
||||||
|
|
||||||
|
@ -232,15 +227,18 @@ promise_test(async () => {
|
||||||
let promises = expectEventsOn(["mouseover", "mouseenter", "mousemove", "mousedown",
|
let promises = expectEventsOn(["mouseover", "mouseenter", "mousemove", "mousedown",
|
||||||
"mouseup", "click", "auxclick"],
|
"mouseup", "click", "auxclick"],
|
||||||
ancestorContainer);
|
ancestorContainer);
|
||||||
/*
|
|
||||||
// TODO(aboxhall): We are getting these unexpected events. Why?
|
|
||||||
promises = promises.concat(unexpectEventsOn(["mouseout", "mouseleave"],
|
promises = promises.concat(unexpectEventsOn(["mouseout", "mouseleave"],
|
||||||
ancestorContainer));
|
ancestorContainer));
|
||||||
*/
|
|
||||||
await clickOn(foreground);
|
await clickOn(foreground);
|
||||||
await auxClickOn(foreground);
|
await auxClickOn(foreground);
|
||||||
await dblClickOn(foreground);
|
await dblClickOn(foreground);
|
||||||
await movePointerOver(adjacent);
|
let ancestorBox = ancestorContainer.getBoundingClientRect();
|
||||||
|
let inertBox = inertContainer.getBoundingClientRect();
|
||||||
|
let x = ancestorBox.left + (ancestorBox.width / 2);
|
||||||
|
let y = inertBox.bottom + ((ancestorBox.bottom - inertBox.bottom) / 2);
|
||||||
|
await movePointerTo(x, y);
|
||||||
await Promise.all(promises);
|
await Promise.all(promises);
|
||||||
}, 'Tests that any mouse event on an inert element is targeted to the nearest non-inert ancestor at the same coordinates');
|
}, 'Tests that any mouse event on an inert element is targeted to the nearest non-inert ancestor at the same coordinates');
|
||||||
|
|
||||||
|
@ -254,7 +252,11 @@ promise_test(async () => {
|
||||||
"pointerleave"],
|
"pointerleave"],
|
||||||
foreground);
|
foreground);
|
||||||
await clickOn(foreground);
|
await clickOn(foreground);
|
||||||
await movePointerOver(adjacent);
|
let ancestorBox = ancestorContainer.getBoundingClientRect();
|
||||||
|
let inertBox = inertContainer.getBoundingClientRect();
|
||||||
|
let x = ancestorBox.left + (ancestorBox.width / 2);
|
||||||
|
let y = inertBox.bottom + ((ancestorBox.bottom - inertBox.bottom) / 2);
|
||||||
|
await movePointerTo(x, y);
|
||||||
await Promise.all(promises);
|
await Promise.all(promises);
|
||||||
}, "Tests that any pointer event on a non-inert element is correctly targeted to that element");
|
}, "Tests that any pointer event on a non-inert element is correctly targeted to that element");
|
||||||
|
|
||||||
|
@ -267,13 +269,15 @@ promise_test(async () => {
|
||||||
let promises = expectEventsOn(["pointerover", "pointerenter", "pointermove",
|
let promises = expectEventsOn(["pointerover", "pointerenter", "pointermove",
|
||||||
"pointerdown", "pointerup" ],
|
"pointerdown", "pointerup" ],
|
||||||
ancestorContainer);
|
ancestorContainer);
|
||||||
/*
|
|
||||||
// TODO(aboxhall): We are getting these unexpected events. Why?
|
|
||||||
promises = promises.concat(unexpectEventsOn(["pointerout", "pointerleave"],
|
promises = promises.concat(unexpectEventsOn(["pointerout", "pointerleave"],
|
||||||
ancestorContainer));
|
ancestorContainer));
|
||||||
*/
|
|
||||||
await clickOn(foreground);
|
await clickOn(foreground);
|
||||||
await movePointerOver(adjacent);
|
let ancestorBox = ancestorContainer.getBoundingClientRect();
|
||||||
|
let inertBox = inertContainer.getBoundingClientRect();
|
||||||
|
let x = ancestorBox.left + (ancestorBox.width / 2);
|
||||||
|
let y = inertBox.bottom + ((ancestorBox.bottom - inertBox.bottom) / 2);
|
||||||
|
await movePointerTo(x, y);
|
||||||
await Promise.all(promises);
|
await Promise.all(promises);
|
||||||
}, 'Tests that any pointer event on an inert element is targeted to the nearest non-inert ancestor at the same coordinates');
|
}, 'Tests that any pointer event on an inert element is targeted to the nearest non-inert ancestor at the same coordinates');
|
||||||
</script>
|
</script>
|
||||||
|
|
Загрузка…
Ссылка в новой задаче