• cfleizach@apple.com's avatar
    WK2: Support Accessibility · aa50410b
    cfleizach@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=51859
    
    Reviewed by Sam Weinig.
    
    Tools: 
    
    Use rootObject() method to get top of accessibility tree.
    
    * DumpRenderTree/mac/AccessibilityControllerMac.mm:
    (AccessibilityController::focusedElement):
    (AccessibilityController::rootElement):
    
    WebCore: 
    
    WK2 doesn't use platform scroll views anymore. Accessibility code
    needs to have its own scroll views. 
    
    Test: platform/mac/accessibility/webkit-scrollarea.html
    
    * CMakeLists.txt:
    * GNUmakefile.am:
    * WebCore.exp.in:
    * WebCore.gypi:
    * WebCore.pro:
    * WebCore.vcproj/WebCore.vcproj:
    * WebCore.xcodeproj/project.pbxproj:
    * accessibility/AXObjectCache.cpp:
    (WebCore::AXObjectCache::AXObjectCache):
    (WebCore::AXObjectCache::get):
    (WebCore::AXObjectCache::getOrCreate):
    (WebCore::AXObjectCache::rootObject):
    (WebCore::AXObjectCache::remove):
    (WebCore::AXObjectCache::handleScrollbarUpdate):
    * accessibility/AXObjectCache.h:
    (WebCore::AXObjectCache::handleScrollbarUpdate):
    * accessibility/AccessibilityARIAGrid.h:
    * accessibility/AccessibilityAllInOne.cpp:
    * accessibility/AccessibilityImageMapLink.cpp:
    * accessibility/AccessibilityImageMapLink.h:
    * accessibility/AccessibilityListBoxOption.cpp:
    * accessibility/AccessibilityListBoxOption.h:
    * accessibility/AccessibilityObject.cpp:
    (WebCore::AccessibilityObject::updateChildrenIfNecessary):
    (WebCore::AccessibilityObject::elementAccessibilityHitTest):
    (WebCore::AccessibilityObject::axObjectCache):
    (WebCore::AccessibilityObject::focusedUIElement):
    * accessibility/AccessibilityObject.h:
    (WebCore::AccessibilityObject::isAccessibilityScrollView):
    (WebCore::AccessibilityObject::isScrollView):
    (WebCore::AccessibilityObject::canSetNumericValue):
    (WebCore::AccessibilityObject::scrollBar):
    (WebCore::AccessibilityObject::size):
    (WebCore::AccessibilityObject::setValue):
    * accessibility/AccessibilityRenderObject.cpp:
    (WebCore::AccessibilityRenderObject::parentObject):
    (WebCore::AccessibilityRenderObject::accessibilityHitTest):
    (WebCore::AccessibilityRenderObject::updateChildrenIfNecessary):
    (WebCore::AccessibilityRenderObject::addChildren):
    * accessibility/AccessibilityRenderObject.h:
    * accessibility/AccessibilityScrollView.cpp: Added.
    (WebCore::AccessibilityScrollView::AccessibilityScrollView):
    (WebCore::AccessibilityScrollView::create):
    (WebCore::AccessibilityScrollView::scrollBar):
    (WebCore::AccessibilityScrollView::children):
    (WebCore::AccessibilityScrollView::updateChildrenIfNecessary):
    (WebCore::AccessibilityScrollView::removeChildScrollbar):
    (WebCore::AccessibilityScrollView::addChildScrollbar):
    (WebCore::AccessibilityScrollView::addChildren):
    (WebCore::AccessibilityScrollView::webAreaObject):
    (WebCore::AccessibilityScrollView::accessibilityHitTest):
    (WebCore::AccessibilityScrollView::document):
    (WebCore::AccessibilityScrollView::elementRect):
    (WebCore::AccessibilityScrollView::parentObject):
    * accessibility/AccessibilityScrollView.h: Added.
    (WebCore::AccessibilityScrollView::roleValue):
    (WebCore::AccessibilityScrollView::scrollView):
    (WebCore::AccessibilityScrollView::accessibilityIsIgnored):
    (WebCore::AccessibilityScrollView::isAccessibilityScrollView):
    (WebCore::toAccessibilityScrollView):
    * accessibility/AccessibilityScrollbar.cpp:
    (WebCore::AccessibilityScrollbar::AccessibilityScrollbar):
    (WebCore::AccessibilityScrollbar::create):
    (WebCore::AccessibilityScrollbar::elementRect):
    (WebCore::AccessibilityScrollbar::document):
    (WebCore::AccessibilityScrollbar::orientation):
    (WebCore::AccessibilityScrollbar::isEnabled):
    (WebCore::AccessibilityScrollbar::valueForRange):
    (WebCore::AccessibilityScrollbar::setValue):
    * accessibility/AccessibilityScrollbar.h:
    (WebCore::AccessibilityScrollbar::setParent):
    (WebCore::AccessibilityScrollbar::canSetValueAttribute):
    (WebCore::AccessibilityScrollbar::canSetNumericValue):
    (WebCore::AccessibilityScrollbar::isAccessibilityScrollbar):
    (WebCore::AccessibilityScrollbar::parentObject):
    (WebCore::AccessibilityScrollbar::roleValue):
    * accessibility/mac/AccessibilityObjectMac.mm:
    (WebCore::AccessibilityObject::accessibilityIgnoreAttachment):
    * accessibility/mac/AccessibilityObjectWrapper.mm:
    (-[AccessibilityObjectWrapper accessibilityAttributeNames]):
    (-[AccessibilityObjectWrapper remoteAccessibilityParentObject]):
    (-[AccessibilityObjectWrapper position]):
    (-[AccessibilityObjectWrapper scrollViewParent]):
    (-[AccessibilityObjectWrapper accessibilityAttributeValue:]):
    (-[AccessibilityObjectWrapper accessibilityHitTest:]):
    (-[AccessibilityObjectWrapper accessibilitySetValue:forAttribute:]):
    * dom/Document.cpp:
    (WebCore::Document::axObjectCache):
    * loader/EmptyClients.h:
    (WebCore::EmptyFrameLoaderClient::accessibilityRemoteObject):
    * loader/FrameLoaderClient.h:
    * page/FrameView.cpp:
    (WebCore::FrameView::~FrameView):
    (WebCore::FrameView::axObjectCache):
    * page/FrameView.h:
    * platform/ScrollView.cpp:
    (WebCore::ScrollView::setHasHorizontalScrollbar):
    (WebCore::ScrollView::setHasVerticalScrollbar):
    * platform/Scrollbar.cpp:
    (WebCore::Scrollbar::~Scrollbar):
    (WebCore::Scrollbar::scroll):
    (WebCore::Scrollbar::axObjectCache):
    * platform/Scrollbar.h:
    * platform/Widget.h:
    (WebCore::Widget::axObjectCache):
    
    WebKit/gtk: 
    
    Use rootObject() method to get top of ax tree.
    
    * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
    (DumpRenderTreeSupportGtk::getFocusedAccessibleElement):
    * webkit/webkitwebview.cpp:
    (webkit_web_view_get_accessible):
    
    WebKit/mac: 
    
    Use rootObject() method to get top of AX tree.
    
    * WebCoreSupport/WebFrameLoaderClient.h:
    (WebFrameLoaderClient::accessibilityRemoteObject):
    * WebView/WebFrame.mm:
    (-[WebFrame setAccessibleName:]):
    (-[WebFrame accessibilityRoot]):
    * WebView/WebFrameInternal.h:
    * WebView/WebFramePrivate.h:
    * WebView/WebHTMLView.mm:
    (-[WebHTMLView accessibilityAttributeValue:]):
    (-[WebHTMLView accessibilityFocusedUIElement]):
    (-[WebHTMLView accessibilityHitTest:]):
    (-[WebHTMLView _accessibilityParentForSubview:]):
    
    WebKit/win: 
    
    Use rootObject() method to get the top of the AX tree.
    
    * AccessibleDocument.cpp:
    (AccessibleDocument::AccessibleDocument):
    
    WebKit2: 
    
    Implement remote accessibility API to support cross process accessibility
    on the Mac platform.
    
    * Shared/WebProcessCreationParameters.cpp:
    (WebKit::WebProcessCreationParameters::encode):
    (WebKit::WebProcessCreationParameters::decode):
    * Shared/WebProcessCreationParameters.h:
    * UIProcess/API/mac/PageClientImpl.h:
    * UIProcess/API/mac/PageClientImpl.mm:
    (WebKit::PageClientImpl::accessibilityChildTokenReceived):
    * UIProcess/API/mac/WKView.mm:
    (-[WKView initWithFrame:contextRef:pageGroupRef:]):
    (-[WKView _updateWindowAndViewFrames]):
    (-[WKView _setAccessibilityChildToken:]):
    (-[WKView accessibilityIsIgnored]):
    (-[WKView accessibilityHitTest:]):
    (-[WKView accessibilityAttributeValue:]):
    * UIProcess/API/mac/WKViewInternal.h:
    * UIProcess/PageClient.h:
    * UIProcess/WebContext.cpp:
    (WebKit::WebContext::ensureWebProcess):
    * UIProcess/WebPageProxy.cpp:
    (WebKit::WebPageProxy::windowAndViewFramesChanged):
    (WebKit::WebPageProxy::didReceiveAccessibilityPageToken):
    (WebKit::WebPageProxy::sendAccessibilityPresenterToken):
    * UIProcess/WebPageProxy.h:
    * UIProcess/WebPageProxy.messages.in:
    * WebKit2.xcodeproj/project.pbxproj:
    * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
    (WebKit::WebFrameLoaderClient::accessibilityRemoteObject):
    * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
    * WebProcess/WebPage/WebPage.cpp:
    (WebKit::WebPage::windowAndViewFramesChanged):
    * WebProcess/WebPage/WebPage.h:
    (WebKit::WebPage::accessibilityPosition):
    * WebProcess/WebPage/WebPage.messages.in:
    * WebProcess/WebPage/mac/AccessibilityWebPageObject.h: Added.
    * WebProcess/WebPage/mac/AccessibilityWebPageObject.mm: Added.
    (-[AccessibilityWebPageObject setWebPage:]):
    (-[AccessibilityWebPageObject setRemoteParent:]):
    (-[AccessibilityWebPageObject dealloc]):
    (-[AccessibilityWebPageObject accessibilityIsIgnored]):
    (-[AccessibilityWebPageObject accessibilityAttributeNames]):
    (-[AccessibilityWebPageObject accessibilityIsAttributeSettable:]):
    (-[AccessibilityWebPageObject accessibilitySetValue:forAttribute:]):
    (-[AccessibilityWebPageObject accessibilityActionNames]):
    (-[AccessibilityWebPageObject accessibilityChildren]):
    (-[AccessibilityWebPageObject accessibilityAttributeValue:]):
    (-[AccessibilityWebPageObject accessibilityShouldUseUniqueId]):
    (-[AccessibilityWebPageObject accessibilityHitTest:]):
    (-[AccessibilityWebPageObject accessibilityFocusedUIElement]):
    * WebProcess/WebPage/mac/WebPageMac.mm:
    (WebKit::WebPage::platformInitialize):
    (WebKit::WebPage::sendAccessibilityPresenterToken):
    (WebKit::WebPage::accessibilityRemoteObject):
    * WebProcess/WebProcess.cpp:
    (WebKit::WebProcess::initializeWebProcess):
    * WebProcess/WebProcess.h:
    (WebKit::WebProcess::presenterApplicationPid):
    * WebProcess/mac/WebProcessMainMac.mm:
    (WebKit::WebProcessMain):
    
    LayoutTests: 
    
    * platform/mac/accessibility/webkit-scrollarea-expected.txt: Added.
    * platform/mac/accessibility/webkit-scrollarea.html: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75031 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    aa50410b
CMakeLists.txt 74.5 KB