From 7c8a62b3fb262503351d9521c2657b871a3ddbaa Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Fri, 13 Dec 2024 03:19:10 +0000 Subject: [PATCH] Bug 1935232 [wpt PR 49528] - Update dialog closedby behavior to only close one at a time, a=testonly Automatic update from web-platform-tests Update dialog closedby behavior to only close one at a time Per the discussions at: - https://github.com/openui/open-ui/issues/1128 - https://github.com/whatwg/html/issues/9373#issuecomment-2490229365 both developer and editor feedback is that the prior behavior was a bit odd. In the case where there are "nested" dialogs, the desired behavior is for light dismiss clicks to just pop the topmost dialog off the stack, rather than trying to close all non-clicked dialogs. This CL implements that behavior and updates the test. After implementing this behavior and playing with it a bit, I agree with the feedback - this feels more like what users would expect. Once this lands and I get a bit of feedback, I'll incorporate this into the spec PR. Bug: 376516550 Change-Id: I4b5cfb7dd4a27fc304e52759d882b47394e55524 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6068807 Commit-Queue: David Baron Auto-Submit: Mason Freed Reviewed-by: David Baron Cr-Commit-Position: refs/heads/main{#1391794} -- wpt-commits: e96c4c3d5c6510202598f558ea520b80f9507b31 wpt-pr: 49528 UltraBlame original commit: 4079bdd253f749bea402e22f1929ca53a25c228b --- ...og-popover-closedby-complex.tentative.html | 172 +++++++++++------- 1 file changed, 108 insertions(+), 64 deletions(-) diff --git a/testing/web-platform/tests/html/semantics/interactive-elements/the-dialog-element/dialog-popover-closedby-complex.tentative.html b/testing/web-platform/tests/html/semantics/interactive-elements/the-dialog-element/dialog-popover-closedby-complex.tentative.html index 2f45e42d0ab5..a476ee1e3ae2 100644 --- a/testing/web-platform/tests/html/semantics/interactive-elements/the-dialog-element/dialog-popover-closedby-complex.tentative.html +++ b/testing/web-platform/tests/html/semantics/interactive-elements/the-dialog-element/dialog-popover-closedby-complex.tentative.html @@ -328,6 +328,13 @@ 0 ; } +dialog +{ +position +: +fixed +; +} < / style @@ -692,14 +699,50 @@ inside popoverA . +/ +/ +Either +way +both +popoverB +and +dialogB +should +close +. assertStates ( -false +true modalB false false ) ; +await +clickOn +( +unrelated +) +; +/ +/ +Clicking +outside +again +should +close +the +remaining +two +. +assertStates +( +false +false +false +false +) +; } clicking outside @@ -740,27 +783,14 @@ / Clicking popoverB -will +should keep -both -popovers -plus -the -intervening -dialogB -/ -/ +everything open -because -they -' -re -a -stack . assertStates ( -false +true true true true @@ -803,15 +833,16 @@ ; / / -dialogB -is -nested -inside -popoverA +Only +popoverB +should +be +light +dismissed . assertStates ( -false +true true true false @@ -854,45 +885,20 @@ ; / / -If -dialogB -is -modal -then -clicking -popoverA -is -actually -a -backdrop -/ -/ -click -on -dialogB -which -will -close -it -. -PopoverA -stays -open -because -/ -/ +Both dialogB -is -nested -inside -popoverA +and +popoverB +should +be +light +dismissed . assertStates ( -false true -! -modalB +true +false false ) ; @@ -928,26 +934,64 @@ await clickOn ( -dialogB +dialogA ) ; / / -Again -this +If +dialogB is -a -backdrop -click +modal +clicking +on +dialogA +is +actually +clicking on dialogB +/ +/ +which +means +popoverB +will +stay +open . assertStates ( -false true +modalB +false +false +) +; +await +clickOn +( +dialogA +) +; +/ +/ +The +next +click +on +dialogA +should +light +dismiss +popoverA +. +assertStates +( true false +false +false ) ; }