summaryrefslogtreecommitdiffstats
path: root/webkit/api
diff options
context:
space:
mode:
authordglazkov@chromium.org <dglazkov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-04 20:06:15 +0000
committerdglazkov@chromium.org <dglazkov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-04 20:06:15 +0000
commitc7287a9c5154d8ce9f213d5e741021b13dfcbe66 (patch)
tree9c67ea76a88047ac74632df01b1bec7557a2a3a7 /webkit/api
parentb8ce79bbe5104243715968ab112e6b19102effee (diff)
downloadchromium_src-c7287a9c5154d8ce9f213d5e741021b13dfcbe66.zip
chromium_src-c7287a9c5154d8ce9f213d5e741021b13dfcbe66.tar.gz
chromium_src-c7287a9c5154d8ce9f213d5e741021b13dfcbe66.tar.bz2
Introduce WebAccessibilityControllerImpl.
Removes accessibility-related WebCore dependencies from glue. R=darin TEST=none BUG=24616 Review URL: http://codereview.chromium.org/348063 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30986 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/api')
-rw-r--r--webkit/api/WebKit.gyp6
-rwxr-xr-xwebkit/api/public/WebAccessibilityCache.h (renamed from webkit/api/public/WebAccessibilityController.h)24
-rw-r--r--webkit/api/public/WebAccessibilityObject.h33
-rwxr-xr-xwebkit/api/src/WebAccessibilityCache.cpp (renamed from webkit/api/src/WebAccessibilityController.cpp)4
-rw-r--r--webkit/api/src/WebAccessibilityCacheImpl.cpp167
-rw-r--r--webkit/api/src/WebAccessibilityCacheImpl.h95
-rwxr-xr-xwebkit/api/src/WebAccessibilityObject.cpp276
7 files changed, 591 insertions, 14 deletions
diff --git a/webkit/api/WebKit.gyp b/webkit/api/WebKit.gyp
index 9551e7f..49c8966 100644
--- a/webkit/api/WebKit.gyp
+++ b/webkit/api/WebKit.gyp
@@ -64,7 +64,7 @@
'public/x11/WebScreenInfoFactory.h',
'public/mac/WebInputEventFactory.h',
'public/mac/WebScreenInfoFactory.h',
- 'public/WebAccessibilityController.h',
+ 'public/WebAccessibilityCache.h',
'public/WebAccessibilityObject.h',
'public/WebAccessibilityRole.h',
'public/WebApplicationCacheHost.h',
@@ -210,7 +210,9 @@
'src/StorageNamespaceProxy.cpp',
'src/StorageNamespaceProxy.h',
'src/TemporaryGlue.h',
- 'src/WebAccessibilityController.cpp',
+ 'src/WebAccessibilityCache.cpp',
+ 'src/WebAccessibilityCacheImpl.cpp',
+ 'src/WebAccessibilityCacheImpl.h',
'src/WebAccessibilityObject.cpp',
'src/WebBindings.cpp',
'src/WebCache.cpp',
diff --git a/webkit/api/public/WebAccessibilityController.h b/webkit/api/public/WebAccessibilityCache.h
index 00dbd13..91992c5 100755
--- a/webkit/api/public/WebAccessibilityController.h
+++ b/webkit/api/public/WebAccessibilityCache.h
@@ -28,20 +28,32 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WebAccessibilityController_h
-#define WebAccessibilityController_h
+#ifndef WebAccessibilityCache_h
+#define WebAccessibilityCache_h
#include "WebCommon.h"
namespace WebKit {
+ class WebView;
+ class WebAccessibilityObject;
- // FIXME: Move all methods of WebAcessibilityManager here.
- class WebAccessibilityController {
+ class WebAccessibilityCache {
public:
- WebAccessibilityController() {}
- virtual ~WebAccessibilityController() {}
+ WebAccessibilityCache() {}
+ virtual ~WebAccessibilityCache() {}
+ static WebAccessibilityCache* create();
static void enableAccessibility();
+
+ virtual void initialize(WebView* view) = 0;
+ virtual bool isInitialized() const = 0;
+
+ virtual WebAccessibilityObject getObjectById(int) = 0;
+ virtual bool isValidId(int) const = 0;
+ virtual int addOrGetId(const WebAccessibilityObject& object) = 0;
+
+ virtual void remove(int) = 0;
+ virtual void clear() = 0;
};
} // namespace WebKit
diff --git a/webkit/api/public/WebAccessibilityObject.h b/webkit/api/public/WebAccessibilityObject.h
index 5bfbdc1..eba5c64 100644
--- a/webkit/api/public/WebAccessibilityObject.h
+++ b/webkit/api/public/WebAccessibilityObject.h
@@ -42,6 +42,8 @@ namespace WTF { template <typename T> class PassRefPtr; }
namespace WebKit {
class WebAccessibilityObjectPrivate;
class WebString;
+ struct WebPoint;
+ struct WebRect;
// A container for passing around a reference to AccessibilityObject.
class WebAccessibilityObject {
@@ -58,10 +60,39 @@ namespace WebKit {
bool isNull() const { return m_private == 0; }
WebString accessibilityDescription() const;
- WebAccessibilityObject childAt(unsigned) const;
+ WebString actionVerb() const;
+ bool canSetFocusAttribute() const;
+
unsigned childCount() const;
+
+ WebAccessibilityObject childAt(unsigned) const;
+ WebAccessibilityObject firstChild() const;
+ WebAccessibilityObject focusedChild() const;
+ WebAccessibilityObject lastChild() const;
+ WebAccessibilityObject nextSibling() const;
+ WebAccessibilityObject parentObject() const;
+ WebAccessibilityObject previousSibling() const;
+
+ bool isAnchor() const;
+ bool isChecked() const;
+ bool isFocused() const;
bool isEnabled() const;
+ bool isHovered() const;
+ bool isIndeterminate() const;
+ bool isMultiSelect() const;
+ bool isOffScreen() const;
+ bool isPasswordField() const;
+ bool isPressed() const;
+ bool isReadOnly() const;
+ bool isVisited() const;
+
+ WebRect boundingBoxRect() const;
+ WebString helpText() const;
+ WebAccessibilityObject hitTest(const WebPoint&) const;
+ WebString keyboardShortcut() const;
+ bool performDefaultAction() const;
WebAccessibilityRole roleValue() const;
+ WebString stringValue() const;
WebString title() const;
#if WEBKIT_IMPLEMENTATION
diff --git a/webkit/api/src/WebAccessibilityController.cpp b/webkit/api/src/WebAccessibilityCache.cpp
index d2df500..8a3f697 100755
--- a/webkit/api/src/WebAccessibilityController.cpp
+++ b/webkit/api/src/WebAccessibilityCache.cpp
@@ -29,7 +29,7 @@
*/
#include "config.h"
-#include "WebAccessibilityController.h"
+#include "WebAccessibilityCache.h"
#include "AXObjectCache.h"
@@ -37,7 +37,7 @@ using namespace WebCore;
namespace WebKit {
-void WebAccessibilityController::enableAccessibility()
+void WebAccessibilityCache::enableAccessibility()
{
AXObjectCache::enableAccessibility();
}
diff --git a/webkit/api/src/WebAccessibilityCacheImpl.cpp b/webkit/api/src/WebAccessibilityCacheImpl.cpp
new file mode 100644
index 0000000..232a765
--- /dev/null
+++ b/webkit/api/src/WebAccessibilityCacheImpl.cpp
@@ -0,0 +1,167 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebAccessibilityCacheImpl.h"
+
+#include "AccessibilityObject.h"
+#include "AXObjectCache.h"
+#include "Document.h"
+#include "Frame.h"
+#include "WebAccessibilityObject.h"
+#include "WebFrameImpl.h"
+#include "WebViewImpl.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+const int invalidObjectId = -1;
+const int firstObjectId = 1000;
+
+static PassRefPtr<AccessibilityObject> toAccessibilityObject(const WebAccessibilityObject& object)
+{
+ return object;
+}
+
+// WebView ----------------------------------------------------------------
+
+WebAccessibilityCache* WebAccessibilityCache::create()
+{
+ return new WebAccessibilityCacheImpl();
+}
+
+// WeakHandle -------------------------------------------------------------
+
+PassRefPtr<WebAccessibilityCacheImpl::WeakHandle> WebAccessibilityCacheImpl::WeakHandle::create(AccessibilityObject* object)
+{
+ // FIXME: Remove resetting ref-count from AccessibilityObjectWrapper
+ // and convert to use adoptRef.
+ return new WebAccessibilityCacheImpl::WeakHandle(object);
+}
+
+WebAccessibilityCacheImpl::WeakHandle::WeakHandle(AccessibilityObject* object)
+ : AccessibilityObjectWrapper(object)
+{
+ m_object->setWrapper(this);
+}
+
+// WebAccessibilityCacheImpl ----------------------------------------
+
+void WebAccessibilityCacheImpl::WeakHandle::detach()
+{
+ if (m_object)
+ m_object = 0;
+}
+
+WebAccessibilityCacheImpl::WebAccessibilityCacheImpl()
+ : m_nextNewId(firstObjectId)
+ , m_initialized(false)
+{
+}
+
+WebAccessibilityCacheImpl::~WebAccessibilityCacheImpl()
+{
+}
+
+void WebAccessibilityCacheImpl::initialize(WebView* view)
+{
+ AXObjectCache::enableAccessibility();
+ WebAccessibilityObject root = view->accessibilityObject();
+ if (root.isNull())
+ return;
+
+ RefPtr<AccessibilityObject> rootObject = toAccessibilityObject(root);
+
+ // Insert root in hashmaps.
+ m_objectMap.set(m_nextNewId, WeakHandle::create(rootObject.get()));
+ m_idMap.set(rootObject.get(), m_nextNewId++);
+
+ m_initialized = true;
+}
+
+WebAccessibilityObject WebAccessibilityCacheImpl::getObjectById(int id)
+{
+ ObjectMap::iterator it = m_objectMap.find(id);
+
+ if (it == m_objectMap.end() || !it->second)
+ return WebAccessibilityObject();
+
+ return WebAccessibilityObject(it->second->accessibilityObject());
+}
+
+bool WebAccessibilityCacheImpl::isValidId(int id) const
+{
+ return id >= firstObjectId;
+}
+
+void WebAccessibilityCacheImpl::remove(int id)
+{
+ ObjectMap::iterator it = m_objectMap.find(id);
+
+ if (it == m_objectMap.end())
+ return;
+
+ if (it->second) {
+ // Erase element from reverse hashmap.
+ IdMap::iterator it2 = m_idMap.find(it->second->accessibilityObject());
+ if (it2 != m_idMap.end())
+ m_idMap.remove(it2);
+ }
+
+ m_objectMap.remove(it);
+}
+
+void WebAccessibilityCacheImpl::clear()
+{
+ m_objectMap.clear();
+ m_idMap.clear();
+}
+
+int WebAccessibilityCacheImpl::addOrGetId(const WebAccessibilityObject& object) {
+ if (object.isNull())
+ return invalidObjectId;
+
+ RefPtr<AccessibilityObject> o = toAccessibilityObject(object);
+
+ IdMap::iterator it = m_idMap.find(o.get());
+
+ if (it != m_idMap.end())
+ return it->second;
+
+ // Insert new accessibility object in hashmaps and return its newly
+ // assigned accessibility object id.
+ m_objectMap.set(m_nextNewId, WeakHandle::create(o.get()));
+ m_idMap.set(o.get(), m_nextNewId);
+
+ return m_nextNewId++;
+}
+
+}
diff --git a/webkit/api/src/WebAccessibilityCacheImpl.h b/webkit/api/src/WebAccessibilityCacheImpl.h
new file mode 100644
index 0000000..1173a41
--- /dev/null
+++ b/webkit/api/src/WebAccessibilityCacheImpl.h
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebAccessibilityCacheImpl_h
+#define WebAccessibilityCacheImpl_h
+
+// FIXME: Move wtf/RefCounted.h include to AccessibilityObjectWrapper.h
+// once this file is upstream.
+#include <wtf/RefCounted.h>
+#include "AccessibilityObjectWrapper.h"
+#include "WebAccessibilityCache.h"
+#include <wtf/HashMap.h>
+#include <wtf/PassRefPtr.h>
+
+namespace WebKit {
+
+// FIXME: Should be eliminated to use AXObjectCache instead.
+class WebAccessibilityCacheImpl : public WebKit::WebAccessibilityCache {
+public:
+ virtual void initialize(WebView* view);
+ virtual bool isInitialized() const { return m_initialized; }
+
+ virtual WebAccessibilityObject getObjectById(int);
+ virtual bool isValidId(int) const;
+ virtual int addOrGetId(const WebKit::WebAccessibilityObject&);
+
+ virtual void remove(int);
+ virtual void clear();
+
+protected:
+ friend class WebKit::WebAccessibilityCache;
+
+ WebAccessibilityCacheImpl();
+ ~WebAccessibilityCacheImpl();
+
+private:
+ // FIXME: This can be just part of Chromium's AccessibilityObjectWrapper.
+ class WeakHandle : public WebCore::AccessibilityObjectWrapper {
+ public:
+ static PassRefPtr<WeakHandle> create(WebCore::AccessibilityObject*);
+ virtual void detach();
+ private:
+ WeakHandle(WebCore::AccessibilityObject*);
+ };
+
+ typedef HashMap<int, RefPtr<WeakHandle> > ObjectMap;
+ typedef HashMap<WebCore::AccessibilityObject*, int> IdMap;
+
+ // Hashmap for caching of elements in use by the AT, mapping id (int) to
+ // WebAccessibilityObject.
+ ObjectMap m_objectMap;
+ // Hashmap for caching of elements in use by the AT, mapping a
+ // AccessibilityObject pointer to its id (int). Needed for reverse lookup,
+ // to ensure unnecessary duplicate entries are not created in the
+ // ObjectMap and for focus changes in WebKit.
+ IdMap m_idMap;
+
+ // Unique identifier for retrieving an accessibility object from the page's
+ // hashmaps. Id is always 0 for the root of the accessibility object
+ // hierarchy (on a per-renderer process basis).
+ int m_nextNewId;
+
+ bool m_initialized;
+};
+
+}
+
+#endif
diff --git a/webkit/api/src/WebAccessibilityObject.cpp b/webkit/api/src/WebAccessibilityObject.cpp
index f1da633..49fed03 100755
--- a/webkit/api/src/WebAccessibilityObject.cpp
+++ b/webkit/api/src/WebAccessibilityObject.cpp
@@ -29,8 +29,14 @@
*/
#include "config.h"
-#include "AccessibilityObject.h"
#include "WebAccessibilityObject.h"
+
+#include "AccessibilityObject.h"
+#include "EventHandler.h"
+#include "FrameView.h"
+#include "PlatformKeyboardEvent.h"
+#include "WebPoint.h"
+#include "WebRect.h"
#include "WebString.h"
using namespace WebCore;
@@ -62,6 +68,33 @@ WebString WebAccessibilityObject::accessibilityDescription() const
return m_private->accessibilityDescription();
}
+WebString WebAccessibilityObject::actionVerb() const
+{
+ if (!m_private)
+ return WebString();
+
+ m_private->updateBackingStore();
+ return m_private->actionVerb();
+}
+
+bool WebAccessibilityObject::canSetFocusAttribute() const
+{
+ if (!m_private)
+ return false;
+
+ m_private->updateBackingStore();
+ return m_private->canSetFocusAttribute();
+}
+
+unsigned WebAccessibilityObject::childCount() const
+{
+ if (!m_private)
+ return 0;
+
+ m_private->updateBackingStore();
+ return m_private->children().size();
+}
+
WebAccessibilityObject WebAccessibilityObject::childAt(unsigned index) const
{
if (!m_private)
@@ -74,13 +107,92 @@ WebAccessibilityObject WebAccessibilityObject::childAt(unsigned index) const
return WebAccessibilityObject(m_private->children()[index]);
}
-unsigned WebAccessibilityObject::childCount() const
+WebAccessibilityObject WebAccessibilityObject::firstChild() const
+{
+ if (!m_private)
+ return WebAccessibilityObject();
+
+ m_private->updateBackingStore();
+ return WebAccessibilityObject(m_private->firstChild());
+}
+
+WebAccessibilityObject WebAccessibilityObject::focusedChild() const
+{
+ if (!m_private)
+ return WebAccessibilityObject();
+
+ m_private->updateBackingStore();
+ RefPtr<AccessibilityObject> focused = m_private->focusedUIElement();
+ if (m_private == focused.get() || focused->parentObject() == m_private)
+ return WebAccessibilityObject(focused);
+
+ return WebAccessibilityObject();
+}
+
+WebAccessibilityObject WebAccessibilityObject::lastChild() const
+{
+ if (!m_private)
+ return WebAccessibilityObject();
+
+ m_private->updateBackingStore();
+ return WebAccessibilityObject(m_private->lastChild());
+}
+
+
+WebAccessibilityObject WebAccessibilityObject::nextSibling() const
+{
+ if (!m_private)
+ return WebAccessibilityObject();
+
+ m_private->updateBackingStore();
+ return WebAccessibilityObject(m_private->nextSibling());
+}
+
+WebAccessibilityObject WebAccessibilityObject::parentObject() const
+{
+ if (!m_private)
+ return WebAccessibilityObject();
+
+ m_private->updateBackingStore();
+ return WebAccessibilityObject(m_private->parentObject());
+}
+
+
+WebAccessibilityObject WebAccessibilityObject::previousSibling() const
+{
+ if (!m_private)
+ return WebAccessibilityObject();
+
+ m_private->updateBackingStore();
+ return WebAccessibilityObject(m_private->previousSibling());
+}
+
+bool WebAccessibilityObject::isAnchor() const
{
if (!m_private)
return 0;
m_private->updateBackingStore();
- return m_private->children().size();
+ return m_private->isAnchor();
+}
+
+bool WebAccessibilityObject::isChecked() const
+{
+ if (!m_private)
+ return 0;
+
+ m_private->updateBackingStore();
+ return m_private->isChecked();
+}
+
+
+bool WebAccessibilityObject::isFocused() const
+{
+ if (!m_private)
+ return 0;
+
+ m_private->updateBackingStore();
+ return m_private->isFocused();
}
bool WebAccessibilityObject::isEnabled() const
@@ -92,12 +204,170 @@ bool WebAccessibilityObject::isEnabled() const
return m_private->isEnabled();
}
+bool WebAccessibilityObject::isHovered() const
+{
+ if (!m_private)
+ return 0;
+
+ m_private->updateBackingStore();
+ return m_private->isHovered();
+}
+
+bool WebAccessibilityObject::isIndeterminate() const
+{
+ if (!m_private)
+ return 0;
+
+ m_private->updateBackingStore();
+ return m_private->isIndeterminate();
+}
+
+bool WebAccessibilityObject::isMultiSelect() const
+{
+ if (!m_private)
+ return 0;
+
+ m_private->updateBackingStore();
+ return m_private->isMultiSelect();
+}
+
+bool WebAccessibilityObject::isOffScreen() const
+{
+ if (!m_private)
+ return 0;
+
+ m_private->updateBackingStore();
+ return m_private->isOffScreen();
+}
+
+bool WebAccessibilityObject::isPasswordField() const
+{
+ if (!m_private)
+ return 0;
+
+ m_private->updateBackingStore();
+ return m_private->isPasswordField();
+}
+
+bool WebAccessibilityObject::isPressed() const
+{
+ if (!m_private)
+ return 0;
+
+ m_private->updateBackingStore();
+ return m_private->isPressed();
+}
+
+bool WebAccessibilityObject::isReadOnly() const
+{
+ if (!m_private)
+ return 0;
+
+ m_private->updateBackingStore();
+ return m_private->isReadOnly();
+}
+
+bool WebAccessibilityObject::isVisited() const
+{
+ if (!m_private)
+ return 0;
+
+ m_private->updateBackingStore();
+ return m_private->isVisited();
+}
+
+WebRect WebAccessibilityObject::boundingBoxRect() const
+{
+ if (!m_private)
+ return WebRect();
+
+ m_private->updateBackingStore();
+ return m_private->documentFrameView()->contentsToWindow(m_private->boundingBoxRect());
+}
+
+WebString WebAccessibilityObject::helpText() const
+{
+ if (!m_private)
+ return WebString();
+
+ m_private->updateBackingStore();
+ return m_private->helpText();
+}
+
+WebAccessibilityObject WebAccessibilityObject::hitTest(const WebPoint& point) const
+{
+ if (!m_private)
+ return WebAccessibilityObject();
+
+ m_private->updateBackingStore();
+ IntPoint contentsPoint = m_private->documentFrameView()->windowToContents(point);
+ RefPtr<AccessibilityObject> hit = m_private->doAccessibilityHitTest(contentsPoint);
+
+ if (hit.get())
+ return WebAccessibilityObject(hit);
+
+ if (m_private->boundingBoxRect().contains(contentsPoint))
+ return *this;
+
+ return WebAccessibilityObject();
+}
+
+WebString WebAccessibilityObject::keyboardShortcut() const
+{
+ if (!m_private)
+ return WebString();
+
+ m_private->updateBackingStore();
+ String accessKey = m_private->accessKey();
+ if (accessKey.isNull())
+ return WebString();
+
+ static String modifierString;
+ if (modifierString.isNull()) {
+ unsigned modifiers = EventHandler::accessKeyModifiers();
+ // Follow the same order as Mozilla MSAA implementation:
+ // Ctrl+Alt+Shift+Meta+key. MSDN states that keyboard shortcut strings
+ // should not be localized and defines the separator as "+".
+ if (modifiers & PlatformKeyboardEvent::CtrlKey)
+ modifierString += "Ctrl+";
+ if (modifiers & PlatformKeyboardEvent::AltKey)
+ modifierString += "Alt+";
+ if (modifiers & PlatformKeyboardEvent::ShiftKey)
+ modifierString += "Shift+";
+ if (modifiers & PlatformKeyboardEvent::MetaKey)
+ modifierString += "Win+";
+ }
+
+ return modifierString + accessKey;
+}
+
+bool WebAccessibilityObject::performDefaultAction() const
+{
+ if (!m_private)
+ return false;
+
+ m_private->updateBackingStore();
+ return m_private->performDefaultAction();
+}
+
WebAccessibilityRole WebAccessibilityObject::roleValue() const
{
+ if (!m_private)
+ return WebKit::WebAccessibilityRoleUnknown;
+
m_private->updateBackingStore();
return static_cast<WebAccessibilityRole>(m_private->roleValue());
}
+WebString WebAccessibilityObject::stringValue() const
+{
+ if (!m_private)
+ return WebString();
+
+ m_private->updateBackingStore();
+ return m_private->stringValue();
+}
+
WebString WebAccessibilityObject::title() const
{
if (!m_private)