Changeset 152537 in webkit
- Timestamp:
- Jul 10, 2013 9:20:24 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r152533 r152537 1 2013-07-10 Mario Sanchez Prada <mario.prada@samsung.com> 2 3 AX: Allow requesting the full plain text for an object with textUnderElement() 4 https://bugs.webkit.org/show_bug.cgi?id=105214 5 6 Reviewed by Chris Fleizach. 7 8 Removed tests that are not longer expected to fail. 9 10 * platform/gtk/TestExpectations: Removed tests. 11 1 12 2013-07-10 Simon Pena <simon.pena@samsung.com> 2 13 -
trunk/LayoutTests/platform/gtk/TestExpectations
r152447 r152537 838 838 webkit.org/b/98360 accessibility/aria-used-on-image-maps.html [ Failure ] 839 839 webkit.org/b/98361 accessibility/button-press-action.html [ Failure ] 840 webkit.org/b/105214 accessibility/button-title-uses-inner-img-alt.html [ Failure ]841 840 webkit.org/b/98363 accessibility/canvas-fallback-content-2.html [ Failure ] 842 webkit.org/b/105214 accessibility/focusable-div.html [ Failure ]843 webkit.org/b/105214 accessibility/listitem-title.html [ Failure ]844 841 webkit.org/b/98370 accessibility/loading-iframe-sends-notification.html [ Failure ] 845 842 webkit.org/b/98371 accessibility/loading-iframe-updates-axtree.html [ Failure ] -
trunk/Source/WebCore/ChangeLog
r152534 r152537 1 2013-07-10 Mario Sanchez Prada <mario.prada@samsung.com> 2 3 AX: Allow requesting the full plain text for an object with textUnderElement() 4 https://bugs.webkit.org/show_bug.cgi?id=105214 5 6 Reviewed by Chris Fleizach. 7 8 Allow specifying different function modes for textUnderElement(), 9 so we can effectively ask for the "normal" result (e.g to retrieve 10 test to be exposed as the 'title') or for the full text under the 11 element (without omitting any child in the subtree). This is 12 needed for the implementation of atk_text_get_text() in GTK/EFL. 13 14 * accessibility/AccessibilityObject.h: Add new enumeration to 15 specify the different modes for textUnderElement(). 16 (WebCore::AccessibilityObject::textUnderElement): Added parameter. 17 18 * accessibility/AccessibilityNodeObject.cpp: 19 (WebCore::shouldUseAccessiblityObjectInnerText): Always return 20 'true' when using the "include all children" mode. 21 (WebCore::AccessibilityNodeObject::textUnderElement): Updated call 22 to shouldUseAccessiblityObjectInnerText(). 23 * accessibility/AccessibilityNodeObject.h: 24 25 * accessibility/AccessibilityRenderObject.cpp: 26 (WebCore::AccessibilityRenderObject::textUnderElement): Removed 27 GTK specific code and expand the usage of text iterators beyond 28 text render objects, using it also when in the "include all 29 children" mode. 30 * accessibility/AccessibilityRenderObject.h: 31 32 * accessibility/atk/AccessibilityObjectAtk.cpp: 33 (WebCore::AccessibilityObject::getLengthForTextRange): Updated 34 call to textUnderElement(), preserving the previous behavior. 35 36 * accessibility/atk/WebKitAccessibleInterfaceText.cpp: 37 (webkitAccessibleTextGetText): Updated call to textUnderElement(), 38 using the "include all children" mode. 39 1 40 2013-07-10 Sergio Correia <sergio.correia@openbossa.org> 2 41 -
trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp
r152532 r152537 1505 1505 // When building the textUnderElement for an object, determine whether or not 1506 1506 // we should include the inner text of this given descendant object or skip it. 1507 static bool shouldUseAccessiblityObjectInnerText(AccessibilityObject* obj) 1508 { 1507 static bool shouldUseAccessiblityObjectInnerText(AccessibilityObject* obj, AccessibilityTextUnderElementMode mode) 1508 { 1509 // Do not use any heuristic if we are explicitly asking to include all the children. 1510 if (mode == TextUnderElementModeIncludeAllChildren) 1511 return true; 1512 1509 1513 // Consider this hypothetical example: 1510 1514 // <div tabindex=0> … … 1543 1547 } 1544 1548 1545 String AccessibilityNodeObject::textUnderElement( ) const1549 String AccessibilityNodeObject::textUnderElement(AccessibilityTextUnderElementMode mode) const 1546 1550 { 1547 1551 Node* node = this->node(); … … 1551 1555 StringBuilder builder; 1552 1556 for (AccessibilityObject* child = firstChild(); child; child = child->nextSibling()) { 1553 if (!shouldUseAccessiblityObjectInnerText(child ))1557 if (!shouldUseAccessiblityObjectInnerText(child, mode)) 1554 1558 continue; 1555 1559 … … 1565 1569 } 1566 1570 1567 String childText = child->textUnderElement( );1571 String childText = child->textUnderElement(mode); 1568 1572 if (childText.length()) { 1569 1573 if (builder.length()) -
trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h
r151841 r152537 121 121 122 122 virtual unsigned hierarchicalLevel() const; 123 virtual String textUnderElement( ) const;123 virtual String textUnderElement(AccessibilityTextUnderElementMode = TextUnderElementModeSkipIgnoredChildren) const; 124 124 virtual String accessibilityDescription() const; 125 125 virtual String helpText() const; -
trunk/Source/WebCore/accessibility/AccessibilityObject.h
r151776 r152537 240 240 } 241 241 }; 242 243 enum AccessibilityTextUnderElementMode { 244 TextUnderElementModeSkipIgnoredChildren, 245 TextUnderElementModeIncludeAllChildren 246 }; 242 247 243 248 enum AccessibilityOrientation { … … 586 591 // Methods for determining accessibility text. 587 592 virtual String stringValue() const { return String(); } 588 virtual String textUnderElement( ) const { return String(); }593 virtual String textUnderElement(AccessibilityTextUnderElementMode = TextUnderElementModeSkipIgnoredChildren) const { return String(); } 589 594 virtual String text() const { return String(); } 590 595 virtual int textLength() const { return 0; } -
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
r152522 r152537 627 627 } 628 628 629 String AccessibilityRenderObject::textUnderElement( ) const629 String AccessibilityRenderObject::textUnderElement(AccessibilityTextUnderElementMode mode) const 630 630 { 631 631 if (!m_renderer) … … 646 646 #endif 647 647 648 #if PLATFORM(GTK) 649 // On GTK, always use a text iterator in order to get embedded object characters. 650 // TODO: Add support for embedded object characters to the other codepaths that try 651 // to build the accessible text recursively, so this special case isn't needed. 652 // https://bugs.webkit.org/show_bug.cgi?id=105214 653 if (Node* node = this->node()) { 654 if (Frame* frame = node->document()->frame()) { 655 // catch stale WebCoreAXObject (see <rdar://problem/3960196>) 656 if (frame->document() != node->document()) 657 return String(); 658 659 return plainText(rangeOfContents(node).get(), textIteratorBehaviorForTextRange()); 660 } 661 } 662 #endif 663 664 if (m_renderer->isText()) { 648 // We use a text iterator for text objects AND for those cases where we are 649 // explicitly asking for the full text under a given element. 650 if (m_renderer->isText() || mode == TextUnderElementModeIncludeAllChildren) { 665 651 // If possible, use a text iterator to get the text, so that whitespace 666 652 // is handled consistently. … … 684 670 } 685 671 686 return AccessibilityNodeObject::textUnderElement( );672 return AccessibilityNodeObject::textUnderElement(mode); 687 673 } 688 674 -
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.h
r151123 r152537 145 145 virtual String stringValue() const; 146 146 virtual String helpText() const; 147 virtual String textUnderElement( ) const;147 virtual String textUnderElement(AccessibilityTextUnderElementMode = TextUnderElementModeSkipIgnoredChildren) const; 148 148 virtual String text() const; 149 149 virtual int textLength() const; -
trunk/Source/WebCore/accessibility/atk/AccessibilityObjectAtk.cpp
r140166 r152537 165 165 // accessibility object if the value is still zero. 166 166 if (!textLength && allowsTextRanges()) 167 textLength = textUnderElement( ).length();167 textLength = textUnderElement(TextUnderElementModeIncludeAllChildren).length(); 168 168 169 169 return textLength; -
trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp
r152396 r152537 536 536 end = coreObject->stringValue().length(); 537 537 if (!end) 538 end = coreObject->textUnderElement( ).length();538 end = coreObject->textUnderElement(TextUnderElementModeIncludeAllChildren).length(); 539 539 } 540 540 … … 545 545 ret = coreObject->stringValue(); 546 546 if (!ret) 547 ret = coreObject->textUnderElement( );547 ret = coreObject->textUnderElement(TextUnderElementModeIncludeAllChildren); 548 548 } 549 549
Note: See TracChangeset
for help on using the changeset viewer.