AX: [ATK] The value of aria-level is not exposed on non-heading roles
https://bugs.webkit.org/show_bug.cgi?id=177775

Reviewed by Chris Fleizach.

Source/WebCore:

Expose the value of aria-level via the "level" AtkObject attribute, as is currently
done for headings.

Test: accessibility/gtk/aria-level.html

* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(webkitAccessibleGetAttributes):

Tools:

* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::hierarchicalLevel const):

LayoutTests:

* accessibility/gtk/aria-level-expected.txt: Added.
* accessibility/gtk/aria-level.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@222765 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp b/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp
index 8f16127..f604482 100644
--- a/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp
+++ b/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp
@@ -448,9 +448,9 @@
             attributeSet = addToAtkAttributeSet(attributeSet, "html-id", id.utf8().data());
     }
 
-    int headingLevel = coreObject->headingLevel();
-    if (headingLevel) {
-        String value = String::number(headingLevel);
+    int level = coreObject->isHeading() ? coreObject->headingLevel() : coreObject->hierarchicalLevel();
+    if (level) {
+        String value = String::number(level);
         attributeSet = addToAtkAttributeSet(attributeSet, "level", value.utf8().data());
     }