From ffc66de0a506e8021aabb8ead458902123f466b2 Mon Sep 17 00:00:00 2001 From: Mason Freed Date: Fri, 2 Apr 2021 21:59:45 +0000 Subject: [PATCH] Bug 1702063 [wpt PR 28304] - Implement new behavior for invoking ("popup") elements, a=testonly Automatic update from web-platform-tests Implement new behavior for invoking ("popup") elements The previous code assumed all potential invoking elements formed part of the ancestor chain. With recent clarifications, only the element that actually invoked the popup should count as an invoking element. Bug: 1168738 Change-Id: I246de43b69770793d848c714ebda4aa9b316aaa6 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2795412 Commit-Queue: Mason Freed Commit-Queue: Ionel Popescu Auto-Submit: Mason Freed Reviewed-by: Ionel Popescu Cr-Commit-Position: refs/heads/master@{#867845} -- wpt-commits: 85bf675337914b8d2fec6ad184ee6c4474d6864c wpt-pr: 28304 --- .../popup-light-dismiss.tentative.html | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/testing/web-platform/tests/html/semantics/interactive-elements/the-popup-element/popup-light-dismiss.tentative.html b/testing/web-platform/tests/html/semantics/interactive-elements/the-popup-element/popup-light-dismiss.tentative.html index 613b659679d9..30e0c90adfbc 100644 --- a/testing/web-platform/tests/html/semantics/interactive-elements/the-popup-element/popup-light-dismiss.tentative.html +++ b/testing/web-platform/tests/html/semantics/interactive-elements/the-popup-element/popup-light-dismiss.tentative.html @@ -22,9 +22,18 @@ Inside popup 2 + +Inside popup 3 + + @@ -44,6 +53,11 @@ const outside = document.querySelector('#outside'); const inside1 = document.querySelector('#inside1'); const inside2 = document.querySelector('#inside2'); + const button3 = document.querySelector('#b3'); + const button4 = document.querySelector('#b4'); + const popup3 = document.querySelector('#p3'); + const popup4 = document.querySelector('#p4'); + const popup5 = document.querySelector('#p5'); (async function() { setup({ explicit_done: true }); @@ -107,6 +121,24 @@ assert_equals(popup1HideCount,p1HideCount); },'Clicking on anchor element shouldn\'t close its popup'); + await clickOn(button3); + assert_true(popup3.open,'invoking element should open popup'); + popup4.show(); + test(t => { + assert_true(popup4.open); + assert_true(popup3.open); + },'An invoking element should be part of the ancestor chain'); + + await clickOn(button3); + assert_true(popup3.open); + assert_false(popup4.open); + assert_false(popup5.open); + popup5.show(); + test(t => { + assert_true(popup5.open); + assert_false(popup3.open); + },'An invoking that was not used to invoke the popup should NOT be part of the ancestor chain'); + done(); })(); -- 2.11.4.GIT