Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0d359e074687d590e5888bf9beb8d0fe5d4986b4
      
https://github.com/WebKit/WebKit/commit/0d359e074687d590e5888bf9beb8d0fe5d4986b4
  Author: Abrar Rahman Protyasha <a_protya...@apple.com>
  Date:   2025-08-26 (Tue, 26 Aug 2025)

  Changed paths:
    M Source/WebKit/WebProcess/Plugins/PluginView.cpp
    M Source/WebKit/WebProcess/Plugins/PluginView.h
    M Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm
    M Source/WebKit/WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.mm
    M Source/WebKit/WebProcess/WebPage/WebPage.h
    M Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
    M Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.h
    M Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm
    M Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm
    M Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm

  Log Message:
  -----------
  [UnifiedPDF] VoiceOver does not recognize the password form
https://bugs.webkit.org/show_bug.cgi?id=297895
rdar://155907450

Reviewed by Tyler Wilcock.

When WebPage reports the presence of a main frame plugin, we
unconditionally reach for the AX object wrapper corresponding to the
plugin. This has the undesired effect of stealing AX away from general
web content, which is usually fine except when said web content is
presented over a plugin, as is the case for the password form for locked
documents.

In this patch, we teach WKAccessibilityWebPageObject that it may be
necessary to disregard the plugin AX object even when a main frame
plugin is present. We go with this approach over teaching the plugin's
AX object (WKAccessibilityPDFDocumentObject) about the password
annotations because (a) the concept of an active annotation is still not
platform agnostic and (b) it would introduce an unfortunate coordinate
transformation spaghetti inside the accessibility object since it will
have to undo some transformations performed on the hit test point.

More details in-line.

* Source/WebKit/WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::presentingLockedContent const):

Helper query that forwards PDFPluginBase::isLocked().

* Source/WebKit/WebProcess/Plugins/PluginView.h:
* Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::accessibilityObjectForMainFramePlugin):

This method has the same definition on all Cocoa platforms, so we
deduplicate.

(WebKit::WebPage::fallbackToWebContentAXObjectForMainFramePlugin const):

Introduce a query that allows our AX wrapper object finding logic to
look at web content, rather than the plugin's bespoke object. You could
imagine this being necessary for multiple conditions, but the only one
it abstracts away for now is the presence of a password form (i.e. if
the document is locked)

* Source/WebKit/WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.mm:
(-[WKAccessibilityWebPageObject accessibilityHitTest:]):

Multiple changes:
- Lift a clarifying comment from the macOS method definition about
  coordinate transformations for the plugin.
- Respect fallbackToWebContentAXObjectForMainFramePlugin and perform
  coordinate conversions regardless of main frame plugin presence as
  needed.
- Refactor the code so there is only one terminal call to hitTest:.

* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::accessibilityObjectForMainFramePlugin): Deleted.

Deduplicated this.

* Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.h:
* Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
(-[WKAccessibilityWebPageObjectBase 
fallbackToWebContentAXObjectForMainFramePlugin]):

Just forward WebPage::fallbackToWebContentAXObjectForMainFramePlugin().
Makes callsites a bit easier to read.

(-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper:]):

Respect fallbackToWebContentAXObjectForMainFramePlugin and return
general web content AX cache object when appropriate.

* Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityHitTest:]):

Same added logic and refactor as the iOS method definition.

* Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::accessibilityObjectForMainFramePlugin): Deleted.

Deduplicated this.

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



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

Reply via email to