Title: [148654] trunk
Revision
148654
Author
[email protected]
Date
2013-04-17 18:11:32 -0700 (Wed, 17 Apr 2013)

Log Message

AX: aria-level does not override implicit level on h1, h2, etc
https://bugs.webkit.org/show_bug.cgi?id=114692

Patch by James Craig <[email protected]> on 2013-04-17
Reviewed by Chris Fleizach.

aria-level now works on headings without an explicit role="heading" defined. Updated existing test coverage.

Source/WebCore:

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::headingLevel):

LayoutTests:

* accessibility/heading-level-expected.txt:
* accessibility/heading-level.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (148653 => 148654)


--- trunk/LayoutTests/ChangeLog	2013-04-18 01:08:49 UTC (rev 148653)
+++ trunk/LayoutTests/ChangeLog	2013-04-18 01:11:32 UTC (rev 148654)
@@ -1,3 +1,15 @@
+2013-04-17  James Craig  <[email protected]>
+
+        AX: aria-level does not override implicit level on h1, h2, etc
+        https://bugs.webkit.org/show_bug.cgi?id=114692
+
+        Reviewed by Chris Fleizach.
+
+        aria-level now works on headings without an explicit role="heading" defined. Updated existing test coverage.
+
+        * accessibility/heading-level-expected.txt:
+        * accessibility/heading-level.html:
+
 2013-04-17  Chris Fleizach  <[email protected]>
 
         AX: VoiceOver says everything that isn't a link is a "clickable" in Safari reader?

Modified: trunk/LayoutTests/accessibility/heading-level-expected.txt (148653 => 148654)


--- trunk/LayoutTests/accessibility/heading-level-expected.txt	2013-04-18 01:08:49 UTC (rev 148653)
+++ trunk/LayoutTests/accessibility/heading-level-expected.txt	2013-04-18 01:11:32 UTC (rev 148654)
@@ -21,6 +21,12 @@
 PASS: level is 4.
 PASS: level is 5.
 PASS: level is 6.
+PASS: level is 1.
+PASS: level is 2.
+PASS: level is 3.
+PASS: level is 4.
+PASS: level is 5.
+PASS: level is 6.
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/accessibility/heading-level.html (148653 => 148654)


--- trunk/LayoutTests/accessibility/heading-level.html	2013-04-18 01:08:49 UTC (rev 148653)
+++ trunk/LayoutTests/accessibility/heading-level.html	2013-04-18 01:11:32 UTC (rev 148654)
@@ -11,16 +11,13 @@
 <h5 class="ex" data-expected="5">X</h5>
 <h6 class="ex" data-expected="6">X</h6>
 
-<!-- explicit aria-level overrides on h1-h6 (withOUT explicit heading role declaration) does not work in current WebKit. -->
-<!-- Waiting on thread resolution to determine if it's a bug: http://lists.w3.org/Archives/Public/wai-xtech/2013Jan/0019.html -->
-<!-- 
+<!-- explicit aria-level overrides on h1-h6 (withOUT explicit heading role declaration) -->
 <h6 class="ex" data-expected="1" aria-level="1">X</h6>
 <h5 class="ex" data-expected="2" aria-level="2">X</h5>
 <h4 class="ex" data-expected="3" aria-level="3">X</h4>
 <h3 class="ex" data-expected="4" aria-level="4">X</h3>
 <h2 class="ex" data-expected="5" aria-level="5">X</h2>
 <h1 class="ex" data-expected="6" aria-level="6">X</h1>
--->
 
 <!-- explicit aria-level overrides on h1-h6 (with explicit heading role declaration) -->
 <h6 class="ex" role="heading" data-expected="1" aria-level="1">X</h6>

Modified: trunk/Source/WebCore/ChangeLog (148653 => 148654)


--- trunk/Source/WebCore/ChangeLog	2013-04-18 01:08:49 UTC (rev 148653)
+++ trunk/Source/WebCore/ChangeLog	2013-04-18 01:11:32 UTC (rev 148654)
@@ -1,3 +1,15 @@
+2013-04-17  James Craig  <[email protected]>
+
+        AX: aria-level does not override implicit level on h1, h2, etc
+        https://bugs.webkit.org/show_bug.cgi?id=114692
+
+        Reviewed by Chris Fleizach.
+
+        aria-level now works on headings without an explicit role="heading" defined. Updated existing test coverage.
+
+        * accessibility/AccessibilityNodeObject.cpp:
+        (WebCore::AccessibilityNodeObject::headingLevel):
+
 2013-04-17  Chris Fleizach  <[email protected]>
 
         AX: VoiceOver says everything that isn't a link is a "clickable" in Safari reader?

Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp (148653 => 148654)


--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2013-04-18 01:08:49 UTC (rev 148653)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2013-04-18 01:11:32 UTC (rev 148654)
@@ -716,8 +716,11 @@
     if (!node)
         return false;
 
-    if (ariaRoleAttribute() == HeadingRole)
-        return getAttribute(aria_levelAttr).toInt();
+    if (isHeading()) {
+        int ariaLevel = getAttribute(aria_levelAttr).toInt();
+        if (ariaLevel > 0)
+            return ariaLevel;
+    }
 
     if (node->hasTagName(h1Tag))
         return 1;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to