From e24e5570870c60ba45f6d043ce4ed3ca1f95e857 Mon Sep 17 00:00:00 2001 From: Mason Freed Date: Tue, 31 Jan 2023 11:35:39 -0800 Subject: [PATCH] Reland "Update popover post-toggle event naming and behavior" This is a reland of commit 2e5ee120d7fc5df4b6c101e88d03a5f62a73d8b8 It seems that the event coalescing behavior changes cause a segfault in the event dispatch code. This reland (compare to Patchset 1) just includes the event renaming, and not the new behavior. I'll land the new behavior in a separate CL to make it smaller if it gets reverted again. This part should be safe. Original change's description: > Update popover post-toggle event naming and behavior > > This CL updates the post-toggle event in the following ways: > 1. Rename the 'aftertoggle' event to 'toggle'. > 2. Rename PopoverToggleEvent to ToggleEvent. > 3. Rename the currentState attribute to oldState. > 4. Add event coalescing behavior. If two transitions occur before the > first 'toggle' event has been fired, cancel the first event and > queue a replacement that has oldState === newState. > > These changes were driven by the corresponding changes to the spec PR: > https://github.com/whatwg/html/pull/8717 > > Bug: 1307772 > Change-Id: Iabc5a9093d7cef3bbd6e54e488d8e571c51ea568 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4195120 > Auto-Submit: Mason Freed > Commit-Queue: Joey Arhar > Reviewed-by: Joey Arhar > Cr-Commit-Position: refs/heads/main@{#1098728} Bug: 1307772 Change-Id: Iede18bbf05516cec4ee881f1afc663c45380c82e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4205710 Reviewed-by: Joey Arhar Commit-Queue: Joey Arhar Auto-Submit: Mason Freed Cr-Commit-Position: refs/heads/main@{#1099397} --- .../popovers/idlharness.tentative.html | 12 +- .../popovers/popover-events.tentative.html | 120 ++++++++++--- .../toggleevent-interface.tentative.html | 164 +++++++++--------- interfaces/popover.tentative.idl | 10 +- 4 files changed, 186 insertions(+), 120 deletions(-) diff --git a/html/semantics/popovers/idlharness.tentative.html b/html/semantics/popovers/idlharness.tentative.html index d1a258bb4ad3ac..1cab891261cfd4 100644 --- a/html/semantics/popovers/idlharness.tentative.html +++ b/html/semantics/popovers/idlharness.tentative.html @@ -41,12 +41,12 @@ 'document.getElementById("b3")', ], BeforeToggleEvent: [ - 'new PopoverToggleEvent("beforetoggle")', - 'new PopoverToggleEvent("beforetoggle", {currentState: "open"})', - 'new PopoverToggleEvent("beforetoggle", {currentState: "open",newState: "open"})', - 'new PopoverToggleEvent("aftertoggle")', - 'new PopoverToggleEvent("aftertoggle", {currentState: "open"})', - 'new PopoverToggleEvent("aftertoggle", {currentState: "open",newState: "open"})', + 'new ToggleEvent("beforetoggle")', + 'new ToggleEvent("beforetoggle", {oldState: "open"})', + 'new ToggleEvent("beforetoggle", {oldState: "open",newState: "open"})', + 'new ToggleEvent("toggle")', + 'new ToggleEvent("toggle", {oldState: "open"})', + 'new ToggleEvent("toggle", {oldState: "open",newState: "open"})', ], }); } diff --git a/html/semantics/popovers/popover-events.tentative.html b/html/semantics/popovers/popover-events.tentative.html index b96a0f5a53f489..b299424570024c 100644 --- a/html/semantics/popovers/popover-events.tentative.html +++ b/html/semantics/popovers/popover-events.tentative.html @@ -10,6 +10,13 @@
Popover
diff --git a/html/semantics/popovers/toggleevent-interface.tentative.html b/html/semantics/popovers/toggleevent-interface.tentative.html index 4d437b0c0ad523..45709458b00c46 100644 --- a/html/semantics/popovers/toggleevent-interface.tentative.html +++ b/html/semantics/popovers/toggleevent-interface.tentative.html @@ -7,200 +7,200 @@