Changeset 148654 in webkit


Ignore:
Timestamp:
Apr 17, 2013 6:11:32 PM (11 years ago)
Author:
commit-queue@webkit.org
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 <james@cookiecrook.com> 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:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r148652 r148654  
     12013-04-17  James Craig  <james@cookiecrook.com>
     2
     3        AX: aria-level does not override implicit level on h1, h2, etc
     4        https://bugs.webkit.org/show_bug.cgi?id=114692
     5
     6        Reviewed by Chris Fleizach.
     7
     8        aria-level now works on headings without an explicit role="heading" defined. Updated existing test coverage.
     9
     10        * accessibility/heading-level-expected.txt:
     11        * accessibility/heading-level.html:
     12
    1132013-04-17  Chris Fleizach  <cfleizach@apple.com>
    214
  • trunk/LayoutTests/accessibility/heading-level-expected.txt

    r139534 r148654  
    2222PASS: level is 5.
    2323PASS: level is 6.
     24PASS: level is 1.
     25PASS: level is 2.
     26PASS: level is 3.
     27PASS: level is 4.
     28PASS: level is 5.
     29PASS: level is 6.
    2430PASS successfullyParsed is true
    2531
  • trunk/LayoutTests/accessibility/heading-level.html

    r139534 r148654  
    1212<h6 class="ex" data-expected="6">X</h6>
    1313
    14 <!-- explicit aria-level overrides on h1-h6 (withOUT explicit heading role declaration) does not work in current WebKit. -->
    15 <!-- Waiting on thread resolution to determine if it's a bug: http://lists.w3.org/Archives/Public/wai-xtech/2013Jan/0019.html -->
    16 <!--
     14<!-- explicit aria-level overrides on h1-h6 (withOUT explicit heading role declaration) -->
    1715<h6 class="ex" data-expected="1" aria-level="1">X</h6>
    1816<h5 class="ex" data-expected="2" aria-level="2">X</h5>
     
    2119<h2 class="ex" data-expected="5" aria-level="5">X</h2>
    2220<h1 class="ex" data-expected="6" aria-level="6">X</h1>
    23 -->
    2421
    2522<!-- explicit aria-level overrides on h1-h6 (with explicit heading role declaration) -->
  • trunk/Source/WebCore/ChangeLog

    r148652 r148654  
     12013-04-17  James Craig  <james@cookiecrook.com>
     2
     3        AX: aria-level does not override implicit level on h1, h2, etc
     4        https://bugs.webkit.org/show_bug.cgi?id=114692
     5
     6        Reviewed by Chris Fleizach.
     7
     8        aria-level now works on headings without an explicit role="heading" defined. Updated existing test coverage.
     9
     10        * accessibility/AccessibilityNodeObject.cpp:
     11        (WebCore::AccessibilityNodeObject::headingLevel):
     12
    1132013-04-17  Chris Fleizach  <cfleizach@apple.com>
    214
  • trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp

    r148652 r148654  
    717717        return false;
    718718
    719     if (ariaRoleAttribute() == HeadingRole)
    720         return getAttribute(aria_levelAttr).toInt();
     719    if (isHeading()) {
     720        int ariaLevel = getAttribute(aria_levelAttr).toInt();
     721        if (ariaLevel > 0)
     722            return ariaLevel;
     723    }
    721724
    722725    if (node->hasTagName(h1Tag))
Note: See TracChangeset for help on using the changeset viewer.