Diff
Modified: branches/safari-537.74-branch/LayoutTests/ChangeLog (160468 => 160469)
--- branches/safari-537.74-branch/LayoutTests/ChangeLog 2013-12-12 01:57:43 UTC (rev 160468)
+++ branches/safari-537.74-branch/LayoutTests/ChangeLog 2013-12-12 01:59:00 UTC (rev 160469)
@@ -1,3 +1,21 @@
+2013-12-11 Matthew Hanson <[email protected]>
+
+ Merge r157821
+
+ 2013-10-22 Samuel White <[email protected]>
+
+ AX: Add paramAttrs to fetch start and end text markers in a given rect.
+ https://bugs.webkit.org/show_bug.cgi?id=122164
+
+ Reviewed by Chris Fleizach.
+
+ Added test to ensure end/start text marker for bounds works as
+ expected. Updated bounds for range test to include new API.
+
+ * platform/mac/accessibility/bounds-for-range-expected.txt:
+ * platform/mac/accessibility/text-marker-for-bounds-expected.txt: Added.
+ * platform/mac/accessibility/text-marker-for-bounds.html: Added.
+
2013-12-11 Lucas Forschler <[email protected]>
Merge r159460
Modified: branches/safari-537.74-branch/LayoutTests/platform/mac/accessibility/bounds-for-range-expected.txt (160468 => 160469)
--- branches/safari-537.74-branch/LayoutTests/platform/mac/accessibility/bounds-for-range-expected.txt 2013-12-12 01:57:43 UTC (rev 160468)
+++ branches/safari-537.74-branch/LayoutTests/platform/mac/accessibility/bounds-for-range-expected.txt 2013-12-12 01:59:00 UTC (rev 160469)
@@ -53,6 +53,8 @@
AXBoundsForRange
AXStringForRange
AXUIElementsForSearchPredicate
+AXEndTextMarkerForBounds
+AXStartTextMarkerForBounds
----------------------
{{-1.000000, -1.000000}, {59.000000, 18.000000}}
Added: branches/safari-537.74-branch/LayoutTests/platform/mac/accessibility/text-marker-for-bounds-expected.txt (0 => 160469)
--- branches/safari-537.74-branch/LayoutTests/platform/mac/accessibility/text-marker-for-bounds-expected.txt (rev 0)
+++ branches/safari-537.74-branch/LayoutTests/platform/mac/accessibility/text-marker-for-bounds-expected.txt 2013-12-12 01:59:00 UTC (rev 160469)
@@ -0,0 +1,11 @@
+Text text text text text text text text text text.
+This tests that endTextMarkerForBounds and startTextMarkerForBounds work correctly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS rangeFromBounds is rangeFromElement
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: branches/safari-537.74-branch/LayoutTests/platform/mac/accessibility/text-marker-for-bounds.html (0 => 160469)
--- branches/safari-537.74-branch/LayoutTests/platform/mac/accessibility/text-marker-for-bounds.html (rev 0)
+++ branches/safari-537.74-branch/LayoutTests/platform/mac/accessibility/text-marker-for-bounds.html 2013-12-12 01:59:00 UTC (rev 160469)
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+<title>Text Marker for Bounds</title>
+</head>
+<body>
+
+<div id="text">Text text text text text text text text text text.</div>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+ description("This tests that endTextMarkerForBounds and startTextMarkerForBounds work correctly.");
+
+ if (window.accessibilityController) {
+ var text = accessibilityController.accessibleElementById("text");
+
+ var startMarker = text.startTextMarkerForBounds(text.x, text.y, text.width, text.height);
+ var endMarker = text.endTextMarkerForBounds(text.x, text.y, text.width, text.height);
+ // Get text range from boundary markers.
+ var rangeFromBounds = text.textMarkerRangeLength(text.textMarkerRangeForMarkers(startMarker, endMarker));
+ // Get text range from element.
+ var rangeFromElement = text.textMarkerRangeLength(text.textMarkerRangeForElement(text));
+
+ shouldBe("rangeFromBounds", "rangeFromElement");
+ }
+</script>
+
+<script src=""
+</body>
+</html>
Modified: branches/safari-537.74-branch/Source/WebCore/ChangeLog (160468 => 160469)
--- branches/safari-537.74-branch/Source/WebCore/ChangeLog 2013-12-12 01:57:43 UTC (rev 160468)
+++ branches/safari-537.74-branch/Source/WebCore/ChangeLog 2013-12-12 01:59:00 UTC (rev 160469)
@@ -1,3 +1,31 @@
+2013-12-11 Matthew Hanson <[email protected]>
+
+ Merge r157821
+
+ 2013-10-22 Samuel White <[email protected]>
+
+ AX: Add paramAttrs to fetch start and end text markers in a given rect.
+ https://bugs.webkit.org/show_bug.cgi?id=122164
+
+ Reviewed by Chris Fleizach.
+
+ Added ability to fetch end and start text markers inside a given bounds. This gives ScreenReaders
+ like VoiceOver a way to retrieve the text markers for a specified column of page text.
+
+ Test: platform/mac/accessibility/text-marker-for-bounds.html
+
+ * accessibility/AccessibilityObject.cpp:
+ (WebCore::AccessibilityObject::mainFrame):
+ (WebCore::AccessibilityObject::topDocument):
+ (WebCore::AccessibilityObject::visiblePositionForBounds):
+ * accessibility/AccessibilityObject.h:
+ * accessibility/AccessibilityRenderObject.cpp:
+ * accessibility/AccessibilityRenderObject.h:
+ * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+ (-[WebAccessibilityObjectWrapper screenToContents:]):
+ (-[WebAccessibilityObjectWrapper accessibilityParameterizedAttributeNames]):
+ (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
+
2013-12-11 Lucas Forschler <[email protected]>
Merge r159691
Modified: branches/safari-537.74-branch/Source/WebCore/accessibility/AccessibilityObject.cpp (160468 => 160469)
--- branches/safari-537.74-branch/Source/WebCore/accessibility/AccessibilityObject.cpp 2013-12-12 01:57:43 UTC (rev 160468)
+++ branches/safari-537.74-branch/Source/WebCore/accessibility/AccessibilityObject.cpp 2013-12-12 01:59:00 UTC (rev 160469)
@@ -584,6 +584,13 @@
actionElem->accessKeyAction(true);
return true;
}
+
+Document* AccessibilityObject::topDocument() const
+{
+ if (!document())
+ return 0;
+ return document()->topDocument();
+}
String AccessibilityObject::language() const
{
@@ -914,6 +921,34 @@
return length;
}
+VisiblePosition AccessibilityObject::visiblePositionForBounds(const IntRect& rect, AccessibilityVisiblePositionForBounds visiblePositionForBounds) const
+{
+ if (rect.isEmpty())
+ return VisiblePosition();
+
+ // FIXME: Add support for right-to-left languages.
+ IntPoint corner = (visiblePositionForBounds == FirstVisiblePositionForBounds) ? rect.minXMinYCorner() : rect.maxXMaxYCorner();
+ VisiblePosition position = this->visiblePositionForPoint(corner);
+
+ if (rect.contains(position.absoluteCaretBounds().center()))
+ return position;
+
+ // If the initial position is located outside the bounds adjust it incrementally as needed.
+ VisiblePosition nextPosition = position.next();
+ VisiblePosition previousPosition = position.previous();
+ while (nextPosition.isNotNull() || previousPosition.isNotNull()) {
+ if (rect.contains(nextPosition.absoluteCaretBounds().center()))
+ return nextPosition;
+ if (rect.contains(previousPosition.absoluteCaretBounds().center()))
+ return previousPosition;
+
+ nextPosition = nextPosition.next();
+ previousPosition = previousPosition.previous();
+ }
+
+ return VisiblePosition();
+}
+
VisiblePosition AccessibilityObject::nextWordEnd(const VisiblePosition& visiblePos) const
{
if (visiblePos.isNull())
Modified: branches/safari-537.74-branch/Source/WebCore/accessibility/AccessibilityObject.h (160468 => 160469)
--- branches/safari-537.74-branch/Source/WebCore/accessibility/AccessibilityObject.h 2013-12-12 01:57:43 UTC (rev 160468)
+++ branches/safari-537.74-branch/Source/WebCore/accessibility/AccessibilityObject.h 2013-12-12 01:59:00 UTC (rev 160469)
@@ -311,6 +311,11 @@
VisitedLinkSearchKey
};
+enum AccessibilityVisiblePositionForBounds {
+ FirstVisiblePositionForBounds,
+ LastVisiblePositionForBounds
+};
+
struct AccessibilitySearchCriteria {
AccessibilityObject* startObject;
AccessibilitySearchDirection searchDirection;
@@ -633,8 +638,10 @@
virtual Document* document() const;
virtual FrameView* topDocumentFrameView() const { return 0; }
virtual FrameView* documentFrameView() const;
+ Document* topDocument() const;
String language() const;
// 1-based, to match the aria-level spec.
+ // 1-based, to match the aria-level spec.
virtual unsigned hierarchicalLevel() const { return 0; }
virtual void setFocused(bool) { }
@@ -705,6 +712,7 @@
int lengthForVisiblePositionRange(const VisiblePositionRange&) const;
virtual void setSelectedVisiblePositionRange(const VisiblePositionRange&) const { }
+ VisiblePosition visiblePositionForBounds(const IntRect&, AccessibilityVisiblePositionForBounds) const;
virtual VisiblePosition visiblePositionForPoint(const IntPoint&) const { return VisiblePosition(); }
VisiblePosition nextVisiblePosition(const VisiblePosition& visiblePos) const { return visiblePos.next(); }
VisiblePosition previousVisiblePosition(const VisiblePosition& visiblePos) const { return visiblePos.previous(); }
Modified: branches/safari-537.74-branch/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (160468 => 160469)
--- branches/safari-537.74-branch/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm 2013-12-12 01:57:43 UTC (rev 160468)
+++ branches/safari-537.74-branch/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm 2013-12-12 01:59:00 UTC (rev 160469)
@@ -195,6 +195,15 @@
#define NSAccessibilityUIElementsForSearchPredicateParameterizedAttribute @"AXUIElementsForSearchPredicate"
#endif
+// Text
+#ifndef NSAccessibilityEndTextMarkerForBoundsParameterizedAttribute
+#define NSAccessibilityEndTextMarkerForBoundsParameterizedAttribute @"AXEndTextMarkerForBounds"
+#endif
+
+#ifndef NSAccessibilityStartTextMarkerForBoundsParameterizedAttribute
+#define NSAccessibilityStartTextMarkerForBoundsParameterizedAttribute @"AXStartTextMarkerForBounds"
+#endif
+
// Search Keys
#ifndef NSAccessibilityAnyTypeSearchKey
#define NSAccessibilityAnyTypeSearchKey @"AXAnyTypeSearchKey"
@@ -437,6 +446,23 @@
return HardAutorelease(wkCopyAXTextMarkerRangeEnd(range));
}
+#pragma mark Other helpers
+
+- (IntRect)screenToContents:(const IntRect&)rect
+{
+ Document* document = m_object->document();
+ if (!document)
+ return IntRect();
+
+ FrameView* frameView = document->view();
+ if (!frameView)
+ return IntRect();
+
+ IntPoint startPoint = frameView->screenToContents(rect.minXMaxYCorner());
+ IntPoint endPoint = frameView->screenToContents(rect.maxXMinYCorner());
+ return IntRect(startPoint.x(), startPoint.y(), endPoint.x() - startPoint.x(), endPoint.y() - startPoint.y());
+}
+
#pragma mark Search helpers
typedef HashMap<String, AccessibilitySearchKey> AccessibilitySearchKeyMap;
@@ -2904,6 +2930,8 @@
NSAccessibilityBoundsForRangeParameterizedAttribute,
NSAccessibilityStringForRangeParameterizedAttribute,
NSAccessibilityUIElementsForSearchPredicateParameterizedAttribute,
+ NSAccessibilityEndTextMarkerForBoundsParameterizedAttribute,
+ NSAccessibilityStartTextMarkerForBoundsParameterizedAttribute,
nil];
}
@@ -3243,6 +3271,8 @@
bool pointSet = false;
NSRange range = {0, 0};
bool rangeSet = false;
+ NSRect rect = NSZeroRect;
+ bool rectSet = false;
// basic parameter validation
if (!m_object || !attribute || !parameter)
@@ -3279,6 +3309,9 @@
} else if ([parameter isKindOfClass:[NSValue self]] && strcmp([(NSValue*)parameter objCType], @encode(NSRange)) == 0) {
rangeSet = true;
range = [(NSValue*)parameter rangeValue];
+ } else if ([parameter isKindOfClass:[NSValue self]] && strcmp([(NSValue*)parameter objCType], @encode(NSRect)) == 0) {
+ rectSet = true;
+ rect = [(NSValue*)parameter rectValue];
} else {
// Attribute type is not supported. Allow super to handle.
return [super accessibilityAttributeValue:attribute forParameter:parameter];
@@ -3327,6 +3360,15 @@
return convertToNSArray(results);
}
+ if ([attribute isEqualToString:NSAccessibilityEndTextMarkerForBoundsParameterizedAttribute]) {
+ IntRect webCoreRect = [self screenToContents:enclosingIntRect(rect)];
+ return [self textMarkerForVisiblePosition:m_object->visiblePositionForBounds(webCoreRect, LastVisiblePositionForBounds)];
+ }
+ if ([attribute isEqualToString:NSAccessibilityStartTextMarkerForBoundsParameterizedAttribute]) {
+ IntRect webCoreRect = [self screenToContents:enclosingIntRect(rect)];
+ return [self textMarkerForVisiblePosition:m_object->visiblePositionForBounds(webCoreRect, FirstVisiblePositionForBounds)];
+ }
+
if ([attribute isEqualToString:NSAccessibilityTextMarkerIsValidParameterizedAttribute]) {
VisiblePosition pos = [self visiblePositionForTextMarker:textMarker];
return [NSNumber numberWithBool:!pos.isNull()];
Modified: branches/safari-537.74-branch/Tools/ChangeLog (160468 => 160469)
--- branches/safari-537.74-branch/Tools/ChangeLog 2013-12-12 01:57:43 UTC (rev 160468)
+++ branches/safari-537.74-branch/Tools/ChangeLog 2013-12-12 01:59:00 UTC (rev 160469)
@@ -1,5 +1,53 @@
2013-12-11 Matthew Hanson <[email protected]>
+ Merge r157821
+
+ 2013-10-22 Samuel White <[email protected]>
+
+ AX: Add paramAttrs to fetch start and end text markers in a given rect.
+ https://bugs.webkit.org/show_bug.cgi?id=122164
+
+ Reviewed by Chris Fleizach.
+
+ Added accessibility element hooks to test endTextMarkerForBounds and startTextMarkerForBounds.
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (endTextMarkerForBoundsCallback):
+ (startTextMarkerForBoundsCallback):
+ (AccessibilityUIElement::endTextMarkerForBounds):
+ (AccessibilityUIElement::startTextMarkerForBounds):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::endTextMarkerForBounds):
+ (AccessibilityUIElement::startTextMarkerForBounds):
+ * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:
+ (WTR::AccessibilityUIElement::endTextMarkerForBounds):
+ (WTR::AccessibilityUIElement::startTextMarkerForBounds):
+ * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
+ * WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
+ * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
+ (WTR::AccessibilityUIElement::endTextMarkerForBounds):
+ (WTR::AccessibilityUIElement::startTextMarkerForBounds):
+ * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
+ (WTR::AccessibilityUIElement::endTextMarkerForBounds):
+ (WTR::AccessibilityUIElement::startTextMarkerForBounds):
+
+2013-12-11 Matthew Hanson <[email protected]>
+
+ Merge 157303
+
+ 2013-10-11 Brent Fulgham <[email protected]>
+
+ Unreviewed build fix for --64-bit target.
+
+ * Scripts/webkitdirs.pm:
+ (argumentsForConfiguration): Use 'isWin64' test, since @ARGV value may have
+ been removed by this point.
+ (hasArgument): Remove unused temporary.
+
+2013-12-11 Matthew Hanson <[email protected]>
+
Merge 154368
2013-08-20 Alex Christensen <[email protected]>
Modified: branches/safari-537.74-branch/Tools/DumpRenderTree/AccessibilityUIElement.cpp (160468 => 160469)
--- branches/safari-537.74-branch/Tools/DumpRenderTree/AccessibilityUIElement.cpp 2013-12-12 01:57:43 UTC (rev 160468)
+++ branches/safari-537.74-branch/Tools/DumpRenderTree/AccessibilityUIElement.cpp 2013-12-12 01:59:00 UTC (rev 160469)
@@ -664,6 +664,38 @@
return JSValueMakeString(context, markerRangeString.get());
}
+static JSValueRef endTextMarkerForBoundsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ int x = 0;
+ int y = 0;
+ int width = 0;
+ int height = 0;
+ if (argumentCount == 4) {
+ x = JSValueToNumber(context, arguments[0], exception);
+ y = JSValueToNumber(context, arguments[1], exception);
+ width = JSValueToNumber(context, arguments[2], exception);
+ height = JSValueToNumber(context, arguments[3], exception);
+ }
+
+ return AccessibilityTextMarker::makeJSAccessibilityTextMarker(context, toAXElement(thisObject)->endTextMarkerForBounds(x, y, width, height));
+}
+
+static JSValueRef startTextMarkerForBoundsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ int x = 0;
+ int y = 0;
+ int width = 0;
+ int height = 0;
+ if (argumentCount == 4) {
+ x = JSValueToNumber(context, arguments[0], exception);
+ y = JSValueToNumber(context, arguments[1], exception);
+ width = JSValueToNumber(context, arguments[2], exception);
+ height = JSValueToNumber(context, arguments[3], exception);
+ }
+
+ return AccessibilityTextMarker::makeJSAccessibilityTextMarker(context, toAXElement(thisObject)->startTextMarkerForBounds(x, y, width, height));
+}
+
static JSValueRef textMarkerForPointCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
int x = 0;
@@ -1164,6 +1196,16 @@
return 0;
}
+AccessibilityTextMarker AccessibilityUIElement::endTextMarkerForBounds(int x, int y, int width, int height)
+{
+ return 0;
+}
+
+AccessibilityTextMarker AccessibilityUIElement::startTextMarkerForBounds(int x, int y, int width, int height)
+{
+ return 0;
+}
+
AccessibilityTextMarker AccessibilityUIElement::textMarkerForPoint(int x, int y)
{
return 0;
@@ -1373,6 +1415,8 @@
{ "endTextMarkerForTextMarkerRange", endTextMarkerForTextMarkerRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "accessibilityElementForTextMarker", accessibilityElementForTextMarkerCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "textMarkerRangeLength", textMarkerRangeLengthCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "endTextMarkerForBounds", endTextMarkerForBoundsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "startTextMarkerForBounds", startTextMarkerForBoundsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "textMarkerForPoint", textMarkerForPointCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "nextTextMarker", nextTextMarkerCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "previousTextMarker", previousTextMarkerCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
Modified: branches/safari-537.74-branch/Tools/DumpRenderTree/AccessibilityUIElement.h (160468 => 160469)
--- branches/safari-537.74-branch/Tools/DumpRenderTree/AccessibilityUIElement.h 2013-12-12 01:57:43 UTC (rev 160468)
+++ branches/safari-537.74-branch/Tools/DumpRenderTree/AccessibilityUIElement.h 2013-12-12 01:59:00 UTC (rev 160469)
@@ -221,6 +221,8 @@
AccessibilityTextMarkerRange textMarkerRangeForMarkers(AccessibilityTextMarker* startMarker, AccessibilityTextMarker* endMarker);
AccessibilityTextMarker startTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange*);
AccessibilityTextMarker endTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange*);
+ AccessibilityTextMarker endTextMarkerForBounds(int x, int y, int width, int height);
+ AccessibilityTextMarker startTextMarkerForBounds(int x, int y, int width, int height);
AccessibilityTextMarker textMarkerForPoint(int x, int y);
AccessibilityTextMarker previousTextMarker(AccessibilityTextMarker*);
AccessibilityTextMarker nextTextMarker(AccessibilityTextMarker*);
Modified: branches/safari-537.74-branch/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm (160468 => 160469)
--- branches/safari-537.74-branch/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm 2013-12-12 01:57:43 UTC (rev 160468)
+++ branches/safari-537.74-branch/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm 2013-12-12 01:59:00 UTC (rev 160469)
@@ -56,6 +56,15 @@
#define NSAccessibilityPathAttribute @"AXPath"
#endif
+// Text
+#ifndef NSAccessibilityEndTextMarkerForBoundsParameterizedAttribute
+#define NSAccessibilityEndTextMarkerForBoundsParameterizedAttribute @"AXEndTextMarkerForBounds"
+#endif
+
+#ifndef NSAccessibilityStartTextMarkerForBoundsParameterizedAttribute
+#define NSAccessibilityStartTextMarkerForBoundsParameterizedAttribute @"AXStartTextMarkerForBounds"
+#endif
+
typedef void (*AXPostedNotificationCallback)(id element, NSString* notification, void* context);
@interface NSObject (WebKitAccessibilityAdditions)
@@ -1495,6 +1504,26 @@
return 0;
}
+AccessibilityTextMarker AccessibilityUIElement::endTextMarkerForBounds(int x, int y, int width, int height)
+{
+ BEGIN_AX_OBJC_EXCEPTIONS
+ id textMarker = [m_element accessibilityAttributeValue:NSAccessibilityEndTextMarkerForBoundsParameterizedAttribute forParameter:[NSValue valueWithRect:NSMakeRect(x, y, width, height)]];
+ return AccessibilityTextMarker(textMarker);
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
+}
+
+AccessibilityTextMarker AccessibilityUIElement::startTextMarkerForBounds(int x, int y, int width, int height)
+{
+ BEGIN_AX_OBJC_EXCEPTIONS
+ id textMarker = [m_element accessibilityAttributeValue:NSAccessibilityStartTextMarkerForBoundsParameterizedAttribute forParameter:[NSValue valueWithRect:NSMakeRect(x, y, width, height)]];
+ return AccessibilityTextMarker(textMarker);
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
+}
+
AccessibilityTextMarker AccessibilityUIElement::textMarkerForPoint(int x, int y)
{
BEGIN_AX_OBJC_EXCEPTIONS
Modified: branches/safari-537.74-branch/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp (160468 => 160469)
--- branches/safari-537.74-branch/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp 2013-12-12 01:57:43 UTC (rev 160468)
+++ branches/safari-537.74-branch/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp 2013-12-12 01:59:00 UTC (rev 160469)
@@ -171,6 +171,8 @@
PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::startTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange*) { return 0; }
PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::endTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange*) { return 0; }
PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::accessibilityElementForTextMarker(AccessibilityTextMarker*) { return 0; }
+PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::endTextMarkerForBounds(int x, int y, int width, int height) { return 0; }
+PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::startTextMarkerForBounds(int x, int y, int width, int height) { return 0; }
PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::textMarkerForPoint(int, int) { return 0; }
PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::previousTextMarker(AccessibilityTextMarker*) { return 0; }
PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::nextTextMarker(AccessibilityTextMarker*) { return 0; }
Modified: branches/safari-537.74-branch/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h (160468 => 160469)
--- branches/safari-537.74-branch/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h 2013-12-12 01:57:43 UTC (rev 160468)
+++ branches/safari-537.74-branch/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h 2013-12-12 01:59:00 UTC (rev 160469)
@@ -219,6 +219,8 @@
PassRefPtr<AccessibilityTextMarkerRange> textMarkerRangeForMarkers(AccessibilityTextMarker* startMarker, AccessibilityTextMarker* endMarker);
PassRefPtr<AccessibilityTextMarker> startTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange*);
PassRefPtr<AccessibilityTextMarker> endTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange*);
+ PassRefPtr<AccessibilityTextMarker> endTextMarkerForBounds(int x, int y, int width, int height);
+ PassRefPtr<AccessibilityTextMarker> startTextMarkerForBounds(int x, int y, int width, int height);
PassRefPtr<AccessibilityTextMarker> textMarkerForPoint(int x, int y);
PassRefPtr<AccessibilityTextMarker> previousTextMarker(AccessibilityTextMarker*);
PassRefPtr<AccessibilityTextMarker> nextTextMarker(AccessibilityTextMarker*);
Modified: branches/safari-537.74-branch/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl (160468 => 160469)
--- branches/safari-537.74-branch/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl 2013-12-12 01:57:43 UTC (rev 160468)
+++ branches/safari-537.74-branch/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl 2013-12-12 01:59:00 UTC (rev 160469)
@@ -155,6 +155,8 @@
AccessibilityTextMarkerRange textMarkerRangeForMarkers(AccessibilityTextMarker startMarker, AccessibilityTextMarker endMarker);
AccessibilityTextMarker startTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange range);
AccessibilityTextMarker endTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange range);
+ AccessibilityTextMarker endTextMarkerForBounds(int x, int y, int width, int height);
+ AccessibilityTextMarker startTextMarkerForBounds(int x, int y, int width, int height);
AccessibilityTextMarker textMarkerForPoint(int x, int y);
AccessibilityTextMarker previousTextMarker(AccessibilityTextMarker marker);
AccessibilityTextMarker nextTextMarker(AccessibilityTextMarker marker);
Modified: branches/safari-537.74-branch/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp (160468 => 160469)
--- branches/safari-537.74-branch/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp 2013-12-12 01:57:43 UTC (rev 160468)
+++ branches/safari-537.74-branch/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp 2013-12-12 01:59:00 UTC (rev 160469)
@@ -1155,6 +1155,18 @@
return 0;
}
+PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::endTextMarkerForBounds(int x, int y, int width, int height)
+{
+ // FIXME: implement
+ return 0;
+}
+
+PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::startTextMarkerForBounds(int x, int y, int width, int height)
+{
+ // FIXME: implement
+ return 0;
+}
+
PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::textMarkerForPoint(int x, int y)
{
// FIXME: implement
Modified: branches/safari-537.74-branch/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm (160468 => 160469)
--- branches/safari-537.74-branch/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm 2013-12-12 01:57:43 UTC (rev 160468)
+++ branches/safari-537.74-branch/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm 2013-12-12 01:59:00 UTC (rev 160469)
@@ -57,6 +57,15 @@
#define NSAccessibilityPathAttribute @"AXPath"
#endif
+// Text
+#ifndef NSAccessibilityEndTextMarkerForBoundsParameterizedAttribute
+#define NSAccessibilityEndTextMarkerForBoundsParameterizedAttribute @"AXEndTextMarkerForBounds"
+#endif
+
+#ifndef NSAccessibilityStartTextMarkerForBoundsParameterizedAttribute
+#define NSAccessibilityStartTextMarkerForBoundsParameterizedAttribute @"AXStartTextMarkerForBounds"
+#endif
+
typedef void (*AXPostedNotificationCallback)(id element, NSString* notification, void* context);
@interface NSObject (WebKitAccessibilityAdditions)
@@ -1428,6 +1437,26 @@
return 0;
}
+PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::endTextMarkerForBounds(int x, int y, int width, int height)
+{
+ BEGIN_AX_OBJC_EXCEPTIONS
+ id textMarker = [m_element accessibilityAttributeValue:NSAccessibilityEndTextMarkerForBoundsParameterizedAttribute forParameter:[NSValue valueWithRect:NSMakeRect(x, y, width, height)]];
+ return AccessibilityTextMarker::create(textMarker);
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
+}
+
+PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::startTextMarkerForBounds(int x, int y, int width, int height)
+{
+ BEGIN_AX_OBJC_EXCEPTIONS
+ id textMarker = [m_element accessibilityAttributeValue:NSAccessibilityStartTextMarkerForBoundsParameterizedAttribute forParameter:[NSValue valueWithRect:NSMakeRect(x, y, width, height)]];
+ return AccessibilityTextMarker::create(textMarker);
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
+}
+
PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::textMarkerForPoint(int x, int y)
{
BEGIN_AX_OBJC_EXCEPTIONS