From 585e7d85280bba146331d7136373e2bd6dcd3318 Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Tue, 16 Jan 2024 01:43:37 +0000 Subject: [PATCH] Bug 1870961 [wpt PR 43737] - Update popover=hint behavior to allow a stack of hints, a=testonly Automatic update from web-platform-tests Update popover=hint behavior to allow a stack of hints The previous implementation only allowed one popover=hint to be open at a time. Per conversation at [1], developers feel that it should be possible to nest popover=hint popovers. This CL implements that capability. There are now two popover stacks in Document: PopoverAutoStack and PopoverHintStack. Since it is possible to nest hints within autos, the PopoverAutoStack can contain hints. However, there are a few constraints: - The PopoverHintStack only ever contains hints. - Once the PopoverAutoStack contains a hint, all subsequent popovers in the stack must also be hints. - A popover=hint can never be the ancestor of a popover=auto. The light dismiss behavior is roughly the same as before, with a slight tweak that simplifies behavior: closing anything in the PopoverAutoStack will always close everything in the PopoverHintStack. That was not the case before, but it was a bit of a weird corner case. Note that I found a crasher (happens in stable, with just auto popovers) that I added a test for here. The bug for that is crbug.com/1513282. I'll fix that in a followup. [1] https://github.com/whatwg/html/issues/9776#issuecomment-1785814179 Bug: 1416284,1513282 Change-Id: Ic064ecf1377bb8abfc812654c85016e6d1cbbdaf Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5133909 Reviewed-by: Joey Arhar Commit-Queue: Mason Freed Auto-Submit: Mason Freed Cr-Commit-Position: refs/heads/main{#1246573} -- wpt-commits: 51c87dc4c5d4a61caef22344e4dba6f5f233ffc3 wpt-pr: 43737 UltraBlame original commit: fcb792a0665afea5e736dd56c36dc1d59340362a --- .../popover-light-dismiss-hint.tentative.html | 1151 +++++++++++++++++ .../popovers/popover-light-dismiss.html | 527 -------- .../popovers/popover-open-in-event-crash.html | 179 +++ .../popover-types-with-hints.tentative.html | 1129 +++++----------- 4 files changed, 1668 insertions(+), 1318 deletions(-) create mode 100644 testing/web-platform/tests/html/semantics/popovers/popover-light-dismiss-hint.tentative.html create mode 100644 testing/web-platform/tests/html/semantics/popovers/popover-open-in-event-crash.html diff --git a/testing/web-platform/tests/html/semantics/popovers/popover-light-dismiss-hint.tentative.html b/testing/web-platform/tests/html/semantics/popovers/popover-light-dismiss-hint.tentative.html new file mode 100644 index 0000000000000..ea1e7bc3997a4 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/popovers/popover-light-dismiss-hint.tentative.html @@ -0,0 +1,1151 @@ +< +! +DOCTYPE +html +> +< +meta +charset += +" +utf +- +8 +" +/ +> +< +title +> +Popover +light +dismiss +behavior +for +hints +< +/ +title +> +< +meta +name += +" +timeout +" +content += +" +long +" +> +< +link +rel += +" +author +" +href += +" +mailto +: +masonf +chromium +. +org +" +> +< +link +rel += +help +href += +" +https +: +/ +/ +open +- +ui +. +org +/ +components +/ +popover +- +hint +. +research +. +explainer +" +> +< +script +src += +" +/ +resources +/ +testharness +. +js +" +> +< +/ +script +> +< +script +src += +" +/ +resources +/ +testharnessreport +. +js +" +> +< +/ +script +> +< +script +src += +" +/ +resources +/ +testdriver +. +js +" +> +< +/ +script +> +< +script +src += +" +/ +resources +/ +testdriver +- +actions +. +js +" +> +< +/ +script +> +< +script +src += +" +/ +resources +/ +testdriver +- +vendor +. +js +" +> +< +/ +script +> +< +script +src += +" +resources +/ +popover +- +utils +. +js +" +> +< +/ +script +> +< +div +id += +outside +> +< +/ +div +> +< +div +popover +id += +auto1 +> +auto +1 +< +div +popover +id += +auto2 +> +auto +2 +< +div +popover += +hint +id += +innerhint1 +> +inner +hint +1 +< +div +popover += +hint +id += +innerhint2 +> +inner +hint +2 +< +div +popover +id += +invalidauto1 +> +Improperly +nested +auto +1 +< +/ +div +> +< +/ +div +> +< +/ +div +> +< +/ +div +> +< +/ +div +> +< +div +popover += +hint +id += +hint1 +> +hint +1 +< +div +popover += +hint +id += +hint2 +> +hint +2 +< +div +popover +id += +invalidauto2 +> +Improperly +nested +auto +2 +< +/ +div +> +< +/ +div +> +< +/ +div +> +< +div +popover += +manual +id += +manual1 +> +Manual +< +/ +div +> +< +style +> +[ +popover +] +{ +right +: +auto +; +bottom +: +auto +; +} +# +auto1 +{ +left +: +100px +; +top +: +100px +; +} +# +auto2 +{ +left +: +100px +; +top +: +200px +; +} +# +innerhint1 +{ +left +: +100px +; +top +: +300px +; +} +# +innerhint2 +{ +left +: +100px +; +top +: +400px +; +} +# +invalidauto1 +{ +left +: +100px +; +top +: +500px +; +} +# +hint1 +{ +left +: +200px +; +top +: +100px +; +} +# +hint2 +{ +left +: +200px +; +top +: +200px +; +} +# +invalidauto1 +{ +left +: +200px +; +top +: +400px +; +} +# +manual1 +{ +left +: +300px +; +top +: +100px +; +} +# +outside +{ +width +: +25px +; +height +: +25px +} +< +/ +style +> +< +script +> +const +popovers += +[ +document +. +querySelector +( +' +# +auto1 +' +) +document +. +querySelector +( +' +# +auto2 +' +) +document +. +querySelector +( +' +# +innerhint1 +' +) +document +. +querySelector +( +' +# +innerhint2 +' +) +document +. +querySelector +( +' +# +hint1 +' +) +document +. +querySelector +( +' +# +hint2 +' +) +document +. +querySelector +( +' +# +manual1 +' +) +] +; +function +assertState +( +expectedState +description +) +{ +description += +description +| +| +' +Error +' +; +const +n += +popovers +. +length +; +assert_equals +( +expectedState +. +length +n +' +Invalid +' +) +; +for +( +let +i += +0 +; +i +< +n +; ++ ++ +i +) +{ +assert_equals +( +popovers +[ +i +] +. +matches +( +' +: +popover +- +open +' +) +expectedState +[ +i +] +{ +description +} +index +{ +i +} +( +{ +popovers +[ +i +] +. +id +} +) +) +; +} +} +function +openall +( +t +) +{ +/ +/ +All +popovers +can +be +open +at +once +if +shown +in +order +: +popovers +. +forEach +( +( +p +) += +> +p +. +hidePopover +( +) +) +; +popovers +. +forEach +( +( +p +) += +> +p +. +showPopover +( +) +) +; +assertState +( +Array +( +popovers +. +length +) +. +fill +( +true +) +' +All +popovers +should +be +able +to +be +open +at +once +' +) +; +t +. +add_cleanup +( +( +) += +> +popovers +. +forEach +( +( +p +) += +> +p +. +hidePopover +( +) +) +) +; +} +function +nvals +( +n +val +) +{ +return +new +Array +( +n +) +. +fill +( +val +) +; +} +for +( +let +i += +0 +; +i +< +( +popovers +. +length +- +1 +) +; ++ ++ +i +) +{ +promise_test +( +async +( +t +) += +> +{ +openall +( +t +) +; +await +clickOn +( +popovers +[ +i +] +) +; +let +expectedState += +[ +. +. +. +nvals +( +i ++ +1 +true +) +. +. +. +nvals +( +popovers +. +length +- +i +- +2 +false +) +true +] +; +assertState +( +expectedState +) +; +} +Mixed +auto +/ +hint +light +dismiss +behavior +click +on +{ +popovers +[ +i +] +. +id +} +) +; +} +promise_test +( +async +( +t +) += +> +{ +openall +( +t +) +; +await +clickOn +( +outside +) +; +assertState +( +[ +false +false +false +false +false +false +true +] +) +; +} +' +Clicking +outside +closes +all +' +) +; +promise_test +( +async +( +t +) += +> +{ +openall +( +t +) +; +invalidauto1 +. +showPopover +( +) +; +assertState +( +[ +true +true +false +false +false +false +true +] +' +auto +inside +hint +ignores +the +hints +and +gets +nested +within +auto2 +' +) +; +assert_true +( +invalidauto1 +. +matches +( +' +: +popover +- +open +' +) +' +the +inner +nested +auto +should +be +open +' +) +; +invalidauto1 +. +hidePopover +( +) +; +assertState +( +[ +true +true +false +false +false +false +true +] +) +; +assert_false +( +invalidauto1 +. +matches +( +' +: +popover +- +open +' +) +) +; +} +' +Auto +cannot +be +nested +inside +hint +( +invalidauto1 +) +' +) +; +promise_test +( +async +( +t +) += +> +{ +openall +( +t +) +; +invalidauto2 +. +showPopover +( +) +; +assertState +( +[ +false +false +false +false +false +false +true +] +' +auto +inside +hint +works +as +an +independent +( +non +- +nested +) +auto +' +) +; +assert_true +( +invalidauto2 +. +matches +( +' +: +popover +- +open +' +) +' +the +inner +nested +auto +should +be +open +' +) +; +invalidauto2 +. +hidePopover +( +) +; +assertState +( +[ +false +false +false +false +false +false +true +] +) +; +assert_false +( +invalidauto2 +. +matches +( +' +: +popover +- +open +' +) +) +; +} +' +Auto +cannot +be +nested +inside +hint +( +invalidauto2 +) +' +) +; +< +/ +script +> diff --git a/testing/web-platform/tests/html/semantics/popovers/popover-light-dismiss.html b/testing/web-platform/tests/html/semantics/popovers/popover-light-dismiss.html index e403355246ae6..5889e25582729 100644 --- a/testing/web-platform/tests/html/semantics/popovers/popover-light-dismiss.html +++ b/testing/web-platform/tests/html/semantics/popovers/popover-light-dismiss.html @@ -4855,533 +4855,6 @@ popover id = -p10 -> -Popover -< -/ -div -> -< -div -popover -= -hint -id -= -p11 -> -Hint -< -/ -div -> -< -div -popover -= -manual -id -= -p12 -> -Manual -< -/ -div -> -< -style -> -# -p10 -{ -top -: -100px -; -} -# -p11 -{ -top -: -200px -; -} -# -p12 -{ -top -: -300px -; -} -< -/ -style -> -< -script -> -if -( -popoverHintSupported -( -) -) -{ -promise_test -( -async -( -) -= -> -{ -const -auto -= -document -. -querySelector -( -' -# -p10 -' -) -; -const -hint -= -document -. -querySelector -( -' -# -p11 -' -) -; -const -manual -= -document -. -querySelector -( -' -# -p12 -' -) -; -/ -/ -All -three -can -be -open -at -once -if -shown -in -this -order -: -auto -. -showPopover -( -) -; -hint -. -showPopover -( -) -; -manual -. -showPopover -( -) -; -assert_true -( -auto -. -matches -( -' -: -popover -- -open -' -) -) -; -assert_true -( -hint -. -matches -( -' -: -popover -- -open -' -) -) -; -assert_true -( -manual -. -matches -( -' -: -popover -- -open -' -) -) -; -/ -/ -Clicking -the -hint -will -close -the -auto -but -not -the -manual -. -await -clickOn -( -hint -) -; -assert_false -( -auto -. -matches -( -' -: -popover -- -open -' -) -' -auto -should -be -hidden -' -) -; -assert_true -( -hint -. -matches -( -' -: -popover -- -open -' -) -' -hint -should -stay -open -' -) -; -assert_true -( -manual -. -matches -( -' -: -popover -- -open -' -) -' -manual -does -not -light -dismiss -' -) -; -/ -/ -Clicking -outside -should -close -the -hint -but -not -the -manual -: -await -clickOn -( -outside -) -; -assert_false -( -auto -. -matches -( -' -: -popover -- -open -' -) -) -; -assert_false -( -hint -. -matches -( -' -: -popover -- -open -' -) -' -hint -should -close -' -) -; -assert_true -( -manual -. -matches -( -' -: -popover -- -open -' -) -' -manual -does -not -light -dismiss -' -) -; -manual -. -hidePopover -( -) -; -assert_false -( -manual -. -matches -( -' -: -popover -- -open -' -) -) -; -auto -. -showPopover -( -) -; -hint -. -showPopover -( -) -; -assert_true -( -auto -. -matches -( -' -: -popover -- -open -' -) -) -; -assert_true -( -hint -. -matches -( -' -: -popover -- -open -' -) -) -; -/ -/ -Clicking -on -the -auto -should -close -the -hint -: -await -clickOn -( -auto -) -; -assert_true -( -auto -. -matches -( -' -: -popover -- -open -' -) -' -auto -should -stay -open -' -) -; -assert_false -( -hint -. -matches -( -' -: -popover -- -open -' -) -' -hint -should -light -dismiss -' -) -; -auto -. -hidePopover -( -) -; -assert_false -( -auto -. -matches -( -' -: -popover -- -open -' -) -) -; -} -' -Light -dismiss -of -mixed -popover -types -including -hints -' -) -; -} -< -/ -script -> -< -div -popover -id -= p13 > Popover diff --git a/testing/web-platform/tests/html/semantics/popovers/popover-open-in-event-crash.html b/testing/web-platform/tests/html/semantics/popovers/popover-open-in-event-crash.html new file mode 100644 index 0000000000000..9227f11c35ddc --- /dev/null +++ b/testing/web-platform/tests/html/semantics/popovers/popover-open-in-event-crash.html @@ -0,0 +1,179 @@ +< +! +DOCTYPE +html +> +< +meta +charset += +" +utf +- +8 +" +/ +> +< +link +rel += +" +author +" +href += +" +mailto +: +masonf +chromium +. +org +" +> +< +link +rel += +help +href += +" +https +: +/ +/ +html +. +spec +. +whatwg +. +org +/ +multipage +/ +popover +. +html +# +attr +- +popover +" +> +< +div +popover +id += +p1 +> +Popover +1 +< +div +popover +id += +p2 +> +Popover +2 +< +/ +div +> +< +/ +div +> +< +script +> +const +p1 += +document +. +querySelector +( +' +# +p1 +' +) +; +const +p2 += +document +. +querySelector +( +' +# +p2 +' +) +; +p1 +. +addEventListener +( +' +beforetoggle +' +e += +> +{ +if +( +e +. +newState += += += +" +closed +" +) +{ +p2 +. +showPopover +( +) +; +} +} +) +p1 +. +showPopover +( +) +; +p1 +. +hidePopover +( +) +; +/ +/ +This +test +passes +if +it +does +not +crash +< +/ +script +> diff --git a/testing/web-platform/tests/html/semantics/popovers/popover-types-with-hints.tentative.html b/testing/web-platform/tests/html/semantics/popovers/popover-types-with-hints.tentative.html index 88cf15c7a3748..92137d73534cc 100644 --- a/testing/web-platform/tests/html/semantics/popovers/popover-types-with-hints.tentative.html +++ b/testing/web-platform/tests/html/semantics/popovers/popover-types-with-hints.tentative.html @@ -93,6 +93,167 @@ script > < +script +> +function +getPopovers +( +) +{ +return +Array +. +from +( +document +. +currentScript +. +parentElement +. +querySelectorAll +( +' +[ +popover +] +' +) +) +; +} +function +assertState +( +expectedState +description +) +{ +description += +description +| +| +' +Error +' +; +const +popovers += +getPopovers +( +) +; +const +n += +popovers +. +length +; +assert_equals +( +expectedState +. +length +n +' +Invalid +expected +state +length +' +) +; +for +( +let +i += +0 +; +i +< +n +; ++ ++ +i +) +{ +const +html += +' +< +' ++ +popovers +[ +i +] +. +outerHTML +. +split +( +' +< +' +) +[ +1 +] ++ +' +< +/ +div +> +' +; +assert_equals +( +popovers +[ +i +] +. +matches +( +' +: +popover +- +open +' +) +expectedState +[ +i +] +{ +description +} +index +{ +i +} +( +{ +html +} +) +) +; +} +} +< +/ +script +> +< div > < @@ -144,192 +305,43 @@ const auto = -document -. -currentScript -. -parentElement -. -querySelector +getPopovers ( -' +) [ -popover -= -" -" +0 ] -' -) ; const hint = -document -. -currentScript -. -parentElement -. -querySelector +getPopovers ( -' +) [ -popover -= -hint +1 ] -' -) ; const manual = -document -. -currentScript -. -parentElement -. -querySelectorAll +getPopovers ( -' -[ -popover -= -manual -] -' ) [ -0 +2 ] ; const manual2 = -document -. -currentScript -. -parentElement -. -querySelectorAll +getPopovers ( -' -[ -popover -= -manual -] -' ) [ -1 +3 ] ; -function -assert_state_1 -( -autoOpen -hintOpen -manualOpen -manual2Open -) -{ -assert_equals -( -auto -. -matches -( -' -: -popover -- -open -' -) -autoOpen -' -auto -open -state -is -incorrect -' -) -; -assert_equals -( -hint -. -matches -( -' -: -popover -- -open -' -) -hintOpen -' -hint -open -state -is -incorrect -' -) -; -assert_equals -( -manual -. -matches -( -' -: -popover -- -open -' -) -manualOpen -' -manual -open -state -is -incorrect -' -) -; -assert_equals -( -manual2 -. -matches -( -' -: -popover -- -open -' -) -manual2Open -' -manual2 -open -state -is -incorrect -' -) -; -} test ( ( @@ -337,12 +349,14 @@ = > { -assert_state_1 +assertState ( +[ false false false false +] ) ; auto @@ -351,12 +365,14 @@ ( ) ; -assert_state_1 +assertState ( +[ true false false false +] ) ; hint @@ -365,12 +381,14 @@ ( ) ; -assert_state_1 +assertState ( +[ true true false false +] ) ; manual @@ -379,12 +397,14 @@ ( ) ; -assert_state_1 +assertState ( +[ true true true false +] ) ; manual2 @@ -393,12 +413,14 @@ ( ) ; -assert_state_1 +assertState ( +[ true true true true +] ) ; hint @@ -407,12 +429,14 @@ ( ) ; -assert_state_1 +assertState ( +[ true false true true +] ) ; auto @@ -421,12 +445,14 @@ ( ) ; -assert_state_1 +assertState ( +[ false false true true +] ) ; auto @@ -441,12 +467,14 @@ ( ) ; -assert_state_1 +assertState ( +[ true true true true +] ) ; auto @@ -455,27 +483,14 @@ ( ) ; -/ -/ -Non -- -nested -tooltips -can -stay -open -when -unrelated -popovers -are -hidden -. -assert_state_1 +assertState ( +[ +false false true true -true +] ) ; hint @@ -490,12 +505,14 @@ ( ) ; -assert_state_1 +assertState ( +[ false false false true +] ) ; manual2 @@ -504,12 +521,14 @@ ( ) ; -assert_state_1 +assertState ( +[ false false false false +] ) ; } @@ -529,12 +548,14 @@ = > { -assert_state_1 +assertState ( +[ false false false false +] ) ; hint @@ -555,12 +576,14 @@ ( ) ; -assert_state_1 +assertState ( +[ false true true true +] ) ; auto @@ -569,12 +592,14 @@ ( ) ; -assert_state_1 +assertState ( +[ true false true true +] ) ; auto @@ -583,12 +608,14 @@ ( ) ; -assert_state_1 +assertState ( +[ false false true true +] ) ; manual @@ -603,12 +630,14 @@ ( ) ; -assert_state_1 +assertState ( +[ false false false false +] ) ; } @@ -699,22 +728,8 @@ const popover1 = -document -. -currentScript -. -parentElement -. -querySelectorAll +getPopovers ( -' -[ -popover -= -" -" -] -' ) [ 0 @@ -722,174 +737,34 @@ ; const popover2 -= -document -. -currentScript -. -parentElement -. -querySelectorAll -( -' -[ -popover -= -" -" -] -' -) -[ -1 -] -; -const -popover3 -= -document -. -currentScript -. -parentElement -. -querySelectorAll -( -' -[ -popover -= -" -" -] -' -) -[ -2 -] -; -const -hint -= -document -. -currentScript -. -parentElement -. -querySelector -( -' -[ -popover -= -hint -] -' -) -; -function -assert_state_2 -( -popover1Open -popover2Open -popover3Open -hintOpen -) -{ -assert_equals -( -popover1 -. -matches -( -' -: -popover -- -open -' -) -popover1Open -' -popover1 -open -state -is -incorrect -' -) -; -assert_equals -( -popover2 -. -matches -( -' -: -popover -- -open -' -) -popover2Open -' -popover2 -open -state -is -incorrect -' -) -; -assert_equals -( -popover3 -. -matches += +getPopovers ( -' -: -popover -- -open -' ) -popover3Open -' +[ +1 +] +; +const popover3 -open -state -is -incorrect -' += +getPopovers +( ) +[ +2 +] ; -assert_equals -( +const hint -. -matches += +getPopovers ( -' -: -popover -- -open -' -) -hintOpen -' -hint -open -state -is -incorrect -' ) +[ +3 +] ; -} test ( ( @@ -897,12 +772,14 @@ = > { -assert_state_2 +assertState ( +[ false false false false +] ) ; popover1 @@ -923,12 +800,14 @@ ( ) ; -assert_state_2 +assertState ( +[ true true true false +] ) ; hint @@ -949,12 +828,14 @@ should be hidden -assert_state_2 +assertState ( +[ true true false true +] ) ; popover1 @@ -974,12 +855,14 @@ anchored to popover2 -assert_state_2 +assertState ( +[ false false false false +] ) ; } @@ -1044,21 +927,8 @@ const hint1 = -document -. -currentScript -. -parentElement -. -querySelectorAll +getPopovers ( -' -[ -popover -= -hint -] -' ) [ 0 @@ -1067,21 +937,8 @@ const hint2 = -document -. -currentScript -. -parentElement -. -querySelectorAll +getPopovers ( -' -[ -popover -= -hint -] -' ) [ 1 @@ -1093,34 +950,12 @@ ( ) ; -assert_true -( -hint1 -. -matches -( -' -: -popover -- -open -' -) -) -; -assert_false -( -hint2 -. -matches +assertState ( -' -: -popover -- -open -' -) +[ +true +false +] ) ; hint2 @@ -1129,76 +964,35 @@ ( ) ; -assert_false -( -hint1 -. -matches +assertState ( -' -: -popover -- -open -' -) +[ +true +true +] ) ; -assert_true -( -hint2 +hint1 . -matches +hidePopover ( -' -: -popover -- -open -' -) ) ; -hint2 -. -hidePopover +assertState ( +[ +false +false +] ) ; } ' -If -a -popover -= -hint -is -shown -it -should -hide -any -other -open -popover -= -hint -popovers -including -ancestral -popovers -. -( You can -\ -' -t nest -popover -= hint -) +popovers ' ) ; @@ -1261,43 +1055,22 @@ const hint = -document -. -currentScript -. -parentElement -. -querySelector +getPopovers ( -' +) [ -popover -= -hint +0 ] -' -) ; const auto = -document -. -currentScript -. -parentElement -. -querySelector +getPopovers ( -' +) [ -popover -= -" -" +1 ] -' -) ; hint . @@ -1305,34 +1078,12 @@ ( ) ; -assert_true -( -hint -. -matches -( -' -: -popover -- -open -' -) -) -; -assert_false -( -auto -. -matches +assertState ( -' -: -popover -- -open -' -) +[ +true +false +] ) ; auto @@ -1341,34 +1092,12 @@ ( ) ; -assert_false -( -hint -. -matches -( -' -: -popover -- -open -' -) -) -; -assert_true -( -auto -. -matches +assertState ( -' -: -popover -- -open -' -) +[ +false +true +] ) ; auto @@ -1377,6 +1106,14 @@ ( ) ; +assertState +( +[ +false +false +] +) +; } ' If @@ -1485,22 +1222,8 @@ const auto = -document -. -currentScript -. -parentElement -. -querySelectorAll +getPopovers ( -' -[ -popover -= -" -" -] -' ) [ 0 @@ -1509,22 +1232,8 @@ const auto2 = -document -. -currentScript -. -parentElement -. -querySelectorAll +getPopovers ( -' -[ -popover -= -" -" -] -' ) [ 1 @@ -1533,22 +1242,12 @@ const hint = -document -. -currentScript -. -parentElement -. -querySelector +getPopovers ( -' +) [ -popover -= -hint +2 ] -' -) ; auto . @@ -1562,34 +1261,13 @@ ( ) ; -assert_true -( -auto -. -matches -( -' -: -popover -- -open -' -) -) -; -assert_true -( -auto2 -. -matches +assertState ( -' -: -popover -- -open -' -) +[ +true +true +false +] ) ; hint @@ -1611,49 +1289,13 @@ in auto1 . -assert_true -( -auto -. -matches -( -' -: -popover -- -open -' -) -) -; -assert_false -( -auto2 -. -matches -( -' -: -popover -- -open -' -) -) -; -assert_true -( -hint -. -matches +assertState ( -' -: -popover -- -open -' -) +[ +true +false +true +] ) ; auto @@ -1671,34 +1313,13 @@ and hint . -assert_false +assertState ( -auto -. -matches -( -' -: -popover -- -open -' -) -) -; -assert_false -( -hint -. -matches -( -' -: -popover -- -open -' -) +[ +false +false +false +] ) ; } @@ -1809,43 +1430,21 @@ const auto = -document -. -currentScript -. -parentElement -. -querySelector +getPopovers ( -' +) [ -popover -= -" -" +0 ] -' -) -; const hint = -document -. -currentScript -. -parentElement -. -querySelector +getPopovers ( -' +) [ -popover -= -hint +1 ] -' -) ; auto . @@ -1859,34 +1458,12 @@ ( ) ; -assert_true -( -auto -. -matches -( -' -: -popover -- -open -' -) -) -; -assert_true -( -hint -. -matches +assertState ( -' -: -popover -- -open -' -) +[ +true +true +] ) ; auto @@ -1895,40 +1472,12 @@ ( ) ; -assert_false -( -auto -. -matches -( -' -: -popover -- -open -' -) -) -; -assert_true -( -hint -. -matches -( -' -: -popover -- -open -' -) -) -; -hint -. -hidePopover +assertState ( +[ +false +false +] ) ; } @@ -1975,8 +1524,7 @@ T should be -left -showing +hidden . ( Non @@ -1985,9 +1533,8 @@ popover = hint -can -stay -open +gets +hidden when unrelated popover