Changeset 200677 in webkit


Ignore:
Timestamp:
May 11, 2016, 12:14:31 AM (9 years ago)
Author:
jdiggs@igalia.com
Message:

[GTK] accessibility/aria-readonly.html is failing
https://bugs.webkit.org/show_bug.cgi?id=98357

Reviewed by Chris Fleizach.

Source/WebCore:

Add support for ATK_STATE_READ_ONLY and expose the value of aria-readonly
as an AtkObject attribute. In order to eliminate duplicate checks, remove
isReadOnly() and just use canSetAttributeValue(), moving all the logic into
AccessibilityNodeObject. Add AccessibilityObject::supportsARIAReadOnly() so
that we can explicitly expose the implicit value for aria-readonly on roles
which support this property. Also add support for ATK_STATE_CHECKABLE, both
because this state was missing and because it serves a similar function to
ATK_STATE_EDITABLE for the purpose of verifying exposure of toggle-able
elements that are not read-only.

Test: accessibility/form-control-value-settable.html

  • accessibility/AccessibilityNodeObject.cpp:

(WebCore::AccessibilityNodeObject::canSetValueAttribute):
(WebCore::AccessibilityNodeObject::isRequired): Deleted.
(WebCore::AccessibilityNodeObject::supportsRequiredAttribute): Deleted.

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

(WebCore::AccessibilityObject::supportsARIAReadOnly):
(WebCore::AccessibilityObject::ariaReadOnlyValue):

  • accessibility/AccessibilityObject.h:

(WebCore::AccessibilityObject::isUnvisited): Deleted.

  • accessibility/AccessibilityRenderObject.cpp:

(WebCore::AccessibilityRenderObject::clickPoint):
(WebCore::AccessibilityRenderObject::isOffScreen): Deleted.
(WebCore::AccessibilityRenderObject::anchorElement): Deleted.
(WebCore::AccessibilityRenderObject::internalLinkElement): Deleted.
(WebCore::AccessibilityRenderObject::textChanged): Deleted.
(WebCore::AccessibilityRenderObject::clearChildren): Deleted.
(WebCore::AccessibilityRenderObject::addImageMapChildren): Deleted.

  • accessibility/AccessibilityRenderObject.h:
  • accessibility/atk/WebKitAccessibleInterfaceText.cpp:

(getAttributeSetForAccessibilityObject):

  • accessibility/atk/WebKitAccessibleWrapperAtk.cpp:

(webkitAccessibleGetAttributes):
(setAtkStateSetFromCoreObject):
(getInterfaceMaskFromObject):

  • inspector/InspectorDOMAgent.cpp:

(WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):

Source/WebKit/win:

Call AccessibilityNode::canSetValueAttribute() to determine if STATE_SYSTEM_READONLY
should be added and if editable text should be supported.

  • AccessibleBase.cpp:

(AccessibleBase::state):

  • AccessibleTextImpl.cpp:

(AccessibleText::deleteText):
(AccessibleText::insertText):
(AccessibleText::cutText):
(AccessibleText::pasteText):
(AccessibleText::replaceText):

Tools:

Add checks to isAttributeSettable() for ATK_STATE_READ_ONLY and the 'readonly'
AtkObject attribute along with ATK_STATE_CHECKABLE for toggle-able elements,
ATK_STATE_SELECTABLE for select elements, and ATK_STATE_FOCUSABLE combined
with range verification for inputs which implement AtkValue. The latter two
additions are admittedly a heuristic workaround for platform accessibility
API differences. But they should be sufficient to facilitate cross-platform
testing of isAttributeSettable() for form elements which lack ARIA attributes.

Bump the minimum version of at-spi2-core and at-spi2-atk
to 2.15.4 (earliest version that supports STATE_READ_ONLY).

  • WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:

(WTR::AccessibilityUIElement::isAttributeSettable):

  • gtk/jhbuild.modules:

LayoutTests:

As part of this change, a new AtkObject attribute and state are being exposed.
Update two tests accordingly. Also unskip the previously-failing test. Lastly,
move the Mac form-control-value-settable.html test to the shared test set,
with a minor tweak to check the platform for several elements' expectations.

  • accessibility/form-control-value-settable.html: Moved to shared tests.
  • accessibility/gtk/xml-roles-exposed-expected.txt: Updated.
  • platform/gtk/TestExpectations: Unskipped previously-failing test.
  • platform/gtk/accessibility/form-control-value-settable-expected.txt: Added.
  • platform/gtk/accessibility/table-detection-expected.txt: Updated.
  • platform/mac/accessibility/form-control-value-settable-expected.txt: Moved.
