Changeset 168042 in webkit


Ignore:
Timestamp:
Apr 30, 2014 1:47:16 PM (10 years ago)
Author:
Chris Fleizach
Message:

AX: Make "contenteditable" regions into AXTextAreas
https://bugs.webkit.org/show_bug.cgi?id=132379

Reviewed by Mario Sanchez Prada.

Source/WebCore:
Make contenteditable regions into AXTextAreas. This will allow for a more standardized
interface for interaction with assistive technologies.

Test: accessibility/content-editable-as-textarea.html

  • accessibility/AccessibilityNodeObject.cpp:

(WebCore::AccessibilityNodeObject::hasContentEditableAttributeSet):

  • accessibility/AccessibilityObject.cpp:

(WebCore::AccessibilityObject::contentEditableAttributeIsEnabled):

  • accessibility/AccessibilityObject.h:
  • accessibility/AccessibilityRenderObject.cpp:

(WebCore::AccessibilityRenderObject::documentBasedSelectedTextRange):
(WebCore::AccessibilityRenderObject::selectedText):
(WebCore::AccessibilityRenderObject::selectedTextRange):
(WebCore::AccessibilityRenderObject::renderObjectIsObservable):
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
(WebCore::AccessibilityRenderObject::ariaSelectedTextRange): Deleted.

  • accessibility/AccessibilityRenderObject.h:

LayoutTests:

  • accessibility/content-editable-as-textarea.html: Added.
  • platform/mac-mountainlion/accessibility/content-editable-as-textarea-expected.txt: Added.
  • platform/mac/accessibility/content-editable-as-textarea-expected.txt: Added.
