Changeset 174992 in webkit


Ignore:
Timestamp:
Oct 21, 2014 11:44:20 AM (10 years ago)
Author:
jdiggs@igalia.com
Message:

AX: [ATK] CSS-generated text content not exposed to assistive technologies
https://bugs.webkit.org/show_bug.cgi?id=137669

Reviewed by Chris Fleizach.

Source/WebCore:

Do not use a text iterator to get the text for elements which include
pseudo elements.

Test: accessibility/css-content-attribute.html

  • accessibility/AccessibilityRenderObject.cpp:

(WebCore::AccessibilityRenderObject::textUnderElement):

LayoutTests:

Moved the Mac platform test and modified it to dump the accessible tree
and string values rather than a platform-specific hierarchy so that it
could be shared across platforms.

  • accessibility/css-content-attribute.html: Added.
  • platform/gtk/accessibility/css-content-attribute-expected.txt: Added.
  • platform/mac/accessibility/css-content-attribute-expected.txt: Modified to reflect new output.
  • platform/mac/accessibility/css-content-attribute.html: Removed.
Location:
trunk
Files:
2 added
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r174986 r174992  
     12014-10-21  Joanmarie Diggs  <jdiggs@igalia.com>
     2
     3        AX: [ATK] CSS-generated text content not exposed to assistive technologies
     4        https://bugs.webkit.org/show_bug.cgi?id=137669
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Moved the Mac platform test and modified it to dump the accessible tree
     9        and string values rather than a platform-specific hierarchy so that it
     10        could be shared across platforms.
     11
     12        * accessibility/css-content-attribute.html: Added.
     13        * platform/gtk/accessibility/css-content-attribute-expected.txt: Added.
     14        * platform/mac/accessibility/css-content-attribute-expected.txt: Modified to reflect new output.
     15        * platform/mac/accessibility/css-content-attribute.html: Removed.
     16
    1172014-10-21  Zalan Bujtas  <zalan@apple.com>
    218
  • trunk/LayoutTests/platform/mac/accessibility/css-content-attribute-expected.txt

    r53000 r174992  
    11SAMPLE
    22
     3End of test
    34This tests that when the content attribute in CSS is used, the correct values are returned.
    45
     
    67
    78
    8 PASS body.childAtIndex(0).childAtIndex(0).role is 'AXRole: AXStaticText'
    9 PASS body.childAtIndex(0).childAtIndex(1).role is 'AXRole: AXStaticText'
    10 PASS body.childAtIndex(0).childAtIndex(2).role is 'AXRole: AXStaticText'
    11 PASS body.childAtIndex(0).childAtIndex(0).stringValue is 'AXValue: This is a'
    12 PASS body.childAtIndex(0).childAtIndex(1).stringValue is 'AXValue: SAMPLE'
    13 PASS body.childAtIndex(0).childAtIndex(2).stringValue is 'AXValue: Headline'
     9AXRole: AXWebArea AXValue:
     10  AXRole: AXHeading AXValue: 1
     11    AXRole: AXStaticText AXValue: This is a
     12    AXRole: AXStaticText AXValue: SAMPLE
     13    AXRole: AXStaticText AXValue: Headline
     14  AXRole: AXGroup AXValue:
    1415PASS successfullyParsed is true
    1516
  • trunk/Source/WebCore/ChangeLog

    r174991 r174992  
     12014-10-21  Joanmarie Diggs  <jdiggs@igalia.com>
     2
     3        AX: [ATK] CSS-generated text content not exposed to assistive technologies
     4        https://bugs.webkit.org/show_bug.cgi?id=137669
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Do not use a text iterator to get the text for elements which include
     9        pseudo elements.
     10
     11        Test: accessibility/css-content-attribute.html
     12
     13        * accessibility/AccessibilityRenderObject.cpp:
     14        (WebCore::AccessibilityRenderObject::textUnderElement):
     15
    1162014-10-21  Chris Dumez  <cdumez@apple.com>
    217
  • trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp

    r174917 r174992  
    638638#endif
    639639
     640    // rangeOfContents does not include CSS-generated content.
     641    if (m_renderer->isBeforeOrAfterContent())
     642        return AccessibilityNodeObject::textUnderElement(mode);
     643
    640644    // We use a text iterator for text objects AND for those cases where we are
    641645    // explicitly asking for the full text under a given element.
     
    646650        RefPtr<Range> textRange;
    647651        if (Node* node = m_renderer->node()) {
     652            // rangeOfContents does not include CSS-generated content.
     653            Node* firstChild = node->pseudoAwareFirstChild();
     654            Node* lastChild = node->pseudoAwareLastChild();
     655            if ((firstChild && firstChild->isPseudoElement()) || (lastChild && lastChild->isPseudoElement()))
     656                return AccessibilityNodeObject::textUnderElement(mode);
     657
    648658            nodeDocument = &node->document();
    649659            textRange = rangeOfContents(*node);
Note: See TracChangeset for help on using the changeset viewer.