Location:
trunk
Files:
20 edited
1 copied
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r200674 r200677  
     12016-05-11  Joanmarie Diggs  <jdiggs@igalia.com>
     2
     3        [GTK] accessibility/aria-readonly.html is failing
     4        https://bugs.webkit.org/show_bug.cgi?id=98357
     5
     6        Reviewed by Chris Fleizach.
     7
     8        As part of this change, a new AtkObject attribute and state are being exposed.
     9        Update two tests accordingly. Also unskip the previously-failing test. Lastly,
     10        move the Mac form-control-value-settable.html test to the shared test set,
     11        with a minor tweak to check the platform for several elements' expectations.
     12
     13        * accessibility/form-control-value-settable.html: Moved to shared tests.
     14        * accessibility/gtk/xml-roles-exposed-expected.txt: Updated.
     15        * platform/gtk/TestExpectations: Unskipped previously-failing test.
     16        * platform/gtk/accessibility/form-control-value-settable-expected.txt: Added.
     17        * platform/gtk/accessibility/table-detection-expected.txt: Updated.
     18        * platform/mac/accessibility/form-control-value-settable-expected.txt: Moved.
     19
    1202016-05-10  Myles C. Maxfield  <mmaxfield@apple.com>
    221
  • trunk/LayoutTests/accessibility/form-control-value-settable.html

    r200675 r200677  
    22<html>
    33<body>
    4 <script src="../../resources/js-test-pre.js"></script>
     4<script src="../resources/js-test-pre.js"></script>
    55
    66<div>
     
    6262    check("slider1", "slider2", true);
    6363
    64     // Other form controls, even toggleable ones, should have a read-only AXValue -
    65     // unless they're inside contentEditable, then everything should have writable AXValue.
    66     check("checkbox1", "checkbox2", false);
    67     check("radio1", "radio2", false);
     64    // Other controls whose contents or state can be user modified should have a read-only
     65    // AXValue for non-ATK-based platforms, unless those controls are inside contentEditable,
     66    // then everything should have a writable AXValue.
     67    isATK = accessibilityController.platformName == "atk";
     68    check("checkbox1", "checkbox2", isATK ? true : false);
     69    check("radio1", "radio2", isATK ? true : false);
    6870    check("submit1", "submit2", false);
    69     check("combobox1", "combobox2", false);
    70     check("listbox1", "listbox2", false);
     71    check("combobox1", "combobox2", isATK ? true : false);
     72    check("listbox1", "listbox2", isATK ? true : false);
    7173}
    7274
    7375</script>
    7476
    75 <script src="../../resources/js-test-post.js"></script>
     77<script src="../resources/js-test-post.js"></script>
    7678</body>
    7779</html>
  • trunk/LayoutTests/accessibility/gtk/xml-roles-exposed-expected.txt

    r200415 r200677  
    136136AXRequired: 0
    137137AXChecked: 0
    138 AXPlatformAttributes: computed-role:checkbox, xml-roles:checkbox, tag:div, toolkit:WebKitGtk
     138AXPlatformAttributes: computed-role:checkbox, xml-roles:checkbox, readonly:false, tag:div, toolkit:WebKitGtk
    139139------------
    140140AXRole: AXComboBox
     
    155155AXRequired: 0
    156156AXChecked: 0
    157 AXPlatformAttributes: computed-role:combobox, xml-roles:combobox, tag:div, toolkit:WebKitGtk
     157AXPlatformAttributes: computed-role:combobox, xml-roles:combobox, readonly:false, tag:div, toolkit:WebKitGtk
    158158------------
    159159AXRole: AXLandmarkComplementary
     
    593593AXRequired: 0
    594594AXChecked: 0
    595 AXPlatformAttributes: computed-role:searchbox, xml-roles:searchbox, tag:div, toolkit:WebKitGtk
     595AXPlatformAttributes: computed-role:searchbox, xml-roles:searchbox, readonly:false, tag:div, toolkit:WebKitGtk
    596596------------
    597597AXRole: AXSeparator
     
    631631AXRequired: 0
    632632AXChecked: 0
    633 AXPlatformAttributes: computed-role:slider, xml-roles:slider, tag:div, toolkit:WebKitGtk
     633AXPlatformAttributes: computed-role:slider, xml-roles:slider, readonly:false, tag:div, toolkit:WebKitGtk
    634634------------
    635635AXRole: AXSpinButton
     
    650650AXRequired: 0
    651651AXChecked: 0
    652 AXPlatformAttributes: computed-role:spinbutton, xml-roles:spinbutton, tag:div, toolkit:WebKitGtk
     652AXPlatformAttributes: computed-role:spinbutton, xml-roles:spinbutton, readonly:false, tag:div, toolkit:WebKitGtk
    653653------------
    654654AXRole: AXStatusBar
     
    688688AXRequired: 0
    689689AXChecked: 0
    690 AXPlatformAttributes: computed-role:switch, xml-roles:switch, tag:div, toolkit:WebKitGtk
     690AXPlatformAttributes: computed-role:switch, xml-roles:switch, readonly:false, tag:div, toolkit:WebKitGtk
    691691------------
    692692AXRole: AXTextField
     
    707707AXRequired: 0
    708708AXChecked: 0
    709 AXPlatformAttributes: tag:div, toolkit:WebKitGtk
     709AXPlatformAttributes: readonly:false, tag:div, toolkit:WebKitGtk
    710710------------
    711711AXRole: AXTimer
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r200542 r200677  
    18511851# Need platform specific update to test to make it run.
    18521852
    1853 webkit.org/b/98357 accessibility/aria-readonly.html [ Failure ]
    18541853webkit.org/b/98363 accessibility/canvas-fallback-content-2.html [ Failure ]
    18551854webkit.org/b/98372 accessibility/onclick-handlers.html [ Failure ]
  • trunk/LayoutTests/platform/gtk/accessibility/form-control-value-settable-expected.txt

    r200675 r200677  
    1                 
    2                 
     1               
     2               
    33This tests whether AXValue is writable for various form controls.
    44
     
    3838checkbox2
    3939PASS document.activeElement == element2 is true
    40 PASS axElement1.isAttributeSettable('AXValue') is false
     40PASS axElement1.isAttributeSettable('AXValue') is true
    4141PASS axElement2.isAttributeSettable('AXValue') is true
    4242
     
    4545radio2
    4646PASS document.activeElement == element2 is true
    47 PASS axElement1.isAttributeSettable('AXValue') is false
     47PASS axElement1.isAttributeSettable('AXValue') is true
    4848PASS axElement2.isAttributeSettable('AXValue') is true
    4949
     
    5959combobox2
    6060PASS document.activeElement == element2 is true
    61 PASS axElement1.isAttributeSettable('AXValue') is false
     61PASS axElement1.isAttributeSettable('AXValue') is true
    6262PASS axElement2.isAttributeSettable('AXValue') is true
    6363
     
    6666listbox2
    6767PASS document.activeElement == element2 is true
    68 PASS axElement1.isAttributeSettable('AXValue') is false
     68PASS axElement1.isAttributeSettable('AXValue') is true
    6969PASS axElement2.isAttributeSettable('AXValue') is true
    7070
  • trunk/LayoutTests/platform/gtk/accessibility/table-detection-expected.txt

    r197448 r200677  
    286286AXTitle:
    287287AXDescription:
     288AXValue: asdf   asdf<\n>
    288289AXFocusable: 1
    289290AXFocused: 0
  • trunk/Source/WebCore/ChangeLog

    r200675 r200677  
     12016-05-11  Joanmarie Diggs  <jdiggs@igalia.com>
     2
     3        [GTK] accessibility/aria-readonly.html is failing
     4        https://bugs.webkit.org/show_bug.cgi?id=98357
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Add support for ATK_STATE_READ_ONLY and expose the value of aria-readonly
     9        as an AtkObject attribute. In order to eliminate duplicate checks, remove
     10        isReadOnly() and just use canSetAttributeValue(), moving all the logic into
     11        AccessibilityNodeObject. Add AccessibilityObject::supportsARIAReadOnly() so
     12        that we can explicitly expose the implicit value for aria-readonly on roles
     13        which support this property. Also add support for ATK_STATE_CHECKABLE, both
     14        because this state was missing and because it serves a similar function to
     15        ATK_STATE_EDITABLE for the purpose of verifying exposure of toggle-able
     16        elements that are not read-only.
     17
     18        Test: accessibility/form-control-value-settable.html
     19
     20        * accessibility/AccessibilityNodeObject.cpp:
     21        (WebCore::AccessibilityNodeObject::canSetValueAttribute):
     22        (WebCore::AccessibilityNodeObject::isRequired): Deleted.
     23        (WebCore::AccessibilityNodeObject::supportsRequiredAttribute): Deleted.
     24        * accessibility/AccessibilityNodeObject.h:
     25        * accessibility/AccessibilityObject.cpp:
     26        (WebCore::AccessibilityObject::supportsARIAReadOnly):
     27        (WebCore::AccessibilityObject::ariaReadOnlyValue):
     28        * accessibility/AccessibilityObject.h:
     29        (WebCore::AccessibilityObject::isUnvisited): Deleted.
     30        * accessibility/AccessibilityRenderObject.cpp:
     31        (WebCore::AccessibilityRenderObject::clickPoint):
     32        (WebCore::AccessibilityRenderObject::isOffScreen): Deleted.
     33        (WebCore::AccessibilityRenderObject::anchorElement): Deleted.
     34        (WebCore::AccessibilityRenderObject::internalLinkElement): Deleted.
     35        (WebCore::AccessibilityRenderObject::textChanged): Deleted.
     36        (WebCore::AccessibilityRenderObject::clearChildren): Deleted.
     37        (WebCore::AccessibilityRenderObject::addImageMapChildren): Deleted.
     38        * accessibility/AccessibilityRenderObject.h:
     39        * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
     40        (getAttributeSetForAccessibilityObject):
     41        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
     42        (webkitAccessibleGetAttributes):
     43        (setAtkStateSetFromCoreObject):
     44        (getInterfaceMaskFromObject):
     45        * inspector/InspectorDOMAgent.cpp:
     46        (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
     47
    1482016-05-10  Jeremy Jones  <jeremyj@apple.com>
    249
  • trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp

    r200369 r200677  
    740740}
    741741
    742 bool AccessibilityNodeObject::isReadOnly() const
    743 {
    744     Node* node = this->node();
    745     if (!node)
    746         return true;
    747 
    748     if (is<HTMLTextAreaElement>(*node))
    749         return downcast<HTMLTextAreaElement>(*node).isReadOnly();
    750 
    751     if (is<HTMLInputElement>(*node)) {
    752         HTMLInputElement& input = downcast<HTMLInputElement>(*node);
    753         if (input.isTextField())
    754             return input.isReadOnly();
    755     }
    756 
    757     return !node->hasEditableStyle();
    758 }
    759 
    760742bool AccessibilityNodeObject::isRequired() const
    761743{
     
    19761958}
    19771959
     1960bool AccessibilityNodeObject::canSetValueAttribute() const
     1961{
     1962    Node* node = this->node();
     1963    if (!node)
     1964        return false;
     1965
     1966    // The host-language readonly attribute trumps aria-readonly.
     1967    if (is<HTMLTextAreaElement>(*node))
     1968        return !downcast<HTMLTextAreaElement>(*node).isReadOnly();
     1969    if (is<HTMLInputElement>(*node)) {
     1970        HTMLInputElement& input = downcast<HTMLInputElement>(*node);
     1971        if (input.isTextField())
     1972            return !input.isReadOnly();
     1973    }
     1974
     1975    String readOnly = ariaReadOnlyValue();
     1976    if (!readOnly.isEmpty())
     1977        return readOnly == "true" ? false : true;
     1978
     1979    if (isNonNativeTextControl())
     1980        return true;
     1981
     1982    if (isMeter())
     1983        return false;
     1984
     1985    if (isProgressIndicator() || isSlider())
     1986        return true;
     1987
     1988#if PLATFORM(GTK) || PLATFORM(EFL)
     1989    // In ATK, input types which support aria-readonly are treated as having a
     1990    // settable value if the user can modify the widget's value or its state.
     1991    if (supportsARIAReadOnly() || isRadioButton())
     1992        return true;
     1993#endif
     1994
     1995    if (isWebArea()) {
     1996        Document* document = this->document();
     1997        if (!document)
     1998            return false;
     1999
     2000        if (HTMLElement* body = document->bodyOrFrameset()) {
     2001            if (body->hasEditableStyle())
     2002                return true;
     2003        }
     2004
     2005        return document->hasEditableStyle();
     2006    }
     2007
     2008    return node->hasEditableStyle();
     2009}
     2010
    19782011AccessibilityRole AccessibilityNodeObject::determineAriaRoleAttribute() const
    19792012{
  • trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h

    r199588 r200677  
    9898    bool isIndeterminate() const override;
    9999    bool isPressed() const override;
    100     bool isReadOnly() const override;
    101100    bool isRequired() const override;
    102101    bool supportsRequiredAttribute() const override;
     
    110109    bool canSetFocusAttribute() const override;
    111110    int headingLevel() const override;
     111
     112    bool canSetValueAttribute() const override;
    112113
    113114    String valueDescription() const override;
  • trunk/Source/WebCore/accessibility/AccessibilityObject.cpp

    r200415 r200677  
    15601560{
    15611561    return contentEditableAttributeIsEnabled(element());
     1562}
     1563
     1564bool AccessibilityObject::supportsARIAReadOnly() const
     1565{
     1566    AccessibilityRole role = roleValue();
     1567
     1568    return role == CheckBoxRole
     1569        || role == ColumnHeaderRole
     1570        || role == ComboBoxRole
     1571        || role == GridRole
     1572        || role == GridCellRole
     1573        || role == ListBoxRole
     1574        || role == MenuItemCheckboxRole
     1575        || role == MenuItemRadioRole
     1576        || role == RadioGroupRole
     1577        || role == RowHeaderRole
     1578        || role == SearchFieldRole
     1579        || role == SliderRole
     1580        || role == SpinButtonRole
     1581        || role == SwitchRole
     1582        || role == TextFieldRole
     1583        || role == TreeGridRole
     1584        || isPasswordField();
     1585}
     1586
     1587String AccessibilityObject::ariaReadOnlyValue() const
     1588{
     1589    if (!hasAttribute(aria_readonlyAttr))
     1590        return ariaRoleAttribute() != UnknownRole && supportsARIAReadOnly() ? "false" : String();
     1591
     1592    return String(getAttribute(aria_readonlyAttr)).convertToASCIILowercase();
    15621593}
    15631594
  • trunk/Source/WebCore/accessibility/AccessibilityObject.h

    r200415 r200677  
    570570    virtual bool isOffScreen() const { return false; }
    571571    virtual bool isPressed() const { return false; }
    572     virtual bool isReadOnly() const { return false; }
    573572    virtual bool isUnvisited() const { return false; }
    574573    virtual bool isVisited() const { return false; }
     
    924923    static bool contentEditableAttributeIsEnabled(Element*);
    925924    bool hasContentEditableAttributeSet() const;
     925
     926    bool supportsARIAReadOnly() const;
     927    String ariaReadOnlyValue() const;
    926928   
    927929    bool supportsARIAAttributes() const;
  • trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp

    r200415 r200677  
    523523    return false;
    524524}
    525    
    526 bool AccessibilityRenderObject::isReadOnly() const
    527 {
    528     ASSERT(m_renderer);
    529    
    530     if (isWebArea()) {
    531         if (HTMLElement* body = m_renderer->document().bodyOrFrameset()) {
    532             if (body->hasEditableStyle())
    533                 return false;
    534         }
    535 
    536         return !m_renderer->document().hasEditableStyle();
    537     }
    538 
    539     return AccessibilityNodeObject::isReadOnly();
    540 }
    541525
    542526bool AccessibilityRenderObject::isOffScreen() const
     
    923907
    924908    // use the default position unless this is an editable web area, in which case we use the selection bounds.
    925     if (!isWebArea() || isReadOnly())
     909    if (!isWebArea() || !canSetValueAttribute())
    926910        return AccessibilityObject::clickPoint();
    927911   
     
    28772861}
    28782862
    2879 bool AccessibilityRenderObject::canSetValueAttribute() const
    2880 {
    2881     // In the event of a (Boolean)@readonly and (True/False/Undefined)@aria-readonly
    2882     // value mismatch, the host language native attribute value wins.   
    2883     if (isNativeTextControl())
    2884         return !isReadOnly();
    2885 
    2886     if (isMeter())
    2887         return false;
    2888 
    2889     auto& readOnly = getAttribute(aria_readonlyAttr);
    2890     if (equalLettersIgnoringASCIICase(readOnly, "true"))
    2891         return false;
    2892     if (equalLettersIgnoringASCIICase(readOnly, "false"))
    2893         return true;
    2894 
    2895     if (isProgressIndicator() || isSlider())
    2896         return true;
    2897 
    2898     if (isTextControl() && !isNativeTextControl())
    2899         return true;
    2900 
    2901     // Any node could be contenteditable, so isReadOnly should be relied upon
    2902     // for this information for all elements.
    2903     return !isReadOnly();
    2904 }
    2905 
    29062863bool AccessibilityRenderObject::canSetTextRangeAttributes() const
    29072864{
  • trunk/Source/WebCore/accessibility/AccessibilityRenderObject.h

    r199229 r200677  
    7171    bool isLoaded() const override;
    7272    bool isOffScreen() const override;
    73     bool isReadOnly() const override;
    7473    bool isUnvisited() const override;
    7574    bool isVisited() const override;
     
    8483
    8584    bool canSetTextRangeAttributes() const override;
    86     bool canSetValueAttribute() const override;
    8785    bool canSetExpandedAttribute() const override;
    8886
  • trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp

    r200098 r200677  
    199199    result = addToAtkAttributeSet(result, atk_text_attribute_get_name(ATK_TEXT_ATTR_INVISIBLE), (style->visibility() == HIDDEN) ? "true" : "false");
    200200
    201     result = addToAtkAttributeSet(result, atk_text_attribute_get_name(ATK_TEXT_ATTR_EDITABLE), object->isReadOnly() ? "false" : "true");
     201    result = addToAtkAttributeSet(result, atk_text_attribute_get_name(ATK_TEXT_ATTR_EDITABLE), object->canSetValueAttribute() ? "true" : "false");
    202202
    203203    String language = object->language();
  • trunk/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp

    r200415 r200677  
    474474    if (coreObject->supportsARIASetSize())
    475475        attributeSet = addToAtkAttributeSet(attributeSet, "setsize", String::number(coreObject->ariaSetSize()).utf8().data());
     476
     477    String isReadOnly = coreObject->ariaReadOnlyValue();
     478    if (!isReadOnly.isEmpty())
     479        attributeSet = addToAtkAttributeSet(attributeSet, "readonly", isReadOnly.utf8().data());
    476480
    477481    // According to the W3C Core Accessibility API Mappings 1.1, section 5.4.1 General Rules:
     
    802806        atk_state_set_add_state(stateSet, ATK_STATE_ACTIVE);
    803807
     808#if ATK_CHECK_VERSION(2,11,2)
     809    if (coreObject->supportsChecked() && coreObject->canSetValueAttribute())
     810        atk_state_set_add_state(stateSet, ATK_STATE_CHECKABLE);
     811#endif
     812
    804813    if (coreObject->isChecked())
    805814        atk_state_set_add_state(stateSet, ATK_STATE_CHECKED);
    806815
    807     // FIXME: isReadOnly does not seem to do the right thing for
    808     // controls, so check explicitly for them. In addition, because
    809     // isReadOnly is false for listBoxOptions, we need to add one
    810     // more check so that we do not present them as being "editable".
    811     if ((!coreObject->isReadOnly()
    812         || (coreObject->isControl() && coreObject->canSetValueAttribute()))
    813         && !isListBoxOption)
     816    if ((coreObject->isTextControl() || coreObject->isNonNativeTextControl()) && coreObject->canSetValueAttribute())
    814817        atk_state_set_add_state(stateSet, ATK_STATE_EDITABLE);
    815818
     
    855858    if (coreObject->isPressed())
    856859        atk_state_set_add_state(stateSet, ATK_STATE_PRESSED);
     860
     861#if ATK_CHECK_VERSION(2,15,3)
     862    if (!coreObject->canSetValueAttribute() && (coreObject->supportsARIAReadOnly()))
     863        atk_state_set_add_state(stateSet, ATK_STATE_READ_ONLY);
     864#endif
    857865
    858866    if (coreObject->isRequired())
     
    11451153    if (role == StaticTextRole || coreObject->isMenuListOption())
    11461154        interfaceMask |= 1 << WAIText;
    1147     else if (coreObject->isTextControl()) {
     1155    else if (coreObject->isTextControl() || coreObject->isNonNativeTextControl()) {
    11481156        interfaceMask |= 1 << WAIText;
    1149         if (!coreObject->isReadOnly())
     1157        if (coreObject->canSetValueAttribute())
    11501158            interfaceMask |= 1 << WAIEditableText;
    11511159    } else if (!coreObject->isWebArea()) {
  • trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp

    r200539 r200677  
    17271727           
    17281728            if (axObject->isTextControl())
    1729                 readonly = axObject->isReadOnly();
     1729                readonly = !axObject->canSetValueAttribute();
    17301730
    17311731            supportsRequired = axObject->supportsRequiredAttribute();
  • trunk/Source/WebKit/win/AccessibleBase.cpp

    r200415 r200677  
    489489        state |= STATE_SYSTEM_UNAVAILABLE;
    490490
    491     if (m_object->isReadOnly())
     491    if (!m_object->canSetValueAttribute())
    492492        state |= STATE_SYSTEM_READONLY;
    493493
  • trunk/Source/WebKit/win/AccessibleTextImpl.cpp

    r188703 r200677  
    564564HRESULT AccessibleText::deleteText(long startOffset, long endOffset)
    565565{
    566     if (m_object->isReadOnly())
     566    if (!m_object->canSetValueAttribute())
    567567        return S_FALSE;
    568568
     
    582582HRESULT AccessibleText::insertText(long offset, BSTR* text)
    583583{
    584     if (m_object->isReadOnly())
     584    if (!m_object->canSetValueAttribute())
    585585        return S_FALSE;
    586586
     
    602602HRESULT AccessibleText::cutText(long startOffset, long endOffset)
    603603{
    604     if (m_object->isReadOnly())
     604    if (!m_object->canSetValueAttribute())
    605605        return S_FALSE;
    606606
     
    623623HRESULT AccessibleText::pasteText(long offset)
    624624{
    625     if (m_object->isReadOnly())
     625    if (!m_object->canSetValueAttribute())
    626626        return S_FALSE;
    627627
     
    643643HRESULT AccessibleText::replaceText(long startOffset, long endOffset, BSTR* text)
    644644{
    645     if (m_object->isReadOnly())
     645    if (!m_object->canSetValueAttribute())
    646646        return S_FALSE;
    647647
  • trunk/Source/WebKit/win/ChangeLog

    r200577 r200677  
     12016-05-11  Joanmarie Diggs  <jdiggs@igalia.com>
     2
     3        [GTK] accessibility/aria-readonly.html is failing
     4        https://bugs.webkit.org/show_bug.cgi?id=98357
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Call AccessibilityNode::canSetValueAttribute() to determine if STATE_SYSTEM_READONLY
     9        should be added and if editable text should be supported.
     10
     11        * AccessibleBase.cpp:
     12        (AccessibleBase::state):
     13        * AccessibleTextImpl.cpp:
     14        (AccessibleText::deleteText):
     15        (AccessibleText::insertText):
     16        (AccessibleText::cutText):
     17        (AccessibleText::pasteText):
     18        (AccessibleText::replaceText):
     19
    1202016-05-09  Fujii Hironori  <Hironori.Fujii@sony.com>
    221
  • trunk/Tools/ChangeLog

    r200670 r200677  
     12016-05-11  Joanmarie Diggs  <jdiggs@igalia.com>
     2
     3        [GTK] accessibility/aria-readonly.html is failing
     4        https://bugs.webkit.org/show_bug.cgi?id=98357
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Add checks to isAttributeSettable() for ATK_STATE_READ_ONLY and the 'readonly'
     9        AtkObject attribute along with ATK_STATE_CHECKABLE for toggle-able elements,
     10        ATK_STATE_SELECTABLE for select elements, and ATK_STATE_FOCUSABLE combined
     11        with range verification for inputs which implement AtkValue. The latter two
     12        additions are admittedly a heuristic workaround for platform accessibility
     13        API differences. But they should be sufficient to facilitate cross-platform
     14        testing of isAttributeSettable() for form elements which lack ARIA attributes.
     15
     16        Bump the minimum version of at-spi2-core and at-spi2-atk
     17        to 2.15.4 (earliest version that supports STATE_READ_ONLY).
     18
     19        * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
     20        (WTR::AccessibilityUIElement::isAttributeSettable):
     21        * gtk/jhbuild.modules:
     22
    1232016-05-10  Ryan Haddad  <ryanhaddad@apple.com>
    224
  • trunk/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp

    r200415 r200677  
    10451045
    10461046    String attributeString = jsStringToWTFString(attribute);
    1047     if (attributeString == "AXValue")
    1048         return checkElementState(m_element.get(), ATK_STATE_EDITABLE);
     1047    if (attributeString != "AXValue")
     1048        return false;
     1049
     1050    // ATK does not have a single state or property to indicate whether or not the value
     1051    // of an accessible object can be set. ATs look at several states and properties based
     1052    // on the type of object. If nothing explicitly indicates the value can or cannot be
     1053    // set, ATs make role- and interface-based decisions. We'll do something similar here.
     1054
     1055    // This state is expected to be present only for text widgets and contenteditable elements.
     1056    if (checkElementState(m_element.get(), ATK_STATE_EDITABLE))
     1057        return true;
     1058
     1059#if ATK_CHECK_VERSION(2,11,2)
     1060    // This state is applicable to checkboxes, radiobuttons, switches, etc.
     1061    if (checkElementState(m_element.get(), ATK_STATE_CHECKABLE))
     1062        return true;
     1063#endif
     1064
     1065#if ATK_CHECK_VERSION(2,15,3)
     1066    // This state is expected to be present only for controls and only if explicitly set.
     1067    if (checkElementState(m_element.get(), ATK_STATE_READ_ONLY))
     1068        return false;
     1069#endif
     1070
     1071    // We expose an object attribute to ATs when there is an author-provided ARIA property
     1072    // and also when there is a supported ARIA role but no author-provided value.
     1073    String isReadOnly = getAttributeSetValueForId(ATK_OBJECT(m_element.get()), ObjectAttributeType, "readonly");
     1074    if (!isReadOnly.isEmpty())
     1075        return isReadOnly == "true" ? false : true;
     1076
     1077    // If we have a native listbox or combobox and the value can be set, the options should
     1078    // have ATK_STATE_SELECTABLE.
     1079    AtkRole role = atk_object_get_role(ATK_OBJECT(m_element.get()));
     1080    if (role == ATK_ROLE_LIST_BOX || role == ATK_ROLE_COMBO_BOX) {
     1081        if (GRefPtr<AtkObject> child = adoptGRef(atk_object_ref_accessible_child(ATK_OBJECT(m_element.get()), 0))) {
     1082            if (atk_object_get_role(ATK_OBJECT(child.get())) == ATK_ROLE_MENU)
     1083                child = adoptGRef(atk_object_ref_accessible_child(ATK_OBJECT(child.get()), 0));
     1084            return child && checkElementState(child.get(), ATK_STATE_SELECTABLE);
     1085        }
     1086    }
     1087
     1088    // If we have a native element which exposes a range whose value can be set, it should
     1089    // be focusable and have a true range.
     1090    if (ATK_IS_VALUE(m_element.get()) && checkElementState(m_element.get(), ATK_STATE_FOCUSABLE))
     1091        return minValue() != maxValue();
    10491092
    10501093    return false;
  • trunk/Tools/gtk/jhbuild.modules

    r200621 r200677  
    286286  <autotools id="at-spi2-core"
    287287             autogenargs="--disable-introspection">
    288     <branch module="pub/GNOME/sources/at-spi2-core/2.10/at-spi2-core-2.10.0.tar.xz" version="2.10.0"
    289             repo="ftp.gnome.org"
    290             hash="sha256:964155c7574220a00e11e1c0d91f2d3017ed603920eb1333ff9cbdb6a22744db">
     288    <branch module="pub/GNOME/sources/at-spi2-core/2.15/at-spi2-core-2.15.4.tar.xz" version="2.15.4"
     289            repo="ftp.gnome.org"
     290            hash="sha256:0e3b01af6ba06d98faf7b85891ece394897fe145b0760b7846e810b57f1b809f">
    291291    </branch>
    292292    <dependencies>
     
    296296
    297297  <autotools id="at-spi2-atk">
    298     <branch module="pub/GNOME/sources/at-spi2-atk/2.10/at-spi2-atk-2.10.0.tar.xz" version="2.10.0"
    299             repo="ftp.gnome.org"
    300             hash="sha256:dea7ff2f9bc9bbdb0351112616d738de718b55739cd2511afecac51604c31a94">
     298    <branch module="pub/GNOME/sources/at-spi2-atk/2.15/at-spi2-atk-2.15.4.tar.xz" version="2.15.4"
     299            repo="ftp.gnome.org"
     300            hash="sha256:3283aa5207b81e4c77d24c4e8b1c0abe6c850b11a2e62cd873cc07af0b403501">
    301301    </branch>
    302302    <dependencies>
Note: See TracChangeset for help on using the changeset viewer.