summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/accessibility
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-05-16 16:25:10 +0100
committerBen Murdoch <benm@google.com>2011-05-23 18:54:14 +0100
commitab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb (patch)
treedb769fadd053248f85db67434a5b275224defef7 /Source/WebCore/accessibility
parent52e2557aeb8477967e97fd24f20f8f407a10fa15 (diff)
downloadexternal_webkit-ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb.zip
external_webkit-ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb.tar.gz
external_webkit-ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb.tar.bz2
Merge WebKit at r76408: Initial merge by git.
Change-Id: I5b91decbd693ccbf5c1b8354b37cd68cc9a1ea53
Diffstat (limited to 'Source/WebCore/accessibility')
-rw-r--r--Source/WebCore/accessibility/AXObjectCache.h3
-rw-r--r--Source/WebCore/accessibility/AccessibilityObject.cpp3
-rw-r--r--Source/WebCore/accessibility/AccessibilityObject.h1
-rw-r--r--Source/WebCore/accessibility/AccessibilityRenderObject.cpp21
-rw-r--r--Source/WebCore/accessibility/AccessibilityScrollbar.cpp6
-rw-r--r--Source/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm2
6 files changed, 23 insertions, 13 deletions
diff --git a/Source/WebCore/accessibility/AXObjectCache.h b/Source/WebCore/accessibility/AXObjectCache.h
index 670d6e0..00e7fbc 100644
--- a/Source/WebCore/accessibility/AXObjectCache.h
+++ b/Source/WebCore/accessibility/AXObjectCache.h
@@ -60,7 +60,8 @@ struct TextMarkerData {
enum PostType { PostSynchronously, PostAsynchronously };
-class AXObjectCache : public Noncopyable {
+class AXObjectCache {
+ WTF_MAKE_NONCOPYABLE(AXObjectCache); WTF_MAKE_FAST_ALLOCATED;
public:
AXObjectCache(const Document*);
~AXObjectCache();
diff --git a/Source/WebCore/accessibility/AccessibilityObject.cpp b/Source/WebCore/accessibility/AccessibilityObject.cpp
index 511bd3f..f2a2d7d 100644
--- a/Source/WebCore/accessibility/AccessibilityObject.cpp
+++ b/Source/WebCore/accessibility/AccessibilityObject.cpp
@@ -1013,8 +1013,9 @@ AccessibilityObject* AccessibilityObject::elementAccessibilityHitTest(const IntP
// Send the hit test back into the sub-frame if necessary.
if (isAttachment()) {
Widget* widget = widgetForAttachmentView();
+ // Normalize the point for the widget's bounds.
if (widget && widget->isFrameView())
- return axObjectCache()->getOrCreate(static_cast<ScrollView*>(widget))->accessibilityHitTest(point);
+ return axObjectCache()->getOrCreate(widget)->accessibilityHitTest(IntPoint(point - widget->frameRect().location()));
}
return const_cast<AccessibilityObject*>(this);
diff --git a/Source/WebCore/accessibility/AccessibilityObject.h b/Source/WebCore/accessibility/AccessibilityObject.h
index 45b54fc..c8d887b 100644
--- a/Source/WebCore/accessibility/AccessibilityObject.h
+++ b/Source/WebCore/accessibility/AccessibilityObject.h
@@ -31,7 +31,6 @@
#define AccessibilityObject_h
#include "IntRect.h"
-#include "Range.h"
#include "VisiblePosition.h"
#include "VisibleSelection.h"
#include <wtf/Forward.h>
diff --git a/Source/WebCore/accessibility/AccessibilityRenderObject.cpp b/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
index 8b0c5ca..ca8d4a7 100644
--- a/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
+++ b/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
@@ -1772,6 +1772,10 @@ bool AccessibilityRenderObject::accessibilityIsIgnored() const
if (!isAllowedChildOfTree())
return true;
+ // Allow the platform to decide if the attachment is ignored or not.
+ if (isAttachment())
+ return accessibilityIgnoreAttachment();
+
// ignore popup menu items because AppKit does
for (RenderObject* parent = m_renderer->parent(); parent; parent = parent->parent()) {
if (parent->isBoxModelObject() && toRenderBoxModelObject(parent)->isMenuList())
@@ -1817,9 +1821,6 @@ bool AccessibilityRenderObject::accessibilityIsIgnored() const
if (ariaRoleAttribute() != UnknownRole)
return false;
- if (!helpText().isEmpty())
- return false;
-
// don't ignore labels, because they serve as TitleUIElements
Node* node = m_renderer->node();
if (node && node->hasTagName(labelTag))
@@ -1877,11 +1878,17 @@ bool AccessibilityRenderObject::accessibilityIsIgnored() const
return false;
}
- // make a platform-specific decision
- if (isAttachment())
- return accessibilityIgnoreAttachment();
+ if (isWebArea() || m_renderer->isListMarker())
+ return false;
+
+ // Using the help text to decide an element's visibility is not as definitive
+ // as previous checks, so this should remain as one of the last.
+ if (!helpText().isEmpty())
+ return false;
- return !m_renderer->isListMarker() && !isWebArea();
+ // By default, objects should be ignored so that the AX hierarchy is not
+ // filled with unnecessary items.
+ return true;
}
bool AccessibilityRenderObject::isLoaded() const
diff --git a/Source/WebCore/accessibility/AccessibilityScrollbar.cpp b/Source/WebCore/accessibility/AccessibilityScrollbar.cpp
index 865797a..b225af8 100644
--- a/Source/WebCore/accessibility/AccessibilityScrollbar.cpp
+++ b/Source/WebCore/accessibility/AccessibilityScrollbar.cpp
@@ -97,9 +97,11 @@ void AccessibilityScrollbar::setValue(float value)
if (!m_scrollbar)
return;
+ if (!m_scrollbar->scrollableArea())
+ return;
+
float newValue = value * m_scrollbar->maximum();
-
- m_scrollbar->setValue(newValue, Scrollbar::NotFromScrollAnimator);
+ m_scrollbar->scrollableArea()->scrollToOffsetWithoutAnimation(m_scrollbar->orientation(), newValue);
}
} // namespace WebCore
diff --git a/Source/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm b/Source/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm
index f3b388b..c2e3724 100644
--- a/Source/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm
+++ b/Source/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm
@@ -1455,7 +1455,7 @@ static NSString* roleValueToNSString(AccessibilityRole value)
return nil;
if (scroll->platformWidget())
- return scroll->platformWidget();
+ return NSAccessibilityUnignoredAncestor(scroll->platformWidget());
return [self remoteAccessibilityParentObject];
}