Diff
Modified: trunk/Tools/ChangeLog (274967 => 274968)
--- trunk/Tools/ChangeLog 2021-03-24 20:11:16 UTC (rev 274967)
+++ trunk/Tools/ChangeLog 2021-03-24 20:37:57 UTC (rev 274968)
@@ -1,3 +1,22 @@
+2021-03-24 Chris Fleizach <[email protected]>
+
+ AX: Add functions rectsForTextMarkerRange for testing
+ https://bugs.webkit.org/show_bug.cgi?id=223705
+ <rdar://problem/75797361>
+
+ Reviewed by Zalan Bujtas.
+
+ * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
+ * WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
+ * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
+ (WTR::AccessibilityUIElement::rectsForTextMarkerRange):
+ * WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
+ (WTR::AccessibilityUIElement::rectsForTextMarkerRange):
+ * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
+ (WTR::AccessibilityUIElement::rectsForTextMarkerRange):
+ * WebKitTestRunner/InjectedBundle/win/AccessibilityUIElementWin.cpp:
+ (WTR::AccessibilityUIElement::rectsForTextMarkerRange):
+
2021-03-24 Chris Dumez <[email protected]>
Address undefined behavior found by UBSan in StringToIntegerConversion.h
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h (274967 => 274968)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h 2021-03-24 20:11:16 UTC (rev 274967)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h 2021-03-24 20:37:57 UTC (rev 274968)
@@ -317,6 +317,7 @@
RefPtr<AccessibilityTextMarker> nextTextMarker(AccessibilityTextMarker*);
RefPtr<AccessibilityUIElement> accessibilityElementForTextMarker(AccessibilityTextMarker*);
JSRetainPtr<JSStringRef> stringForTextMarkerRange(AccessibilityTextMarkerRange*);
+ JSRetainPtr<JSStringRef> rectsForTextMarkerRange(AccessibilityTextMarkerRange*, JSStringRef);
JSRetainPtr<JSStringRef> attributedStringForTextMarkerRange(AccessibilityTextMarkerRange*);
JSRetainPtr<JSStringRef> attributedStringForTextMarkerRangeWithOptions(AccessibilityTextMarkerRange*, bool);
int textMarkerRangeLength(AccessibilityTextMarkerRange*);
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl (274967 => 274968)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl 2021-03-24 20:11:16 UTC (rev 274967)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl 2021-03-24 20:37:57 UTC (rev 274968)
@@ -234,6 +234,7 @@
AccessibilityTextMarker nextTextMarker(AccessibilityTextMarker marker);
AccessibilityUIElement accessibilityElementForTextMarker(AccessibilityTextMarker marker);
DOMString stringForTextMarkerRange(AccessibilityTextMarkerRange range);
+ DOMString rectsForTextMarkerRange(AccessibilityTextMarkerRange range, DOMString searchText);
DOMString attributedStringForTextMarkerRange(AccessibilityTextMarkerRange range);
DOMString attributedStringForTextMarkerRangeWithOptions(AccessibilityTextMarkerRange range, boolean includeSpellCheck);
long textMarkerRangeLength(AccessibilityTextMarkerRange range);
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp (274967 => 274968)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp 2021-03-24 20:11:16 UTC (rev 274967)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp 2021-03-24 20:37:57 UTC (rev 274968)
@@ -2126,6 +2126,12 @@
return JSStringCreateWithCharacters(0, 0);
}
+JSRetainPtr<JSStringRef> AccessibilityUIElement::rectsForTextMarkerRange(AccessibilityTextMarkerRange* markerRange, JSStringRef searchText)
+{
+ // FIXME: implement
+ return JSStringCreateWithCharacters(0, 0);
+}
+
RefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::textMarkerRangeForMarkers(AccessibilityTextMarker* startMarker, AccessibilityTextMarker* endMarker)
{
// FIXME: implement
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm (274967 => 274968)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm 2021-03-24 20:11:16 UTC (rev 274967)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm 2021-03-24 20:37:57 UTC (rev 274968)
@@ -106,6 +106,7 @@
- (NSArray *)textMarkerRange;
- (NSInteger)lengthForTextMarkers:(NSArray *)textMarkers;
- (NSString *)stringForTextMarkers:(NSArray *)markers;
+- (NSArray *)textRectsFromMarkers:(NSArray *)markers withText:(NSString *)text;
- (id)startOrEndTextMarkerForTextMarkers:(NSArray*)textMarkers isStart:(BOOL)isStart;
- (NSArray *)textMarkerRangeForMarkers:(NSArray *)textMarkers;
- (NSInteger)positionForTextMarker:(id)marker;
@@ -1186,6 +1187,14 @@
return [[m_element stringForTextMarkers:textMarkers] createJSStringRef];
}
+JSRetainPtr<JSStringRef> AccessibilityUIElement::rectsForTextMarkerRange(AccessibilityTextMarkerRange* markerRange, JSStringRef text)
+{
+ id textMarkers = markerRange->platformTextMarkerRange();
+ if (![textMarkers isKindOfClass:[NSArray class]])
+ return createJSString();
+ return [[[m_element textRectsFromMarkers:textMarkers withText:[NSString stringWithJSStringRef:text]] componentsJoinedByString:@","] createJSStringRef];
+}
+
RefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::textMarkerRangeForMarkers(AccessibilityTextMarker* startMarker, AccessibilityTextMarker* endMarker)
{
NSArray *textMarkers = @[startMarker->platformTextMarker(), endMarker->platformTextMarker()];
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm (274967 => 274968)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm 2021-03-24 20:11:16 UTC (rev 274967)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm 2021-03-24 20:37:57 UTC (rev 274968)
@@ -1808,6 +1808,12 @@
return nullptr;
}
+JSRetainPtr<JSStringRef> AccessibilityUIElement::rectsForTextMarkerRange(AccessibilityTextMarkerRange*, JSStringRef)
+{
+ // Not implemented on macOS
+ return nullptr;
+}
+
RefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::textMarkerRangeForMarkers(AccessibilityTextMarker* startMarker, AccessibilityTextMarker* endMarker)
{
BEGIN_AX_OBJC_EXCEPTIONS
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/win/AccessibilityUIElementWin.cpp (274967 => 274968)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/win/AccessibilityUIElementWin.cpp 2021-03-24 20:11:16 UTC (rev 274967)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/win/AccessibilityUIElementWin.cpp 2021-03-24 20:37:57 UTC (rev 274968)
@@ -814,6 +814,12 @@
return nullptr;
}
+JSRetainPtr<JSStringRef> AccessibilityUIElement::rectsForTextMarkerRange(AccessibilityTextMarkerRange*, JSStringRef)
+{
+ notImplemented();
+ return nullptr;
+}
+
JSRetainPtr<JSStringRef> AccessibilityUIElement::stringForTextMarkerRange(AccessibilityTextMarkerRange*)
{
notImplemented();