Changeset 158617 in webkit
- Timestamp:
- Nov 4, 2013, 4:47:32 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r158614 r158617 1 2013-11-04 Chris Fleizach <cfleizach@apple.com> 2 3 AX: Mail attachments at the start of an email are not output by VoiceOver 4 https://bugs.webkit.org/show_bug.cgi?id=123697 5 6 Reviewed by Ryosuke Niwa. 7 8 Add two flavors of this. One where the replaced element has rendered children and one where it does not, 9 which go down two different code paths. 10 11 * platform/mac/accessibility/object-replacement-with-no-rendered-children-at-node-start-expected.txt: Added. 12 * platform/mac/accessibility/object-replacement-with-no-rendered-children-at-node-start.html: Added. 13 * platform/mac/accessibility/object-replacement-with-rendered-children-at-node-start-expected.txt: Added. 14 * platform/mac/accessibility/object-replacement-with-rendered-children-at-node-start.html: Added. 15 1 16 2013-11-04 Ryosuke Niwa <rniwa@webkit.org> 2 17 -
trunk/Source/WebCore/ChangeLog
r158611 r158617 1 2013-11-04 Chris Fleizach <cfleizach@apple.com> 2 3 AX: Mail attachments at the start of an email are not output by VoiceOver 4 https://bugs.webkit.org/show_bug.cgi?id=123697 5 6 Reviewed by Ryosuke Niwa. 7 8 VoiceOver is expecting that "replaced elements" (attachments in a Mail message in this case) to be 9 represented by the replacement character when asking for a stringForRange. 10 11 However, when that replaced element is at the beginning of the document, the logic does not work because 12 there is a few code places that will take that first Position and advance it forward, not accounting for replaced elements. 13 When using the TextIterator normally, it does account for these, so that's why it's only affecting as at the beginning of the document. 14 15 Also a "replaced element" can be more than just renderer->isReplaced(), hence the externing of the isRendererReplacedElement method 16 and using that it in pertinent places. 17 18 Tests: platform/mac/accessibility/object-replacement-with-no-rendered-children-at-node-start.html 19 platform/mac/accessibility/object-replacement-with-rendered-children-at-node-start.html 20 21 * accessibility/AccessibilityObject.cpp: 22 (WebCore::replacedNodeNeedsCharacter): 23 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: 24 (nsStringForReplacedNode): 25 * dom/Position.cpp: 26 (WebCore::Position::isCandidate): 27 * dom/PositionIterator.cpp: 28 * dom/Range.cpp: 29 (WebCore::Range::firstNode): 30 * editing/TextIterator.cpp: 31 (WebCore::isRendererReplacedElement): 32 * editing/TextIterator.h: 33 1 34 2013-11-04 Andreas Kling <akling@apple.com> 2 35 -
trunk/Source/WebCore/accessibility/AccessibilityObject.cpp
r158163 r158617 840 840 // we should always be given a rendered node and a replaced node, but be safe 841 841 // replaced nodes are either attachments (widgets) or images 842 if (!replacedNode || ! replacedNode->renderer() || !replacedNode->renderer()->isReplaced() || replacedNode->isTextNode())842 if (!replacedNode || !isRendererReplacedElement(replacedNode->renderer()) || replacedNode->isTextNode()) 843 843 return false; 844 844 -
trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
r158332 r158617 874 874 // we should always be given a rendered node and a replaced node, but be safe 875 875 // replaced nodes are either attachments (widgets) or images 876 if (!replacedNode || ! replacedNode->renderer() || !replacedNode->renderer()->isReplaced() || replacedNode->isTextNode()) {876 if (!replacedNode || !isRendererReplacedElement(replacedNode->renderer()) || replacedNode->isTextNode()) { 877 877 ASSERT_NOT_REACHED(); 878 878 return nil; -
trunk/Source/WebCore/dom/Position.cpp
r158163 r158617 938 938 return false; 939 939 940 if (isRendererReplacedElement(renderer)) 941 return !nodeIsUserSelectNone(deprecatedNode()) && atFirstEditingPositionForNode(); 942 940 943 if (renderer->isRenderBlockFlow()) { 941 944 RenderBlock& block = toRenderBlock(*renderer); -
trunk/Source/WebCore/dom/PositionIterator.cpp
r158569 r158617 30 30 #include "RenderBlock.h" 31 31 #include "RenderText.h" 32 #include "TextIterator.h" 32 33 #include "htmlediting.h" 33 34 -
trunk/Source/WebCore/dom/Range.cpp
r158569 r158617 1551 1551 if (m_start.container()->offsetInCharacters()) 1552 1552 return m_start.container(); 1553 if (isRendererReplacedElement(m_start.container()->renderer())) 1554 return m_start.container(); 1553 1555 if (Node* child = m_start.container()->childNode(m_start.offset())) 1554 1556 return child; -
trunk/Source/WebCore/editing/TextIterator.cpp
r158551 r158617 246 246 } 247 247 248 staticbool isRendererReplacedElement(RenderObject* renderer)248 bool isRendererReplacedElement(RenderObject* renderer) 249 249 { 250 250 if (!renderer) -
trunk/Source/WebCore/editing/TextIterator.h
r158428 r158617 64 64 String plainText(const Range*, TextIteratorBehavior defaultBehavior = TextIteratorDefaultBehavior, bool isDisplayString = false); 65 65 PassRefPtr<Range> findPlainText(const Range*, const String&, FindOptions); 66 bool isRendererReplacedElement(RenderObject*); 66 67 67 68 class BitStack { -
trunk/Tools/DumpRenderTree/AccessibilityUIElement.cpp
r157821 r158617 748 748 } 749 749 750 static JSValueRef startTextMarkerCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef, JSValueRef*) 751 { 752 return AccessibilityTextMarker::makeJSAccessibilityTextMarker(context, toAXElement(thisObject)->startTextMarker()); 753 } 754 755 static JSValueRef endTextMarkerCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef, JSValueRef*) 756 { 757 return AccessibilityTextMarker::makeJSAccessibilityTextMarker(context, toAXElement(thisObject)->endTextMarker()); 758 } 759 750 760 // Static Value Getters 751 761 … … 1239 1249 1240 1250 AccessibilityTextMarker AccessibilityUIElement::textMarkerForIndex(int) 1251 { 1252 return 0; 1253 } 1254 1255 AccessibilityTextMarker AccessibilityUIElement::startTextMarker() 1256 { 1257 return 0; 1258 } 1259 1260 AccessibilityTextMarker AccessibilityUIElement::endTextMarker() 1241 1261 { 1242 1262 return 0; … … 1315 1335 { "horizontalScrollbar", horizontalScrollbarCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1316 1336 { "verticalScrollbar", verticalScrollbarCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1337 { "startTextMarker", startTextMarkerCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1338 { "endTextMarker", endTextMarkerCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1317 1339 #if PLATFORM(IOS) 1318 1340 { "iphoneLabel", getIPhoneLabelCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, -
trunk/Tools/DumpRenderTree/AccessibilityUIElement.h
r157821 r158617 230 230 AccessibilityTextMarker nextTextMarker(AccessibilityTextMarker*); 231 231 AccessibilityUIElement accessibilityElementForTextMarker(AccessibilityTextMarker*); 232 AccessibilityTextMarker startTextMarker(); 233 AccessibilityTextMarker endTextMarker(); 234 232 235 JSStringRef stringForTextMarkerRange(AccessibilityTextMarkerRange*); 233 236 int textMarkerRangeLength(AccessibilityTextMarkerRange*); -
trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
r157821 r158617 1564 1564 } 1565 1565 1566 AccessibilityTextMarker AccessibilityUIElement::startTextMarker() 1567 { 1568 BEGIN_AX_OBJC_EXCEPTIONS 1569 id textMarker = [m_element accessibilityAttributeValue:@"AXStartTextMarker"]; 1570 return AccessibilityTextMarker(textMarker); 1571 END_AX_OBJC_EXCEPTIONS 1572 1573 return 0; 1574 } 1575 1576 AccessibilityTextMarker AccessibilityUIElement::endTextMarker() 1577 { 1578 BEGIN_AX_OBJC_EXCEPTIONS 1579 id textMarker = [m_element accessibilityAttributeValue:@"AXEndTextMarker"]; 1580 return AccessibilityTextMarker(textMarker); 1581 END_AX_OBJC_EXCEPTIONS 1582 1583 return 0; 1584 } 1585 1566 1586 #endif // SUPPORTS_AX_TEXTMARKERS 1567 1587 -
trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp
r157821 r158617 178 178 PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::previousTextMarker(AccessibilityTextMarker*) { return 0; } 179 179 PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::nextTextMarker(AccessibilityTextMarker*) { return 0; } 180 PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::startTextMarker() { return 0; } 181 PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::endTextMarker() { return 0; } 180 182 JSRetainPtr<JSStringRef> AccessibilityUIElement::stringForTextMarkerRange(AccessibilityTextMarkerRange*) { return 0; } 181 183 bool AccessibilityUIElement::attributedStringForTextMarkerRangeContainsAttribute(JSStringRef, AccessibilityTextMarkerRange*) { return false; } -
trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h
r158266 r158617 226 226 bool isTextMarkerValid(AccessibilityTextMarker*); 227 227 PassRefPtr<AccessibilityTextMarker> textMarkerForIndex(int); 228 PassRefPtr<AccessibilityTextMarker> startTextMarker(); 229 PassRefPtr<AccessibilityTextMarker> endTextMarker(); 228 230 229 231 // Returns an ordered list of supported actions for an element. -
trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl
r157821 r158617 170 170 boolean isTextMarkerValid(AccessibilityTextMarker marker); 171 171 AccessibilityTextMarker textMarkerForIndex(int textIndex); 172 readonly attribute AccessibilityTextMarker startTextMarker; 173 readonly attribute AccessibilityTextMarker endTextMarker; 172 174 173 175 // Returns an ordered list of supported actions for an element. -
trunk/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp
r158576 r158617 1469 1469 return 0; 1470 1470 } 1471 1472 PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::startTextMarker() 1473 { 1474 // FIXME: implement 1475 return 0; 1476 } 1477 1478 PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::endTextMarker() 1479 { 1480 // FIXME: implement 1481 return 0; 1482 } 1471 1483 1472 1484 void AccessibilityUIElement::scrollToMakeVisible() -
trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm
r157821 r158617 1543 1543 return 0; 1544 1544 } 1545 1546 PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::startTextMarker() 1547 { 1548 BEGIN_AX_OBJC_EXCEPTIONS 1549 id textMarker = [m_element accessibilityAttributeValue:@"AXStartTextMarker"]; 1550 return AccessibilityTextMarker::create(textMarker); 1551 END_AX_OBJC_EXCEPTIONS 1552 1553 return 0; 1554 } 1555 1556 PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::endTextMarker() 1557 { 1558 BEGIN_AX_OBJC_EXCEPTIONS 1559 id textMarker = [m_element accessibilityAttributeValue:@"AXEndTextMarker"]; 1560 return AccessibilityTextMarker::create(textMarker); 1561 END_AX_OBJC_EXCEPTIONS 1562 1563 return 0; 1564 } 1545 1565 1546 1566 static NSString *_convertMathMultiscriptPairsToString(NSArray *pairs)
Note:
See TracChangeset
for help on using the changeset viewer.