AX: PDF plugin needs to support PDF-DOM Mode
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Apr 2017 16:26:21 +0000 (16:26 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Apr 2017 16:26:21 +0000 (16:26 +0000)
commitbb2685514e7c3f195679824a29b9503b4d23aeda
tree7bf2acf431639e061f645e08fbaad931c0cbe90d
parent08d6be140fcad55f3e4f1c17247abcfa5bba6115
AX: PDF plugin needs to support PDF-DOM Mode
https://bugs.webkit.org/show_bug.cgi?id=170589

Reviewed by Tim Horton.

Source/WebCore:

Provide WebCore support for accessibility connect to PDF document.
This includes the ability to connect a PDF annotation created node within WebKit to
 its PDFAnnotation parent (through use of shadowPluginParent).

* accessibility/AXObjectCache.h:
* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXPostNotificationWithUserInfo):
* accessibility/mac/WebAccessibilityObjectWrapperMac.h:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper shadowPluginParent]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
* html/HTMLAttributeNames.in:
* plugins/PluginViewBase.h:
(WebCore::PluginViewBase::accessibilityShadowPluginParentForElement):

Source/WebKit2:

Provide access to DOM objects with PDF document. This mean:
   1) Support a different set of attributes for WKPDFPluginAccessibilityObject.
        WKPDFPluginAccessibilityObject is now a group instead of forwarding attribute calls to the pdf layer.
   2) Connect the focused UI element to the active annotation if possible.
   3) Mark the PDF associated nodes with an attribute so they can be identified later so their correct parent can be found.

* WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
* WebProcess/Plugins/PDF/PDFPlugin.h:
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(-[WKPDFPluginAccessibilityObject pdfLayerController]):
(-[WKPDFPluginAccessibilityObject setPdfLayerController:]):
(-[WKPDFPluginAccessibilityObject convertRectToScreenSpace:]):
(-[WKPDFPluginAccessibilityObject accessibilityAttributeValue:]):
(-[WKPDFPluginAccessibilityObject accessibilityAttributeNames]):
(-[WKPDFPluginAccessibilityObject accessibilityActionNames]):
(-[WKPDFPluginAccessibilityObject accessibilityParameterizedAttributeNames]):
(-[WKPDFPluginAccessibilityObject accessibilityFocusedUIElement]):
(-[WKPDFPluginAccessibilityObject accessibilityAssociatedControlForAnnotation:]):
(-[WKPDFPluginAccessibilityObject accessibilityHitTest:]):
(WebKit::PDFPlugin::convertFromRootViewToPDFView):
(WebKit::PDFPlugin::convertFromPDFViewToScreen):
(WebKit::PDFPlugin::pluginHandlesContentOffsetForAccessibilityHitTest):
(WebKit::PDFPlugin::axObjectCache):
(WebKit::PDFPlugin::accessibilityShadowPluginParentForElement):
* WebProcess/Plugins/PDF/PDFPluginAnnotation.mm:
(WebKit::PDFPluginAnnotation::attach):
* WebProcess/Plugins/Plugin.h:
(WebKit::Plugin::accessibilityShadowPluginParentForElement):
(WebKit::Plugin::pluginHandlesContentOffsetForAccessibilityHitTest):
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::accessibilityShadowPluginParentForElement):
* WebProcess/Plugins/PluginView.h:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityHitTest:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215233 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AXObjectCache.h
Source/WebCore/accessibility/mac/AXObjectCacheMac.mm
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.h
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
Source/WebCore/html/HTMLAttributeNames.in
Source/WebCore/plugins/PluginViewBase.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/Plugins/PDF/PDFLayerControllerSPI.h
Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.h
Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm
Source/WebKit2/WebProcess/Plugins/PDF/PDFPluginAnnotation.mm
Source/WebKit2/WebProcess/Plugins/Plugin.h
Source/WebKit2/WebProcess/Plugins/PluginView.cpp
Source/WebKit2/WebProcess/Plugins/PluginView.h
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm