From 7e58a49e306020dbc50c235ad093356152b1d72b Mon Sep 17 00:00:00 2001 From: Mason Freed Date: Fri, 1 Apr 2022 12:52:50 -0700 Subject: [PATCH] Migrate focus handling logic from to Element [popup 7/7] This moves the focus management stuff out of HTMLPopupElement and into Element, to work with both and
. With this CL, all of the WPTs now pass, with the exception of the one for the anchor IDL property, which is an open issue [1]. [1] https://github.com/openui/open-ui/issues/382 Bug: 1307772 Change-Id: I0f475b52b1a14a910d267c7b681327f2e08976ac Cq-Do-Not-Cancel-Tryjobs: true Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3561291 Reviewed-by: David Baron Auto-Submit: Mason Freed Commit-Queue: David Baron Cr-Commit-Position: refs/heads/main@{#988069} --- html/semantics/popups/popup-focus.tentative.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/html/semantics/popups/popup-focus.tentative.html b/html/semantics/popups/popup-focus.tentative.html index 28dc0c90462fee..26b30b2865b575 100644 --- a/html/semantics/popups/popup-focus.tentative.html +++ b/html/semantics/popups/popup-focus.tentative.html @@ -11,13 +11,13 @@
-
+

This is a popup

-
+
-
+

This is a popup

@@ -38,7 +38,7 @@
-
+

This is a popup

@@ -129,14 +129,14 @@ button.remove(); }); popup.id = popupId; - button.setAttribute('popup', popupId); + button.setAttribute('triggerpopup', popupId); priorFocus.focus(); button.click(); assert_equals(document.activeElement, expectedFocusedElement, `${testName} activated by button.click()`); // Make sure we can directly focus the (already open) popup: popup.focus(); - assert_equals(document.activeElement, popup.hasAttribute('delegatesfocus') ? expectedFocusedElement : popup, `${testName} directly focus with popup.focus()`); + assert_equals(document.activeElement, popup.hasAttribute('tabindex') ? popup : expectedFocusedElement, `${testName} directly focus with popup.focus()`); popup.hidePopup(); }, "Popup focus test: " + testName); }