Location:
trunk
Files:
3 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r168031 r168042  
     12014-04-30  Chris Fleizach  <cfleizach@apple.com>
     2
     3        AX: Make "contenteditable" regions into AXTextAreas
     4        https://bugs.webkit.org/show_bug.cgi?id=132379
     5
     6        Reviewed by Mario Sanchez Prada.
     7
     8        * accessibility/content-editable-as-textarea.html: Added.
     9        * platform/mac-mountainlion/accessibility/content-editable-as-textarea-expected.txt: Added.
     10        * platform/mac/accessibility/content-editable-as-textarea-expected.txt: Added.
     11
    1122014-04-30  David Kilzer  <ddkilzer@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r168041 r168042  
     12014-04-29  Chris Fleizach  <cfleizach@apple.com>
     2
     3        AX: Make "contenteditable" regions into AXTextAreas
     4        https://bugs.webkit.org/show_bug.cgi?id=132379
     5
     6        Reviewed by Mario Sanchez Prada.
     7
     8        Make contenteditable regions into AXTextAreas. This will allow for a more standardized
     9        interface for interaction with assistive technologies.
     10
     11        Test: accessibility/content-editable-as-textarea.html
     12
     13        * accessibility/AccessibilityNodeObject.cpp:
     14        (WebCore::AccessibilityNodeObject::hasContentEditableAttributeSet):
     15        * accessibility/AccessibilityObject.cpp:
     16        (WebCore::AccessibilityObject::contentEditableAttributeIsEnabled):
     17        * accessibility/AccessibilityObject.h:
     18        * accessibility/AccessibilityRenderObject.cpp:
     19        (WebCore::AccessibilityRenderObject::documentBasedSelectedTextRange):
     20        (WebCore::AccessibilityRenderObject::selectedText):
     21        (WebCore::AccessibilityRenderObject::selectedTextRange):
     22        (WebCore::AccessibilityRenderObject::renderObjectIsObservable):
     23        (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
     24        (WebCore::AccessibilityRenderObject::ariaSelectedTextRange): Deleted.
     25        * accessibility/AccessibilityRenderObject.h:
     26
    1272014-04-30  Brian J. Burg  <burg@cs.washington.edu>
    228
  • trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp

    r167054 r168042  
    20132013bool AccessibilityNodeObject::hasContentEditableAttributeSet() const
    20142014{
    2015     if (!hasAttribute(contenteditableAttr))
    2016         return false;
    2017     const AtomicString& contentEditableValue = getAttribute(contenteditableAttr);
    2018     // Both "true" (case-insensitive) and the empty string count as true.
    2019     return contentEditableValue.isEmpty() || equalIgnoringCase(contentEditableValue, "true");
     2015    return contentEditableAttributeIsEnabled(element());
    20202016}
    20212017
  • trunk/Source/WebCore/accessibility/AccessibilityObject.cpp

    r167755 r168042  
    13151315    return obj->document().axObjectCache()->getOrCreate(obj);
    13161316}
    1317 
     1317   
     1318bool AccessibilityObject::contentEditableAttributeIsEnabled(Element* element)
     1319{
     1320    if (!element)
     1321        return false;
     1322   
     1323    if (!element->hasAttribute(contenteditableAttr))
     1324        return false;
     1325   
     1326    const AtomicString& contentEditableValue = element->fastGetAttribute(contenteditableAttr);
     1327    // Both "true" (case-insensitive) and the empty string count as true.
     1328    return contentEditableValue.isEmpty() || equalIgnoringCase(contentEditableValue, "true");
     1329}
     1330   
    13181331#if HAVE(ACCESSIBILITY)
    13191332int AccessibilityObject::lineForPosition(const VisiblePosition& visiblePos) const
  • trunk/Source/WebCore/accessibility/AccessibilityObject.h

    r167024 r168042  
    844844    static const String defaultLiveRegionStatusForRole(AccessibilityRole);
    845845    static bool liveRegionStatusIsEnabled(const AtomicString&);
     846    static bool contentEditableAttributeIsEnabled(Element*);
    846847   
    847848    bool supportsARIAAttributes() const;
  • trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp

    r167803 r168042  
    14211421}
    14221422
    1423 PlainTextRange AccessibilityRenderObject::ariaSelectedTextRange() const
     1423PlainTextRange AccessibilityRenderObject::documentBasedSelectedTextRange() const
    14241424{
    14251425    Node* node = m_renderer->node();
     
    14501450    }
    14511451   
    1452     if (ariaRoleAttribute() == UnknownRole)
    1453         return String();
    1454    
    1455     return doAXStringForRange(ariaSelectedTextRange());
     1452    return doAXStringForRange(documentBasedSelectedTextRange());
    14561453}
    14571454
     
    14841481    }
    14851482   
    1486     if (ariaRole == UnknownRole)
    1487         return PlainTextRange();
    1488    
    1489     return ariaSelectedTextRange();
     1483    return documentBasedSelectedTextRange();
    14901484}
    14911485
     
    23952389    // AX clients will listen for AXSelectedChildrenChanged on listboxes.
    23962390    Node* node = renderer->node();
     2391    if (!node)
     2392        return false;
     2393   
    23972394    if (nodeHasRole(node, "listbox") || (renderer->isBoxModelObject() && toRenderBoxModelObject(renderer)->isListBox()))
    23982395        return true;
    23992396
    24002397    // Textboxes should send out notifications.
    2401     if (nodeHasRole(node, "textbox"))
     2398    if (nodeHasRole(node, "textbox") || (node->isElementNode() && contentEditableAttributeIsEnabled(toElement(node))))
    24022399        return true;
    24032400   
     
    25112508#endif
    25122509    }
    2513 
     2510   
     2511    if (hasContentEditableAttributeSet())
     2512        return TextAreaRole;
     2513   
    25142514    if (isFileUploadButton())
    25152515        return ButtonRole;
  • trunk/Source/WebCore/accessibility/AccessibilityRenderObject.h

    r166649 r168042  
    234234    bool hasTextAlternative() const;
    235235    String positionalDescriptionForMSAA() const;
    236     PlainTextRange ariaSelectedTextRange() const;
     236    PlainTextRange documentBasedSelectedTextRange() const;
    237237    Element* rootEditableElementForPosition(const Position&) const;
    238238    bool nodeIsTextControl(const Node*) const;
Note: See TracChangeset for help on using the changeset viewer.