Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: be6ccb595147fa29f475bb2009a968c7a36975ec
      
https://github.com/WebKit/WebKit/commit/be6ccb595147fa29f475bb2009a968c7a36975ec
  Author: Aditya Keerthi <[email protected]>
  Date:   2025-06-18 (Wed, 18 Jun 2025)

  Changed paths:
    M Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
    M Source/WebKit/UIProcess/API/mac/WKWebViewMac.h
    M Source/WebKit/UIProcess/API/mac/WKWebViewMac.mm

  Log Message:
  -----------
  [macOS] Device Management password field in System Settings is not autofocused
https://bugs.webkit.org/show_bug.cgi?id=294655
rdar://147434540

Reviewed by Abrar Rahman Protyasha and Tim Horton.

When signing into a Managed Apple Account using the Device Management pane
in System Settings, users may be taken to a browser (Safari) for an
initial round of authentication.

When the user focuses the password field on the presented page, WebKit takes a
secure input assertion using `EnableSecureEventInput`. If the user then submits
the form using the enter key, the window is closed and the user is taken back to
System Settings to finally sign into their Managed Apple Account.

In this flow, the `WKWebView` is simply destroyed, and WebKit never releases the
input assertion. Since WebKit is holding onto an assertion, System Settings is
denied the right to be in front, and the native password field is not 
autofocused.

Fix by releasing the assertion when the web view is deallocated.

The issue does not occur when users click to submit the form in the browser, as
that removes focus from the password field, resulting in WebKit releasing the
assertion due to an editor state update.

* Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView dealloc]):
* Source/WebKit/UIProcess/API/mac/WKWebViewMac.h:
* Source/WebKit/UIProcess/API/mac/WKWebViewMac.mm:
(-[WKWebView _resetSecureInputState]):

`WebViewImpl::resetSecureInputState` checks that an assertion is held, and only
calls `DisableSecureEventInput` if necessary.

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to