Changeset 152716 in webkit


Ignore:
Timestamp:
Jul 16, 2013 5:55:56 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[ATK] Adds support for aria-haspopup property.
https://bugs.webkit.org/show_bug.cgi?id=117834

Source/WebCore:

Patch by Krzysztof Czech <k.czech@ymail.com> on 2013-07-16
Reviewed by Christophe Dumez.

Adds support for aria-haspopup property.

Tests: accessibility/element-haspopup.html

accessibility/popup-button-title.html

  • accessibility/atk/WebKitAccessibleWrapperAtk.cpp:

(webkitAccessibleGetAttributes):

Tools:

Patch by Krzysztof Czech <k.czech@samsung.com> on 2013-07-16
Reviewed by Christophe Dumez.

Adds implementation for testing aria-haspopup property.

  • DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:

(getAttributeSetValueForId):
(AccessibilityUIElement::stringAttributeValue):
(AccessibilityUIElement::hasPopup):

  • WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:

(WTR::getAttributeSetValueForId):
(WTR::AccessibilityUIElement::stringAttributeValue):
(WTR::AccessibilityUIElement::hasPopup):

LayoutTests:

Patch by Krzysztof Czech <k.czech@ymail.com> on 2013-07-16
Reviewed by Christophe Dumez.

Moving accessibility tests related to aria-haspopup property.

  • accessibility/element-haspopup-expected.txt: Renamed from LayoutTests/platform/mac/accessibility/element-haspopup-expected.txt.
  • accessibility/element-haspopup.html: Renamed from LayoutTests/platform/mac/accessibility/element-haspopup.html.
  • accessibility/popup-button-title-expected.txt: Renamed from LayoutTests/platform/mac/accessibility/popup-button-title-expected.txt.
  • accessibility/popup-button-title.html: Renamed from LayoutTests/platform/mac/accessibility/popup-button-title.html.
