Branch: refs/heads/webkitglib/2.54
  Home:   https://github.com/WebKit/WebKit
  Commit: b9cb3459aa14d526eb11597c3dcde51d377dc8e0
      
https://github.com/WebKit/WebKit/commit/b9cb3459aa14d526eb11597c3dcde51d377dc8e0
  Author: Karl Dubost <[email protected]>
  Date:   2026-08-07 (Fri, 07 Aug 2026)

  Changed paths:
    A 
LayoutTests/fast/selectors/focus-visible-script-focus-after-dialog-dismiss-expected.txt
    A 
LayoutTests/fast/selectors/focus-visible-script-focus-after-dialog-dismiss.html
    A 
LayoutTests/fast/selectors/focus-visible-script-focus-inside-focused-ancestor-expected.txt
    A 
LayoutTests/fast/selectors/focus-visible-script-focus-inside-focused-ancestor.html
    M Source/WebCore/page/EventHandler.cpp

  Log Message:
  -----------
  Cherry-pick 318775@main (a1678ffa5ff1). 
https://bugs.webkit.org/show_bug.cgi?id=321157

Unreviewed backport.

    REGRESSION(311768@main): :focus-visible incorrectly shown after focus() 
inside a focused ancestor
    https://bugs.webkit.org/show_bug.cgi?id=321157
    rdar://181570771

    Reviewed by Abrar Rahman Protyasha.

    Buttons are not mouse-focusable on macOS/iOS, so a workaround records
    that the last focus trigger was a click. 311768@main stopped that
    workaround from running when the clicked button sits inside an ancestor
    that can take focus, such as a <dialog>. Usually the ancestor is focused
    instead and the click is recorded there, but not when it is already
    focused. Nothing recorded the click, so the programmatic focus() that
    followed showed :focus-visible.

    music.apple.com opens its now-playing player as a <dialog>. Dismissing
    it left a red focus ring on the mini player.

    Walk the ancestors only up to the element that will be focused, instead
    of skipping the workaround whenever there is one.

    Tests: fast/selectors/focus-visible-script-focus-after-dialog-dismiss.html
           
fast/selectors/focus-visible-script-focus-inside-focused-ancestor.html

    * 
LayoutTests/fast/selectors/focus-visible-script-focus-after-dialog-dismiss-expected.txt:
 Added.
    * 
LayoutTests/fast/selectors/focus-visible-script-focus-after-dialog-dismiss.html:
 Added.
    * 
LayoutTests/fast/selectors/focus-visible-script-focus-inside-focused-ancestor-expected.txt:
 Added.
    * 
LayoutTests/fast/selectors/focus-visible-script-focus-inside-focused-ancestor.html:
 Added.
    * Source/WebCore/page/EventHandler.cpp:
    (WebCore::EventHandler::dispatchMouseEvent):

    Canonical link: https://commits.webkit.org/318775@main

Canonical link: https://commits.webkit.org/317695.70@webkitglib/2.54



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to