Diff
Modified: trunk/LayoutTests/ChangeLog (283794 => 283795)
--- trunk/LayoutTests/ChangeLog 2021-10-08 07:57:33 UTC (rev 283794)
+++ trunk/LayoutTests/ChangeLog 2021-10-08 08:25:52 UTC (rev 283795)
@@ -1,3 +1,16 @@
+2021-10-08 Tim Nguyen <[email protected]>
+
+ Re-sync the-dialog-element and inert WPT from upstream
+ https://bugs.webkit.org/show_bug.cgi?id=231392
+
+ Reviewed by Youenn Fablet.
+
+ Upstream commit: https://github.com/web-platform-tests/wpt/commit/a44515b7c7774abf1256f488bf0e9dc02459fced
+
+ * TestExpectations:
+ * platform/gtk/imported/w3c/web-platform-tests/inert/inert-retargeting-iframe.tentative-expected.txt: Removed.
+ * platform/wpe/imported/w3c/web-platform-tests/inert/inert-retargeting-iframe.tentative-expected.txt: Removed.
+
2021-10-07 Alan Bujtas <[email protected]>
Do not check for firstLineStyle while constructing RenderText
Modified: trunk/LayoutTests/TestExpectations (283794 => 283795)
--- trunk/LayoutTests/TestExpectations 2021-10-08 07:57:33 UTC (rev 283794)
+++ trunk/LayoutTests/TestExpectations 2021-10-08 08:25:52 UTC (rev 283795)
@@ -5190,10 +5190,6 @@
webkit.org/b/230004 imported/w3c/web-platform-tests/css/css-pseudo/selection-paint-image.html [ ImageOnlyFailure ]
webkit.org/b/230004 imported/w3c/web-platform-tests/css/css-pseudo/selection-textarea-011.html [ ImageOnlyFailure ]
-# Awaiting official CSSWG resolution making these tests irrelevant: https://lists.w3.org/Archives/Public/www-style/2021Sep/0004.html
-imported/w3c/web-platform-tests/inert/inert-retargeting.tentative.html [ Skip ]
-imported/w3c/web-platform-tests/inert/inert-retargeting-iframe.tentative.html [ Skip ]
-
imported/w3c/web-platform-tests/content-security-policy/script-src/ [ DumpJSConsoleLogInStdErr ]
# import-w3c-tests copies -notref.html to -expected.html, so expected image failure here.
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (283794 => 283795)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2021-10-08 07:57:33 UTC (rev 283794)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2021-10-08 08:25:52 UTC (rev 283795)
@@ -1,3 +1,24 @@
+2021-10-08 Tim Nguyen <[email protected]>
+
+ Re-sync the-dialog-element and inert WPT from upstream
+ https://bugs.webkit.org/show_bug.cgi?id=231392
+
+ Reviewed by Youenn Fablet.
+
+ Upstream commit: https://github.com/web-platform-tests/wpt/commit/a44515b7c7774abf1256f488bf0e9dc02459fced
+
+ * resources/resource-files.json:
+ * web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-inert.tentative-expected.txt: Added.
+ * web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-inert.tentative.html: Added.
+ * web-platform-tests/html/semantics/interactive-elements/the-dialog-element/w3c-import.log:
+ * web-platform-tests/inert/frame/button.html: Removed.
+ * web-platform-tests/inert/frame/w3c-import.log: Removed.
+ * web-platform-tests/inert/inert-computed-style-expected.txt: Added.
+ * web-platform-tests/inert/inert-computed-style.html: Added.
+ * web-platform-tests/inert/inert-retargeting-iframe.tentative.html: Removed.
+ * web-platform-tests/inert/inert-retargeting.tentative.html: Removed.
+ * web-platform-tests/inert/w3c-import.log:
+
2021-10-08 Myles C. Maxfield <[email protected]>
font-families inside @font-palette-values need to be case insensitive
Modified: trunk/LayoutTests/imported/w3c/resources/resource-files.json (283794 => 283795)
--- trunk/LayoutTests/imported/w3c/resources/resource-files.json 2021-10-08 07:57:33 UTC (rev 283794)
+++ trunk/LayoutTests/imported/w3c/resources/resource-files.json 2021-10-08 08:25:52 UTC (rev 283795)
@@ -2856,7 +2856,6 @@
"web-platform-tests/html/webappapis/scripting/events/onerroreventhandler-frame.html",
"web-platform-tests/html/webappapis/user-prompts/cannot-show-simple-dialogs/support/confirm.html",
"web-platform-tests/html/webappapis/user-prompts/cannot-show-simple-dialogs/support/prompt.html",
- "web-platform-tests/inert/frame/button.html",
"web-platform-tests/infrastructure/assumptions/ahem-notref.html",
"web-platform-tests/infrastructure/reftest/red.html",
"web-platform-tests/intersection-observer/observer-in-iframe.html",
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-inert.tentative-expected.txt (0 => 283795)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-inert.tentative-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-inert.tentative-expected.txt 2021-10-08 08:25:52 UTC (rev 283795)
@@ -0,0 +1,4 @@
+Something
+
+PASS dialog-inert
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-inert.tentative.html (0 => 283795)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-inert.tentative.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-inert.tentative.html 2021-10-08 08:25:52 UTC (rev 283795)
@@ -0,0 +1,45 @@
+<!doctype html>
+<meta charset=utf-8>
+<link rel="author" title="Emilio Cobos Álvarez" href=""
+<link rel="author" title="Mozilla" href=""
+<script src=""
+<script src=""
+<style>
+ body { margin: 0 }
+ dialog {
+ width: 100%;
+ height: 100%;
+ max-width: 100%;
+ max-height: 100%;
+ box-sizing: border-box;
+ padding: 0;
+ }
+ dialog::backdrop {
+ display: none;
+ }
+</style>
+<dialog id=dialog>Something</dialog>
+<script>
+test(function() {
+ let dialog = document.getElementById("dialog");
+ dialog.showModal();
+ assert_equals(
+ document.elementFromPoint(10, 10),
+ dialog,
+ "Dialog is hittable by default",
+ );
+ dialog.inert = true;
+ assert_not_equals(
+ document.elementFromPoint(10, 10),
+ dialog,
+ "Dialog becomes inert dynamically",
+ );
+ dialog.close();
+ dialog.showModal();
+ assert_not_equals(
+ document.elementFromPoint(10, 10),
+ dialog,
+ "Dialog remains inert after open",
+ );
+});
+</script>
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/w3c-import.log (283794 => 283795)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/w3c-import.log 2021-10-08 07:57:33 UTC (rev 283794)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/w3c-import.log 2021-10-08 08:25:52 UTC (rev 283795)
@@ -41,6 +41,7 @@
/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-enabled.html
/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-focusing-steps-prevent-autofocus.html
/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission.html
+/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-inert.tentative.html
/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-keydown-preventDefault.html
/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-not-in-tree-crash.html
/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-open.html
@@ -80,6 +81,8 @@
/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/top-layer-display-none.html
/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/top-layer-nesting-expected.html
/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/top-layer-nesting.html
+/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/top-layer-parent-opacity-expected.html
+/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/top-layer-parent-opacity.html
/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/top-layer-stacking-correct-order-remove-readd-expected.html
/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/top-layer-stacking-correct-order-remove-readd.html
/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/top-layer-stacking-dynamic-expected.html
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/inert/inert-computed-style-expected.txt (0 => 283795)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/inert/inert-computed-style-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/inert/inert-computed-style-expected.txt 2021-10-08 08:25:52 UTC (rev 283795)
@@ -0,0 +1,3 @@
+
+FAIL inert isn't hit-testable, but that isn't expose in the computed style assert_equals: inert node doesn't change pointer-events computed value expected (string) "auto" but got (undefined) undefined
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/inert/inert-computed-style.html (0 => 283795)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/inert/inert-computed-style.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/inert/inert-computed-style.html 2021-10-08 08:25:52 UTC (rev 283795)
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>inert isn't hit-testable, but that isn't expose in the computed style</title>
+<link rel="author" title="Emilio Cobos Álvarez" href=""
+<link rel="author" title="Mozilla" href=""
+<script src=""
+<script src=""
+<style>
+ body { margin: 0 }
+ div {
+ width: 100px;
+ height: 100px;
+ position: absolute;
+ top: 0;
+ left: 0;
+ background-color: blue;
+ }
+ #non-inert {
+ background-color: red;
+ }
+</style>
+<div id="non-inert"></div>
+<div id="inert"></div>
+<script>
+ test(function() {
+ let inert = document.getElementById("inert");
+ assert_equals(
+ document.elementFromPoint(50, 50),
+ inert,
+ "not-yet-inert node hit-test before non-inert node",
+ );
+ inert.inert = true;
+ assert_equals(
+ document.elementFromPoint(50, 50),
+ document.getElementById("non-inert"),
+ "inert node is transparent to events (as pointer-events: none)",
+ );
+ assert_equals(
+ getComputedStyle(inert).pointerEvents,
+ "auto",
+ "inert node doesn't change pointer-events computed value",
+ );
+ assert_equals(
+ getComputedStyle(inert).userSelect,
+ "auto",
+ "inert node doesn't change pointer-events computed value",
+ );
+ });
+</script>
Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/inert/inert-retargeting-iframe.tentative.html (283794 => 283795)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/inert/inert-retargeting-iframe.tentative.html 2021-10-08 07:57:33 UTC (rev 283794)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/inert/inert-retargeting-iframe.tentative.html 2021-10-08 08:25:52 UTC (rev 283795)
@@ -1,279 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src=""
-<script src=""
-<script src=""
-<script src=""
-<script src=""
-<style>
-button#foreground,
-button#background {
- position: absolute;
- top: 75px;
- left: 50px;
- width: 100px;
- height: 20px;
-}
-
-button#background {
- left: 75px;
- width: 150px;
- height: 40px;
- top: 125px;
- line-height: 53px;
-}
-
-.clicked {
- background-color: red;
-}
-
-#ancestorContainer.clicked {
- background-color: green;
-}
-
-#ancestorContainer {
- position: absolute;
- top: 200px;
- left: 10px;
- width: 300px;
- height: 300px;
- background-color: blue;
-}
-
-#displacedAncestor {
- position: absolute;
- top: 13px;
- left: 240px;
- width: 300px;
- height: 250px;
- background-color: #ff89;
-}
-
-#displacedAncestor.clicked {
- background-color: #f009;
-}
-
-#inertContainer {
- background-color: #fff9;
- position: absolute;
- top: 35px;
- left: -192px;
- width: 200px;
- height: 200px;
-}
-
-fieldset {
- margin: 0;
- padding: 0;
- border: 1px solid black;
-}
-
-legend {
- background-color: white;
- border: 1px solid black;
- margin-left: 5px;
-}
-</style>
-</head>
-<body>
- <p>Click on "Inert button".</p>
- <ul>
- <li>The blue square ("Non-inert ancestor container") should turn green.</li>
- <li>The yellow, semi-transparent square ("Non-inert, displaced container") should not turn red.</li>
- <li>"Non-inert button" should not turn red.</li>
- </ul>
- <p style="margin-bottom:250px">(The full test suite checks a range of events.)</p>
- <fieldset id="ancestorContainer">
- <legend>Non-inert ancestor container</legend>
- <iframe id="background" src=""
- <fieldset id="displacedAncestor">
- <legend>Non-inert, displaced ancestor</legend>
- <fieldset id="inertContainer" inert>
- <legend>Inert container</legend>
- <button id="foreground">foreground</button>
- </fieldset>
- </fieldset>
- </fieldset>
-
- <script>
-document.body.addEventListener('click', (e) => {
- e.target.classList.add('clicked');
-});
-
-function clickOn(element) {
- return new test_driver.Actions()
- .pointerMove(0, 0, {origin: element})
- .pointerDown({button: test_driver.Actions.prototype.ButtonType.LEFT})
- .pointerUp({button: test_driver.Actions.prototype.ButtonType.LEFT})
- .send();
-}
-
-function auxClickOn(element) {
- return new test_driver.Actions()
- .pointerMove(0, 0, {origin: element})
- .pointerDown({button: test_driver.Actions.prototype.ButtonType.RIGHT})
- .pointerUp({button: test_driver.Actions.prototype.ButtonType.RIGHT})
- .send();
-}
-
-function dblClickOn(element) {
- return new test_driver.Actions()
- .pointerMove(0, 0, {origin: element})
- .pointerDown({button: test_driver.Actions.prototype.ButtonType.LEFT})
- .pointerUp({button: test_driver.Actions.prototype.ButtonType.LEFT})
- .pointerDown({button: test_driver.Actions.prototype.ButtonType.LEFT})
- .pointerUp({button: test_driver.Actions.prototype.ButtonType.LEFT})
- .send();
-}
-
-function movePointerOver(element) {
- let rect = element.getBoundingClientRect();
- return new test_driver.Actions()
- .pointerMove(0, 0, { origin: element })
- .send();
-}
-
-function movePointerTo(x, y) {
- return new test_driver.Actions()
- .pointerMove(Math.ceil(x), Math.ceil(y), { origin: "viewport" })
- .send();
-}
-
-function expectEventsOn(events, element) {
- let promises = [];
- for (event of events) {
- ((event, element) => {
- var promise = new Promise((resolve, reject) => {
- let f = (e) => {
- assert_equals(e.type, event);
- assert_equals(e.target, element);
- resolve();
- }
- element.addEventListener(event, f, { capture: true, once: true });
-
- step_timeout(() => {
- element.removeEventListener(event, f, { capture: true });
- reject("did not get " + event + " on " + element.id);
- }, 5000);
- });
- promises.push(promise);
- })(event, element);
- }
- return promises;
-}
-
-function unexpectEventsOn(events, element) {
- let promises = [];
- for (event of events) {
- ((event, element) => {
- var promise = new Promise((resolve, reject) => {
- let f = (e) => {
- assert_equals(e.type, event);
- assert_equals(e.target, element);
- reject("got " + e.type + " on " + e.target.id);
- }
- element.addEventListener(event, f, { capture: true, once: true });
-
- step_timeout(() => {
- element.removeEventListener(event, f, { capture: true });
- resolve();
- }, 1000);
- });
- promises.push(promise);
- })(event, element);
- }
- return promises;
-}
-
-test(() => {
- let rect = foreground.getBoundingClientRect();
- let center_x = rect.left + (rect.width / 2);
- let center_y = rect.top + (rect.height / 2);
- assert_equals(document.elementsFromPoint(center_x, center_y)[0], foreground);
-}, "elementsFromPoint returns inert element");
-
-promise_test(async () => {
- // Test mouse events on non-inert element - events should go to "foreground"
- inertContainer.inert = false;
- await movePointerTo(0, 0);
- let promises = expectEventsOn(["mouseover", "mouseenter", "mousemove", "mousedown",
- "mouseup", "click", "auxclick", "mouseout",
- "mouseleave"],
- foreground);
- await clickOn(foreground);
- await auxClickOn(foreground);
- await dblClickOn(foreground);
- 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);
-}, "Tests that any mouse event on a non-inert element is correctly targeted to that element");
-
-promise_test(async () => {
- // Make the containing element inert - now events should go to "container"
- // which is the non-inert ancestor at the same position
- inertContainer.inert = true;
- await movePointerTo(0, 0);
-
- let promises = expectEventsOn(["mouseover", "mouseenter", "mousemove", "mousedown",
- "mouseup", "click", "auxclick"],
- ancestorContainer);
-
- promises = promises.concat(unexpectEventsOn(["mouseout", "mouseleave"],
- ancestorContainer));
-
- await clickOn(foreground);
- await auxClickOn(foreground);
- await dblClickOn(foreground);
- 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);
-}, 'Tests that any mouse event on an inert element is targeted to the nearest non-inert ancestor at the same coordinates');
-
-promise_test(async () => {
- // Test pointer events on non-inert element - events should go to "foreground"
- inertContainer.inert = false;
- await movePointerTo(0, 0);
-
- let promises = expectEventsOn(["pointerover", "pointerenter", "pointermove",
- "pointerdown", "pointerup", "pointerout",
- "pointerleave"],
- foreground);
- await clickOn(foreground);
- 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);
-}, "Tests that any pointer event on a non-inert element is correctly targeted to that element");
-
-promise_test(async () => {
- // Make the containing element inert - now events should go to "container"
- // which is the non-inert ancestor at the same position
- inertContainer.inert = true;
- await movePointerTo(0, 0);
-
- let promises = expectEventsOn(["pointerover", "pointerenter", "pointermove",
- "pointerdown", "pointerup" ],
- ancestorContainer);
-
- promises = promises.concat(unexpectEventsOn(["pointerout", "pointerleave"],
- ancestorContainer));
- await clickOn(foreground);
- 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);
-}, 'Tests that any pointer event on an inert element is targeted to the nearest non-inert ancestor at the same coordinates');
- </script>
-</body>
-</html>
Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/inert/inert-retargeting.tentative.html (283794 => 283795)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/inert/inert-retargeting.tentative.html 2021-10-08 07:57:33 UTC (rev 283794)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/inert/inert-retargeting.tentative.html 2021-10-08 08:25:52 UTC (rev 283795)
@@ -1,290 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src=""
-<script src=""
-<script src=""
-<script src=""
-<script src=""
-<style>
-button#foreground,
-button#background {
- position: absolute;
- top: 75px;
- left: 50px;
- width: 100px;
- height: 20px;
-}
-
-button#background {
- left: 75px;
- width: 150px;
- height: 40px;
- top: 125px;
- line-height: 53px;
-}
-
-.clicked {
- background-color: red;
-}
-
-#ancestorContainer.clicked {
- background-color: green;
-}
-
-#ancestorContainer {
- position: relative;
- width: 300px;
- height: 300px;
- background-color: blue;
-}
-
-#displacedAncestor {
- position: absolute;
- top: 13px;
- left: 240px;
- width: 300px;
- height: 250px;
- background-color: #ff89;
-}
-
-#displacedAncestor.clicked {
- background-color: #f009;
-}
-
-#inertContainer {
- background-color: #fff9;
- position: absolute;
- top: 35px;
- left: -192px;
- width: 200px;
- height: 200px;
-}
-
-fieldset {
- margin: 0;
- padding: 0;
- border: 1px solid black;
-}
-
-legend {
- background-color: white;
- border: 1px solid black;
- margin-left: 5px;
-}
-
-button.clicked::after {
- content: " (clicked)";
-}
-
-.clicked > legend::after {
- content: " (clicked)";
-}
-
-</style>
-</head>
-<body>
- <p>Click on "foreground".</p>
- <ul>
- <li>The blue square ("Non-inert ancestor container") should turn green.</li>
- <li>The yellow, semi-transparent square ("Non-inert, displaced container") should not turn red.</li>
- <li>"Non-inert button" should not turn red.</li>
- </ul>
- <p>(The full test suite checks a range of events.)</p>
- <fieldset id="ancestorContainer">
- <legend>Non-inert ancestor container</legend>
- <button id="background">background</button>
- <fieldset id="displacedAncestor">
- <legend>Non-inert, displaced ancestor</legend>
- <fieldset id="inertContainer" inert>
- <legend>Inert container</legend>
- <button id="foreground">foreground</button>
- </fieldset>
- </fieldset>
- </fieldset>
-
- <script>
-document.body.addEventListener('click', (e) => {
- e.target.classList.add('clicked');
-});
-
-function clickOn(element) {
- return new test_driver.Actions()
- .pointerMove(0, 0, {origin: element})
- .pointerDown({button: test_driver.Actions.prototype.ButtonType.LEFT})
- .pointerUp({button: test_driver.Actions.prototype.ButtonType.LEFT})
- .send();
-}
-
-function auxClickOn(element) {
- return new test_driver.Actions()
- .pointerMove(0, 0, {origin: element})
- .pointerDown({button: test_driver.Actions.prototype.ButtonType.RIGHT})
- .pointerUp({button: test_driver.Actions.prototype.ButtonType.RIGHT})
- .send();
-}
-
-function dblClickOn(element) {
- return new test_driver.Actions()
- .pointerMove(0, 0, {origin: element})
- .pointerDown({button: test_driver.Actions.prototype.ButtonType.LEFT})
- .pointerUp({button: test_driver.Actions.prototype.ButtonType.LEFT})
- .pointerDown({button: test_driver.Actions.prototype.ButtonType.LEFT})
- .pointerUp({button: test_driver.Actions.prototype.ButtonType.LEFT})
- .send();
-}
-
-function movePointerOver(element) {
- let rect = element.getBoundingClientRect();
- return new test_driver.Actions()
- .pointerMove(0, 0, { origin: element })
- .send();
-}
-
-function movePointerTo(x, y) {
- return new test_driver.Actions()
- .pointerMove(x, y, { origin: "viewport" })
- .send();
-}
-
-function expectEventsOn(events, element) {
- let promises = [];
- for (event of events) {
- ((event, element) => {
- var promise = new Promise((resolve, reject) => {
- let f = (e) => {
- assert_equals(e.type, event);
- assert_equals(e.target, element);
- resolve();
- }
- element.addEventListener(event, f, { capture: true, once: true });
-
- step_timeout(() => {
- element.removeEventListener(event, f, { capture: true });
- reject("did not get " + event + " on " + element.id);
- }, 1000);
- });
- promises.push(promise);
- })(event, element);
- }
- return promises;
-}
-
-function unexpectEventsOn(events, element) {
- let promises = [];
- for (event of events) {
- ((event, element) => {
- var promise = new Promise((resolve, reject) => {
- let f = (e) => {
- assert_equals(e.type, event);
- assert_equals(e.target, element);
- reject("got " + e.type + " on " + e.target.id);
- }
- element.addEventListener(event, f, { capture: true, once: true });
-
- step_timeout(() => {
- element.removeEventListener(event, f, { capture: true });
- resolve();
- }, 1000);
- });
- promises.push(promise);
- })(event, element);
- }
- return promises;
-}
-
-test(() => {
- let rect = foreground.getBoundingClientRect();
- let center_x = rect.left + (rect.width / 2);
- let center_y = rect.top + (rect.height / 2);
- assert_equals(document.elementsFromPoint(center_x, center_y)[0], foreground);
-}, "elementsFromPoint returns inert element");
-
-promise_test(async () => {
- // Test mouse events on non-inert element - events should go to "foreground"
- inertContainer.inert = false;
- await movePointerTo(0, 0);
- let promises = expectEventsOn(["mouseover", "mouseenter", "mousemove", "mousedown",
- "mouseup", "click", "auxclick", "mouseout",
- "mouseleave"],
- foreground);
- await clickOn(foreground);
- await auxClickOn(foreground);
- await dblClickOn(foreground);
- 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);
-}, "Tests that any mouse event on a non-inert element is correctly targeted to that element");
-
-promise_test(async () => {
- // Make the containing element inert - now events should go to "container"
- // which is the non-inert ancestor at the same position
- inertContainer.inert = true;
- await movePointerTo(0, 0);
-
- let promises = expectEventsOn(["mouseover", "mouseenter", "mousemove", "mousedown",
- "mouseup", "click", "auxclick"],
- ancestorContainer);
-
- // TODO(aboxhall): We are getting these unexpected events. Why?
- promises = promises.concat(unexpectEventsOn(["mouseout", "mouseleave"],
- ancestorContainer));
-
- await clickOn(foreground);
- await auxClickOn(foreground);
- await dblClickOn(foreground);
- 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);
-}, 'Tests that any mouse event on an inert element is targeted to the nearest non-inert ancestor at the same coordinates');
-
-promise_test(async () => {
- // Test pointer events on non-inert element - events should go to "foreground"
- inertContainer.inert = false;
- await movePointerTo(0, 0);
-
- let promises = expectEventsOn(["pointerover", "pointerenter", "pointermove",
- "pointerdown", "pointerup", "pointerout",
- "pointerleave"],
- foreground);
- await clickOn(foreground);
- 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);
-}, "Tests that any pointer event on a non-inert element is correctly targeted to that element");
-
-promise_test(async () => {
- // Make the containing element inert - now events should go to "container"
- // which is the non-inert ancestor at the same position
- inertContainer.inert = true;
- await movePointerTo(0, 0);
-
- let promises = expectEventsOn(["pointerover", "pointerenter", "pointermove",
- "pointerdown", "pointerup" ],
- ancestorContainer);
-
- // TODO(aboxhall): We are getting these unexpected events. Why?
- promises = promises.concat(unexpectEventsOn(["pointerout", "pointerleave"],
- ancestorContainer));
-
- await clickOn(foreground);
- 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);
-}, 'Tests that any pointer event on an inert element is targeted to the nearest non-inert ancestor at the same coordinates');
-
-</script>
-</body>
-</html>
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/inert/w3c-import.log (283794 => 283795)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/inert/w3c-import.log 2021-10-08 07:57:33 UTC (rev 283794)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/inert/w3c-import.log 2021-10-08 08:25:52 UTC (rev 283795)
@@ -14,6 +14,7 @@
None
------------------------------------------------------------------------
List of files:
+/LayoutTests/imported/w3c/web-platform-tests/inert/inert-computed-style.html
/LayoutTests/imported/w3c/web-platform-tests/inert/inert-does-not-match-disabled-selector.tentative.html
/LayoutTests/imported/w3c/web-platform-tests/inert/inert-in-shadow-dom.tentative.html
/LayoutTests/imported/w3c/web-platform-tests/inert/inert-inlines.tentative.html
@@ -23,5 +24,3 @@
/LayoutTests/imported/w3c/web-platform-tests/inert/inert-node-is-unselectable.tentative.html
/LayoutTests/imported/w3c/web-platform-tests/inert/inert-on-non-html.tentative.html
/LayoutTests/imported/w3c/web-platform-tests/inert/inert-on-slots.tentative.html
-/LayoutTests/imported/w3c/web-platform-tests/inert/inert-retargeting-iframe.tentative.html
-/LayoutTests/imported/w3c/web-platform-tests/inert/inert-retargeting.tentative.html