From 0ebb3a3bc371c463124bf81f217617831947dff8 Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Wed, 17 Jul 2024 21:26:42 +0100 Subject: [PATCH] Implement new dialog initial focus algorithm https://bugs.webkit.org/show_bug.cgi?id=250795 Reviewed by NOBODY (OOPS!). Updates the dialog focusing steps and the focus delegate steps to match latest spec. Spec PR: https://github.com/whatwg/html/pull/8199 * LayoutTests/fast/layers/layer-order-after-top-layer.html: * LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/child-sequential-focus-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-focus-shadow-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-showModal-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/focus-previous-iframe.tentative-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/show-modal-focusing-steps-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-focus-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-dialog-initial-focus-expected.txt: Removed. * LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-dialog-initial-focus.html: Removed. These tests no longer exist in upstream WPT repo. * Source/WebCore/dom/Element.cpp: (WebCore::Element::findFocusDelegateForTarget): * Source/WebCore/html/HTMLDialogElement.cpp: (WebCore::HTMLDialogElement::runFocusingSteps): (WebCore::HTMLDialogElement::supportsFocus const): * Source/WebCore/html/HTMLDialogElement.h: --- .../layers/layer-order-after-top-layer.html | 3 +- .../child-sequential-focus-expected.txt | 2 +- .../dialog-focus-shadow-expected.txt | 21 +++----- .../dialog-showModal-expected.txt | 4 +- ...cus-previous-iframe.tentative-expected.txt | 1 + .../show-modal-focusing-steps-expected.txt | 5 +- .../popover-dialog-initial-focus-expected.txt | 5 -- .../popover-dialog-initial-focus.html | 25 ---------- .../popovers/popover-focus-expected.txt | 50 +++++++++++++++++-- Source/WebCore/dom/Element.cpp | 3 ++ Source/WebCore/html/HTMLDialogElement.cpp | 7 ++- Source/WebCore/html/HTMLDialogElement.h | 1 + 12 files changed, 66 insertions(+), 61 deletions(-) delete mode 100644 LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-dialog-initial-focus-expected.txt delete mode 100644 LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-dialog-initial-focus.html diff --git a/LayoutTests/fast/layers/layer-order-after-top-layer.html b/LayoutTests/fast/layers/layer-order-after-top-layer.html index 83b0a10a477ce..665790a0202de 100644 --- a/LayoutTests/fast/layers/layer-order-after-top-layer.html +++ b/LayoutTests/fast/layers/layer-order-after-top-layer.html @@ -1,7 +1,6 @@