Commit aa50410b authored by cfleizach@apple.com's avatar cfleizach@apple.com

WK2: Support Accessibility

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
parent bb148c2e
2011-01-04 Chris Fleizach <cfleizach@apple.com>
Reviewed by Sam Weinig.
WK2: Support Accessibility
https://bugs.webkit.org/show_bug.cgi?id=51859
* platform/mac/accessibility/webkit-scrollarea-expected.txt: Added.
* platform/mac/accessibility/webkit-scrollarea.html: Added.
2011-01-04 Kent Tamura <tkent@chromium.org>
Unreviewed, test expectation update.
......
text
text
This tests that the WebKit generated scroll areas are correct.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS body.role is 'AXRole: AXWebArea'
PASS body.parentElement().role is 'AXRole: AXScrollArea'
PASS body.parentElement().childrenCount is 1
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
<script>
var successfullyParsed = false;
</script>
<script src="../../../fast/js/resources/js-test-pre.js"></script>
</head>
<body id="body">
text<br>
<img src='resources/cake.png' width=5000 height=5000>
<br>
text
<p id="description"></p>
<div id="console"></div>
<script>
description("This tests that the WebKit generated scroll areas are correct.");
if (window.accessibilityController) {
document.getElementById("body").focus();
var body = accessibilityController.focusedElement;
shouldBe("body.role", "'AXRole: AXWebArea'");
shouldBe("body.parentElement().role", "'AXRole: AXScrollArea'");
shouldBe("body.parentElement().childrenCount", "1");
}
successfullyParsed = true;
</script>
<script src="../../../fast/js/resources/js-test-post.js"></script>
</body>
</html>
2011-01-04 Chris Fleizach <cfleizach@apple.com>
Reviewed by Sam Weinig.
WK2: Support Accessibility
https://bugs.webkit.org/show_bug.cgi?id=51859
Use rootObject() method to get top of accessibility tree.
* DumpRenderTree/mac/AccessibilityControllerMac.mm:
(AccessibilityController::focusedElement):
(AccessibilityController::rootElement):
2011-01-03 Martin Robinson <mrobinson@igalia.com>
Reviewed by Darin Adler.
......@@ -28,8 +28,10 @@
#import "AccessibilityController.h"
#import "AccessibilityUIElement.h"
#import <AppKit/NSColor.h>
#import <Foundation/Foundation.h>
#import <WebKit/WebFrame.h>
#import <WebKit/WebFramePrivate.h>
#import <WebKit/WebHTMLView.h>
AccessibilityController::AccessibilityController()
......@@ -49,14 +51,14 @@ AccessibilityUIElement AccessibilityController::elementAtPoint(int x, int y)
AccessibilityUIElement AccessibilityController::focusedElement()
{
// FIXME: we could do some caching here.
id accessibilityObject = [[[mainFrame frameView] documentView] accessibilityFocusedUIElement];
id accessibilityObject = [[mainFrame accessibilityRoot] accessibilityFocusedUIElement];
return AccessibilityUIElement(accessibilityObject);
}
AccessibilityUIElement AccessibilityController::rootElement()
{
// FIXME: we could do some caching here.
id accessibilityObject = [[mainFrame frameView] documentView];
id accessibilityObject = [mainFrame accessibilityRoot];
return AccessibilityUIElement(accessibilityObject);
}
......
......@@ -575,6 +575,7 @@ SET(WebCore_SOURCES
accessibility/AccessibilityObject.cpp
accessibility/AccessibilityRenderObject.cpp
accessibility/AccessibilityScrollbar.cpp
accessibility/AccessibilityScrollView.cpp
accessibility/AccessibilitySlider.cpp
accessibility/AccessibilityTable.cpp
accessibility/AccessibilityTableCell.cpp
......
2011-01-04 Chris Fleizach <cfleizach@apple.com>
Reviewed by Sam Weinig.
WK2: Support Accessibility
https://bugs.webkit.org/show_bug.cgi?id=51859
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):
2011-01-04 W. James MacLean <wjmaclean@chromium.org>
Reviewed by Kenneth Russell.
......
......@@ -662,6 +662,8 @@ webcore_sources += \
WebCore/accessibility/AccessibilityRenderObject.h \
WebCore/accessibility/AccessibilityScrollbar.cpp \
WebCore/accessibility/AccessibilityScrollbar.h \
WebCore/accessibility/AccessibilityScrollView.cpp \
WebCore/accessibility/AccessibilityScrollView.h \
WebCore/accessibility/AccessibilitySlider.cpp \
WebCore/accessibility/AccessibilitySlider.h \
WebCore/accessibility/AccessibilityTableCell.cpp \
......
......@@ -290,7 +290,7 @@ __ZN7WebCore12createMarkupEPKNS_4NodeENS_13EChildrenOnlyEPN3WTF6VectorIPS0_Lm0EE
__ZN7WebCore12createMarkupEPKNS_5RangeEPN3WTF6VectorIPNS_4NodeELm0EEENS_23EAnnotateForInterchangeEbNS_13EAbsoluteURLsE
__ZN7WebCore12gcControllerEv
__ZN7WebCore12iconDatabaseEv
__ZN7WebCore13AXObjectCache11getOrCreateEPNS_12RenderObjectE
__ZN7WebCore13AXObjectCache10rootObjectEv
__ZN7WebCore13AXObjectCache21gAccessibilityEnabledE
__ZN7WebCore13AXObjectCache42gAccessibilityEnhancedUserInterfaceEnabledE
__ZN7WebCore13HTTPHeaderMapC1Ev
......
......@@ -518,6 +518,8 @@
'accessibility/AccessibilityRenderObject.h',
'accessibility/AccessibilityScrollbar.cpp',
'accessibility/AccessibilityScrollbar.h',
'accessibility/AccessibilityScrollView.cpp',
'accessibility/AccessibilityScrollView.h',
'accessibility/AccessibilitySlider.cpp',
'accessibility/AccessibilitySlider.h',
'accessibility/AccessibilityTable.cpp',
......
......@@ -321,6 +321,7 @@ SOURCES += \
accessibility/AccessibilityProgressIndicator.cpp \
accessibility/AccessibilityRenderObject.cpp \
accessibility/AccessibilityScrollbar.cpp \
accessibility/AccessibilityScrollView.cpp \
accessibility/AccessibilitySlider.cpp \
accessibility/AccessibilityARIAGrid.cpp \
accessibility/AccessibilityARIAGridCell.cpp \
......@@ -1398,6 +1399,7 @@ HEADERS += \
accessibility/AccessibilityProgressIndicator.h \
accessibility/AccessibilityRenderObject.h \
accessibility/AccessibilityScrollbar.h \
accessibility/AccessibilityScrollView.h \
accessibility/AccessibilitySlider.h \
accessibility/AccessibilityTableCell.h \
accessibility/AccessibilityTableColumn.h \
......
......@@ -23753,6 +23753,62 @@
RelativePath="..\accessibility\AccessibilityScrollbar.h"
>
</File>
<File
RelativePath="..\accessibility\AccessibilityScrollView.cpp"
>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug_Cairo_CFLite|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release_Cairo_CFLite|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug_All|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release_LTCG|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\accessibility\AccessibilityScrollView.h"
>
</File>
<File
RelativePath="..\accessibility\AccessibilitySlider.cpp"
>
......@@ -693,6 +693,8 @@
24F54EAD101FE914000AE741 /* ApplicationCacheHost.h in Headers */ = {isa = PBXBuildFile; fileRef = 24F54EAB101FE914000AE741 /* ApplicationCacheHost.h */; settings = {ATTRIBUTES = (); }; };
2542F4DA1166C25A00E89A86 /* UserGestureIndicator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2542F4D81166C25A00E89A86 /* UserGestureIndicator.cpp */; };
2542F4DB1166C25A00E89A86 /* UserGestureIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = 2542F4D91166C25A00E89A86 /* UserGestureIndicator.h */; settings = {ATTRIBUTES = (Private, ); }; };
29489FC712C00F0300D83F0F /* AccessibilityScrollView.h in Headers */ = {isa = PBXBuildFile; fileRef = 29489FC512C00F0300D83F0F /* AccessibilityScrollView.h */; };
29489FC812C00F0300D83F0F /* AccessibilityScrollView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29489FC612C00F0300D83F0F /* AccessibilityScrollView.cpp */; };
29A812260FBB9C1D00510293 /* AccessibilityRenderObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29A812080FBB9C1D00510293 /* AccessibilityRenderObject.cpp */; };
29A812270FBB9C1D00510293 /* AccessibilityTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29A812090FBB9C1D00510293 /* AccessibilityTable.cpp */; };
29A812280FBB9C1D00510293 /* AccessibilityARIAGrid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29A8120A0FBB9C1D00510293 /* AccessibilityARIAGrid.cpp */; };
......@@ -6996,6 +6998,8 @@
24F54EAB101FE914000AE741 /* ApplicationCacheHost.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApplicationCacheHost.h; sourceTree = "<group>"; };
2542F4D81166C25A00E89A86 /* UserGestureIndicator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserGestureIndicator.cpp; sourceTree = "<group>"; };
2542F4D91166C25A00E89A86 /* UserGestureIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserGestureIndicator.h; sourceTree = "<group>"; };
29489FC512C00F0300D83F0F /* AccessibilityScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityScrollView.h; sourceTree = "<group>"; };
29489FC612C00F0300D83F0F /* AccessibilityScrollView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityScrollView.cpp; sourceTree = "<group>"; };
29A812080FBB9C1D00510293 /* AccessibilityRenderObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityRenderObject.cpp; sourceTree = "<group>"; };
29A812090FBB9C1D00510293 /* AccessibilityTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityTable.cpp; sourceTree = "<group>"; };
29A8120A0FBB9C1D00510293 /* AccessibilityARIAGrid.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityARIAGrid.cpp; sourceTree = "<group>"; };
......@@ -12938,6 +12942,8 @@
A409C983116D0DDD007197BD /* AccessibilityProgressIndicator.h */,
29A812080FBB9C1D00510293 /* AccessibilityRenderObject.cpp */,
29A8121B0FBB9C1D00510293 /* AccessibilityRenderObject.h */,
29489FC612C00F0300D83F0F /* AccessibilityScrollView.cpp */,
29489FC512C00F0300D83F0F /* AccessibilityScrollView.h */,
93C4F6E81108F9A50099D0DB /* AccessibilityScrollbar.cpp */,
93C4F6E91108F9A50099D0DB /* AccessibilityScrollbar.h */,
0709FC4B1025DED80059CDBA /* AccessibilitySlider.cpp */,
......@@ -22265,6 +22271,7 @@
93F199ED08245E59001E9ABC /* XSLTProcessor.h in Headers */,
E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */,
97DD4D870FDF4D6E00ECF9A4 /* XSSAuditor.h in Headers */,
29489FC712C00F0300D83F0F /* AccessibilityScrollView.h in Headers */,
7EE6846012D26E3800E79415 /* AuthenticationCF.h in Headers */,
7EE6846112D26E3800E79415 /* AuthenticationChallenge.h in Headers */,
7EE6846412D26E3800E79415 /* CookieStorageCFNet.h in Headers */,
......@@ -24943,6 +24950,7 @@
93F19B0508245E59001E9ABC /* XSLTProcessorLibxslt.cpp in Sources */,
E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */,
97DD4D860FDF4D6E00ECF9A4 /* XSSAuditor.cpp in Sources */,
29489FC812C00F0300D83F0F /* AccessibilityScrollView.cpp in Sources */,
7EE6845F12D26E3800E79415 /* AuthenticationCF.cpp in Sources */,
7EE6846212D26E3800E79415 /* CookieJarCFNet.cpp in Sources */,
7EE6846312D26E3800E79415 /* CookieStorageCFNet.cpp in Sources */,
......@@ -42,6 +42,7 @@
#include "AccessibilityMenuListPopup.h"
#include "AccessibilityProgressIndicator.h"
#include "AccessibilityRenderObject.h"
#include "AccessibilityScrollView.h"
#include "AccessibilityScrollbar.h"
#include "AccessibilitySlider.h"
#include "AccessibilityTable.h"
......@@ -49,6 +50,7 @@
#include "AccessibilityTableColumn.h"
#include "AccessibilityTableHeaderContainer.h"
#include "AccessibilityTableRow.h"
#include "Document.h"
#include "FocusController.h"
#include "Frame.h"
#include "HTMLAreaElement.h"
......@@ -61,12 +63,13 @@
#include "Page.h"
#include "RenderListBox.h"
#include "RenderMenuList.h"
#include "RenderProgress.h"
#include "RenderSlider.h"
#include "RenderTable.h"
#include "RenderTableCell.h"
#include "RenderTableRow.h"
#include "RenderProgress.h"
#include "RenderSlider.h"
#include "RenderView.h"
#include "ScrollView.h"
#include <wtf/PassRefPtr.h>
......@@ -77,9 +80,10 @@ using namespace HTMLNames;
bool AXObjectCache::gAccessibilityEnabled = false;
bool AXObjectCache::gAccessibilityEnhancedUserInterfaceEnabled = false;
AXObjectCache::AXObjectCache()
AXObjectCache::AXObjectCache(const Document* doc)
: m_notificationPostTimer(this, &AXObjectCache::notificationPostTimerFired)
{
m_document = const_cast<Document*>(doc);
}
AXObjectCache::~AXObjectCache()
......@@ -151,19 +155,30 @@ AccessibilityObject* AXObjectCache::focusedUIElementForPage(const Page* page)
return obj;
}
AccessibilityObject* AXObjectCache::get(Widget* widget)
{
if (!widget)
return 0;
AXID axID = m_widgetObjectMapping.get(widget);
ASSERT(!HashTraits<AXID>::isDeletedValue(axID));
if (!axID)
return 0;
return m_objects.get(axID).get();
}
AccessibilityObject* AXObjectCache::get(RenderObject* renderer)
{
if (!renderer)
return 0;
AccessibilityObject* obj = 0;
AXID axID = m_renderObjectMapping.get(renderer);
ASSERT(!HashTraits<AXID>::isDeletedValue(axID));
if (axID)
obj = m_objects.get(axID).get();
if (!axID)
return 0;
return obj;
return m_objects.get(axID).get();
}
// FIXME: This probably belongs on Node.
......@@ -230,6 +245,28 @@ static PassRefPtr<AccessibilityObject> createFromRenderer(RenderObject* renderer
return AccessibilityRenderObject::create(renderer);
}
AccessibilityObject* AXObjectCache::getOrCreate(Widget* widget)
{
if (!widget)
return 0;
if (AccessibilityObject* obj = get(widget))
return obj;
RefPtr<AccessibilityObject> newObj = 0;
if (widget->isFrameView())
newObj = AccessibilityScrollView::create(static_cast<ScrollView*>(widget));
else if (widget->isScrollbar())
newObj = AccessibilityScrollbar::create(static_cast<Scrollbar*>(widget));
getAXID(newObj.get());
m_widgetObjectMapping.set(widget, newObj->axObjectID());
m_objects.set(newObj->axObjectID(), newObj);
attachWrapper(newObj.get());
return newObj.get();
}
AccessibilityObject* AXObjectCache::getOrCreate(RenderObject* renderer)
{
if (!renderer)
......@@ -247,6 +284,11 @@ AccessibilityObject* AXObjectCache::getOrCreate(RenderObject* renderer)
attachWrapper(newObj.get());
return newObj.get();
}
AccessibilityObject* AXObjectCache::rootObject()
{
return getOrCreate(m_document->view());
}
AccessibilityObject* AXObjectCache::getOrCreate(AccessibilityRole role)
{
......@@ -275,9 +317,6 @@ AccessibilityObject* AXObjectCache::getOrCreate(AccessibilityRole role)
case MenuListOptionRole:
obj = AccessibilityMenuListOption::create();
break;
case ScrollBarRole:
obj = AccessibilityScrollbar::create();
break;
default:
obj = 0;
}
......@@ -323,6 +362,17 @@ void AXObjectCache::remove(RenderObject* renderer)
m_renderObjectMapping.remove(renderer);
}
void AXObjectCache::remove(Widget* view)
{
if (!view)
return;
AXID axID = m_widgetObjectMapping.get(view);
remove(axID);
m_widgetObjectMapping.remove(view);
}
#if !PLATFORM(WIN) || OS(WINCE)
AXID AXObjectCache::platformGenerateAXID() const
{
......@@ -478,6 +528,18 @@ void AXObjectCache::nodeTextChangeNotification(RenderObject* renderer, AXTextCha
#endif
#if HAVE(ACCESSIBILITY)
void AXObjectCache::handleScrollbarUpdate(ScrollView* view)
{
if (!view)
return;
// We don't want to create a scroll view from this method, only update an existing one.
AccessibilityObject* scrollViewObject = get(view);
if (scrollViewObject)
scrollViewObject->updateChildrenIfNecessary();
}
void AXObjectCache::handleAriaExpandedChange(RenderObject *renderer)
{
if (!renderer)
......
/*
* Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
......@@ -42,11 +42,14 @@ class WebCoreTextMarker;
namespace WebCore {
class Document;
class HTMLAreaElement;
class Node;
class Page;
class RenderObject;
class ScrollView;
class VisiblePosition;
class Widget;
struct TextMarkerData {
AXID axID;
......@@ -59,14 +62,17 @@ enum PostType { PostSynchronously, PostAsynchronously };
class AXObjectCache : public Noncopyable {
public:
AXObjectCache();
AXObjectCache(const Document*);
~AXObjectCache();
static AccessibilityObject* focusedUIElementForPage(const Page*);
// to be used with render objects
AccessibilityObject* getOrCreate(RenderObject*);
AccessibilityObject* rootObject();
// For AX objects with elements that back them.
AccessibilityObject* getOrCreate(RenderObject*);
AccessibilityObject* getOrCreate(Widget*);
// used for objects without backing elements
AccessibilityObject* getOrCreate(AccessibilityRole);
......@@ -74,6 +80,7 @@ public:
AccessibilityObject* get(RenderObject*);
void remove(RenderObject*);
void remove(Widget*);
void remove(AXID);
void detachWrapper(AccessibilityObject*);
......@@ -88,6 +95,7 @@ public:
void handleFocusedUIElementChanged(RenderObject* oldFocusedRenderer, RenderObject* newFocusedRenderer);
void handleScrolledToAnchor(const Node* anchorNode);
void handleAriaExpandedChange(RenderObject*);
void handleScrollbarUpdate(ScrollView*);
static void enableAccessibility() { gAccessibilityEnabled = true; }
static void enableEnhancedUserInterfaceAccessibility() { gAccessibilityEnhancedUserInterfaceEnabled = true; }
......@@ -145,8 +153,10 @@ protected:
void nodeTextChangePlatformNotification(AccessibilityObject*, AXTextChange, unsigned offset, unsigned count);