From 5f09d1878deeda64ef0c4ee171f80726a6a60ea5 Mon Sep 17 00:00:00 2001 From: Mason Freed Date: Fri, 27 Jan 2023 17:39:12 -0800 Subject: [PATCH] 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 --- .../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 d1a258bb4ad3ac3..1cab891261cfd46 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 b96a0f5a53f489d..b299424570024c8 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 4d437b0c0ad523c..45709458b00c466 100644 --- a/html/semantics/popovers/toggleevent-interface.tentative.html +++ b/html/semantics/popovers/toggleevent-interface.tentative.html @@ -7,200 +7,200 @@