Location:
trunk
Files:
6 edited
4 moved

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r152714 r152716  
     12013-07-16  Krzysztof Czech  <k.czech@ymail.com>
     2
     3        [ATK] Adds support for aria-haspopup property.
     4        https://bugs.webkit.org/show_bug.cgi?id=117834
     5
     6        Reviewed by Christophe Dumez.
     7
     8        Moving accessibility tests related to aria-haspopup property.
     9
     10        * accessibility/element-haspopup-expected.txt: Renamed from LayoutTests/platform/mac/accessibility/element-haspopup-expected.txt.
     11        * accessibility/element-haspopup.html: Renamed from LayoutTests/platform/mac/accessibility/element-haspopup.html.
     12        * accessibility/popup-button-title-expected.txt: Renamed from LayoutTests/platform/mac/accessibility/popup-button-title-expected.txt.
     13        * accessibility/popup-button-title.html: Renamed from LayoutTests/platform/mac/accessibility/popup-button-title.html.
     14
    1152013-07-16  Gabor Abraham  <abrhm@inf.u-szeged.hu>
    216
  • trunk/LayoutTests/accessibility/element-haspopup.html

    r152715 r152716  
    22<html>
    33<head>
    4 <script src="../../../fast/js/resources/js-test-pre.js"></script>
     4<script src="../fast/js/resources/js-test-pre.js"></script>
    55</head>
    66<body id="body">
     
    2727</script>
    2828
    29 <script src="../../../fast/js/resources/js-test-post.js"></script>
     29<script src="../fast/js/resources/js-test-post.js"></script>
    3030</body>
    3131</html>
  • trunk/LayoutTests/accessibility/popup-button-title.html

    r152715 r152716  
    22<html>
    33<head>
    4 <script src="../../../fast/js/resources/js-test-pre.js"></script>
     4<script src="../fast/js/resources/js-test-pre.js"></script>
    55</head>
    66<body id="body">
     
    2525</script>
    2626
    27 <script src="../../../fast/js/resources/js-test-post.js"></script>
     27<script src="../fast/js/resources/js-test-post.js"></script>
    2828</body>
    2929</html>
  • trunk/Source/WebCore/ChangeLog

    r152711 r152716  
     12013-07-16  Krzysztof Czech  <k.czech@ymail.com>
     2
     3        [ATK] Adds support for aria-haspopup property.
     4        https://bugs.webkit.org/show_bug.cgi?id=117834
     5
     6        Reviewed by Christophe Dumez.
     7
     8        Adds support for aria-haspopup property.
     9
     10        Tests: accessibility/element-haspopup.html
     11               accessibility/popup-button-title.html
     12
     13        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
     14        (webkitAccessibleGetAttributes):
     15
    1162013-07-16  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
    217
  • trunk/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp

    r152440 r152716  
    495495    if (!placeholder.isEmpty())
    496496        attributeSet = addToAtkAttributeSet(attributeSet, "placeholder-text", placeholder.utf8().data());
     497
     498    if (coreObject->ariaHasPopup())
     499        attributeSet = addToAtkAttributeSet(attributeSet, "aria-haspopup", "true");
    497500
    498501    return attributeSet;
  • trunk/Tools/ChangeLog

    r152715 r152716  
     12013-07-16  Krzysztof Czech  <k.czech@samsung.com>
     2
     3        [ATK] Adds support for aria-haspopup property.
     4        https://bugs.webkit.org/show_bug.cgi?id=117834
     5
     6        Reviewed by Christophe Dumez.
     7
     8        Adds implementation for testing aria-haspopup property.
     9
     10        * DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:
     11        (getAttributeSetValueForId):
     12        (AccessibilityUIElement::stringAttributeValue):
     13        (AccessibilityUIElement::hasPopup):
     14        * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
     15        (WTR::getAttributeSetValueForId):
     16        (WTR::AccessibilityUIElement::stringAttributeValue):
     17        (WTR::AccessibilityUIElement::hasPopup):
     18
    1192013-07-16  Michael Brüning  <michael.bruning@digia.com>
    220
  • trunk/Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp

    r152397 r152716  
    5050
    5151    return "";
     52}
     53
     54static String getAttributeSetValueForId(AtkObject* accessible, const char* id)
     55{
     56    const char* attributeValue = 0;
     57    AtkAttributeSet* attributeSet = atk_object_get_attributes(accessible);
     58    for (AtkAttributeSet* attributes = attributeSet; attributes; attributes = attributes->next) {
     59        AtkAttribute* atkAttribute = static_cast<AtkAttribute*>(attributes->data);
     60        if (!strcmp(atkAttribute->name, id)) {
     61            attributeValue = atkAttribute->value;
     62            break;
     63        }
     64    }
     65
     66    String atkAttributeValue = String::fromUTF8(attributeValue);
     67    atk_attribute_set_free(attributeSet);
     68
     69    return atkAttributeValue;
    5270}
    5371
     
    805823        return JSStringCreateWithCharacters(0, 0);
    806824
    807     const char* attributeValue = 0;
    808     AtkAttributeSet* attributeSet = atk_object_get_attributes(ATK_OBJECT(m_element));
    809     for (AtkAttributeSet* attributes = attributeSet; attributes; attributes = attributes->next) {
    810         AtkAttribute* atkAttribute = static_cast<AtkAttribute*>(attributes->data);
    811         if (!strcmp(atkAttribute->name, atkAttributeName.utf8().data())) {
    812             attributeValue = atkAttribute->value;
    813             break;
    814         }
    815     }
    816     JSStringRef jsString = attributeValue
    817         ? JSStringCreateWithUTF8CString(attributeValue)
    818         : JSStringCreateWithCharacters(0, 0);
    819     atk_attribute_set_free(attributeSet);
    820 
    821     return jsString;
     825    String attributeValue = getAttributeSetValueForId(ATK_OBJECT(m_element), atkAttributeName.utf8().data());
     826    return JSStringCreateWithUTF8CString(attributeValue.utf8().data());
    822827}
    823828
     
    10221027bool AccessibilityUIElement::hasPopup() const
    10231028{
    1024     // FIXME: implement
    1025     return false;
     1029    if (!m_element || !ATK_IS_OBJECT(m_element))
     1030        return false;
     1031
     1032    return equalIgnoringCase(getAttributeSetValueForId(ATK_OBJECT(m_element), "aria-haspopup"), "true");
    10261033}
    10271034
  • trunk/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp

    r152397 r152716  
    5252    String attributeString = String::fromUTF8(buffer.get());
    5353    return attributeString == "AXPlaceholderValue" ? "placeholder-text" : String();
     54}
     55
     56static String getAttributeSetValueForId(AtkObject* accessible, const char* id)
     57{
     58    const char* attributeValue = 0;
     59    AtkAttributeSet* attributeSet = atk_object_get_attributes(accessible);
     60    for (AtkAttributeSet* attributes = attributeSet; attributes; attributes = attributes->next) {
     61        AtkAttribute* atkAttribute = static_cast<AtkAttribute*>(attributes->data);
     62        if (!strcmp(atkAttribute->name, id)) {
     63            attributeValue = atkAttribute->value;
     64            break;
     65        }
     66    }
     67
     68    String atkAttributeValue = String::fromUTF8(attributeValue);
     69    atk_attribute_set_free(attributeSet);
     70
     71    return atkAttributeValue;
    5472}
    5573
     
    474492        return JSStringCreateWithCharacters(0, 0);
    475493
    476     const char* attributeValue = 0;
    477     AtkAttributeSet* attributeSet = atk_object_get_attributes(ATK_OBJECT(m_element.get()));
    478     for (AtkAttributeSet* attributes = attributeSet; attributes; attributes = attributes->next) {
    479         AtkAttribute* atkAttribute = static_cast<AtkAttribute*>(attributes->data);
    480         if (!strcmp(atkAttribute->name, atkAttributeName.utf8().data())) {
    481             attributeValue = atkAttribute->value;
    482             break;
    483         }
    484     }
    485     JSStringRef jsString = attributeValue
    486         ? JSStringCreateWithUTF8CString(attributeValue)
    487         : JSStringCreateWithCharacters(0, 0);
    488     atk_attribute_set_free(attributeSet);
    489 
    490     return jsString;
     494    String attributeValue = getAttributeSetValueForId(ATK_OBJECT(m_element.get()), atkAttributeName.utf8().data());
     495    return JSStringCreateWithUTF8CString(attributeValue.utf8().data());
    491496}
    492497
     
    10751080bool AccessibilityUIElement::hasPopup() const
    10761081{
    1077     // FIXME: implement
    1078     return false;
     1082    if (!m_element || !ATK_IS_OBJECT(m_element.get()))
     1083        return false;
     1084
     1085    return equalIgnoringCase(getAttributeSetValueForId(ATK_OBJECT(m_element.get()), "aria-haspopup"), "true");
    10791086}
    10801087
Note: See TracChangeset for help on using the changeset viewer.