Changeset 201568 in webkit
- Timestamp:
- Jun 1, 2016, 2:27:04 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/accessibility/ios-simulator/attributed-string-for-range-expected.txt (added)
-
LayoutTests/accessibility/ios-simulator/attributed-string-for-range.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm (modified) (4 diffs)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm (modified) (2 diffs)
-
Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r201566 r201568 1 2016-06-01 Chris Fleizach <cfleizach@apple.com> 2 3 AX: iOS: VoiceOver can't access attachments in mail messages 4 https://bugs.webkit.org/show_bug.cgi?id=158198 5 6 Reviewed by Joanmarie Diggs. 7 8 * accessibility/ios-simulator/attributed-string-for-range.html: Added. 9 1 10 2016-06-01 Commit Queue <commit-queue@webkit.org> 2 11 -
trunk/Source/WebCore/ChangeLog
r201567 r201568 1 2016-06-01 Chris Fleizach <cfleizach@apple.com> 2 3 AX: iOS: VoiceOver can't access attachments in mail messages 4 https://bugs.webkit.org/show_bug.cgi?id=158198 5 6 Reviewed by Joanmarie Diggs. 7 8 Replaced elements, like attachemnts, were not being exposed in the attributed string returned to VoiceOver. 9 Make sure they are exposed with the attachment character, pointing to the actual element. 10 11 Test: accessibility/ios-simulator/attributed-string-for-range.html 12 13 * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: 14 (AccessibilityUnignoredAncestor): 15 (-[WebAccessibilityObjectWrapper _stringForRange:attributed:]): 16 1 17 2016-06-01 Jer Noble <jer.noble@apple.com> 2 18 -
trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm
r200415 r201568 62 62 #import <CoreText/CoreText.h> 63 63 64 enum { 65 NSAttachmentCharacter = 0xfffc /* To denote attachments. */ 66 }; 67 64 68 @interface NSObject (AccessibilityPrivate) 65 69 - (void)_accessibilityUnregister; … … 107 111 static NSString * const UIAccessibilityTokenUnderline = @"UIAccessibilityTokenUnderline"; 108 112 static NSString * const UIAccessibilityTokenLanguage = @"UIAccessibilityTokenLanguage"; 113 static NSString * const UIAccessibilityTokenAttachment = @"UIAccessibilityTokenAttachment"; 109 114 110 115 static AccessibilityObjectWrapper* AccessibilityUnignoredAncestor(AccessibilityObjectWrapper *wrapper) … … 2286 2291 id returnValue = [[(NSString *)[returnClass alloc] init] autorelease]; 2287 2292 2293 const unichar attachmentChar = NSAttachmentCharacter; 2288 2294 NSInteger count = [array count]; 2289 2295 for (NSInteger k = 0; k < count; ++k) { 2290 2296 id object = [array objectAtIndex:k]; 2291 2297 2298 if (attributed && [object isKindOfClass:[WebAccessibilityObjectWrapper class]]) 2299 object = [[[NSMutableAttributedString alloc] initWithString:[NSString stringWithCharacters:&attachmentChar length:1] attributes:@{ UIAccessibilityTokenAttachment : object }] autorelease]; 2300 2292 2301 if (![object isKindOfClass:returnClass]) 2293 2302 continue; … … 2856 2865 } 2857 2866 2867 - (NSString *)description 2868 { 2858 2869 #ifndef NDEBUG 2859 - (NSString *)description2860 {2861 2870 CGRect frame = [self accessibilityFrame]; 2862 2871 return [NSString stringWithFormat:@"Role: (%d) - Text: %@: Value: %@ -- Frame: %f %f %f %f", m_object ? m_object->roleValue() : 0, [self accessibilityLabel], [self accessibilityValue], frame.origin.x, frame.origin.y, frame.size.width, frame.size.height]; 2863 } 2872 #else 2873 return [NSString stringWithFormat:@"%@: %@", [self class], [self accessibilityLabel]]; 2864 2874 #endif 2875 } 2865 2876 2866 2877 @end -
trunk/Tools/ChangeLog
r201550 r201568 1 2016-06-01 Chris Fleizach <cfleizach@apple.com> 2 3 AX: iOS: VoiceOver can't access attachments in mail messages 4 https://bugs.webkit.org/show_bug.cgi?id=158198 5 6 Reviewed by Joanmarie Diggs. 7 8 * DumpRenderTree/ios/AccessibilityUIElementIOS.mm: 9 (AccessibilityUIElement::stringForRange): 10 (AccessibilityUIElement::attributedStringForRange): 11 (AccessibilityUIElement::attributedStringRangeIsMisspelled): 12 * WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm: 13 (WTR::AccessibilityUIElement::attributedStringForRange): 14 (WTR::AccessibilityUIElement::attributedStringRangeIsMisspelled): 15 1 16 2016-06-01 Carlos Garcia Campos <cgarcia@igalia.com> 2 17 -
trunk/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm
r196699 r201568 74 74 - (NSString *)accessibilityPlaceholderValue; 75 75 - (NSString *)stringForRange:(NSRange)range; 76 - (NSAttributedString *)attributedStringForRange:(NSRange)range; 76 77 - (NSArray *)elementsForRange:(NSRange)range; 77 78 - (NSString *)selectionRangeString; … … 366 367 } 367 368 368 JSStringRef AccessibilityUIElement::attributedStringForRange(unsigned, unsigned) 369 { 370 return JSStringCreateWithCharacters(0, 0); 369 JSStringRef AccessibilityUIElement::attributedStringForRange(unsigned location, unsigned length) 370 { 371 NSRange range = NSMakeRange(location, length); 372 NSAttributedString* string = [m_element attributedStringForRange:range]; 373 if (![string isKindOfClass:[NSAttributedString class]]) 374 return 0; 375 376 NSString* stringWithAttrs = [string description]; 377 return [stringWithAttrs createJSStringRef]; 371 378 } 372 379 -
trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm
r196699 r201568 51 51 - (NSString *)accessibilityPlaceholderValue; 52 52 - (NSString *)stringForRange:(NSRange)range; 53 - (NSAttributedString *)attributedStringForRange:(NSRange)range; 53 54 - (NSArray *)elementsForRange:(NSRange)range; 54 55 - (NSString *)selectionRangeString; … … 624 625 JSRetainPtr<JSStringRef> AccessibilityUIElement::attributedStringForRange(unsigned location, unsigned length) 625 626 { 626 return JSStringCreateWithCharacters(0, 0); 627 NSAttributedString *stringForRange = [m_element attributedStringForRange:NSMakeRange(location, length)]; 628 if (!stringForRange) 629 return nullptr; 630 631 return [[stringForRange description] createJSStringRef]; 627 632 } 628 633
Note:
See TracChangeset
for help on using the changeset viewer.