Bug 114692

Summary: AX: aria-level does not override implicit level on h1, h2, etc
Product: WebKit Reporter: James Craig <jcraig>
Component: AccessibilityAssignee: James Craig <jcraig>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, apinheiro, cfleizach, commit-queue, dmazzoni, jdiggs, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch
none
patch
none
patch with review feedback
none
patch with review feedback none

Description James Craig 2013-04-16 11:21:27 PDT
Change will be in AccessibilityNodeObject::headingLevel.
Update commented lines of heading-level layout test at the same time.
Comment 1 Radar WebKit Bug Importer 2013-04-16 11:22:18 PDT
<rdar://problem/13665073>
Comment 2 James Craig 2013-04-17 01:26:48 PDT
Created attachment 198479 [details]
patch
Comment 3 chris fleizach 2013-04-17 08:03:30 PDT
Comment on attachment 198479 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=198479&action=review

> Source/WebCore/ChangeLog:3
> +        aria-level does not override implicit level on h1, h2, etc

We should prefix accessibility bugs with AX: so it's easier to know what aspect of the code their referring to

> Source/WebCore/accessibility/AccessibilityNodeObject.cpp:719
> +    if (isHeading() && getAttribute(aria_levelAttr).toInt() > 0)

You should cache the value of getAttribute rather than call it two times
Comment 4 James Craig 2013-04-17 09:16:58 PDT
(In reply to comment #3)
> We should prefix accessibility bugs with AX: so it's easier to know what aspect…

Is this concern only for the ChangeLog comments? I hadn't been prefixing the bug titles b/c they're all filed in the "Accessibility" component.

> You should cache the value of getAttribute rather than call it two times

Okay, thanks.
Comment 5 chris fleizach 2013-04-17 09:22:20 PDT
(In reply to comment #4)
> (In reply to comment #3)
> > We should prefix accessibility bugs with AX: so it's easier to know what aspect…
> 
> Is this concern only for the ChangeLog comments? I hadn't been prefixing the bug titles b/c they're all filed in the "Accessibility" component.

My preference is that all Accessibility bugs have AX: in the title. The category of the bug isn't transferred to change logs, commit logs, etc, etc

> 
> > You should cache the value of getAttribute rather than call it two times
> 
> Okay, thanks.
Comment 6 James Craig 2013-04-17 09:24:31 PDT
Created attachment 198581 [details]
patch
Comment 7 chris fleizach 2013-04-17 09:31:52 PDT
Comment on attachment 198581 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=198581&action=review

> Source/WebCore/accessibility/AccessibilityNodeObject.cpp:720
> +    if (isHeading() && ariaLevel > 0)

we should probably do
if (isHeading()) {
    int ariaLevel = getAttribute(aria_levelAttr).toInt();
    if (ariaLevel > 0)
        return ariaLevel;
}

so that every object doesn't have to make that getAttribute call
Comment 8 James Craig 2013-04-17 11:34:31 PDT
Created attachment 198589 [details]
patch with review feedback
Comment 9 chris fleizach 2013-04-17 12:39:47 PDT
Comment on attachment 198589 [details]
patch with review feedback

View in context: https://bugs.webkit.org/attachment.cgi?id=198589&action=review

> Source/WebCore/accessibility/AccessibilityNodeObject.cpp:721
> +        if (ariaLevel > 0) {

brackets not needed for a one line if (this will fail style-bot)

> Source/WebCore/accessibility/AccessibilityNodeObject.cpp:743
> +    

this extra insertion should probably be removed to reduce churn
Comment 10 James Craig 2013-04-17 14:00:39 PDT
Created attachment 198606 [details]
patch with review feedback
Comment 11 WebKit Commit Bot 2013-04-17 18:10:15 PDT
Comment on attachment 198606 [details]
patch with review feedback

Clearing flags on attachment: 198606

Committed r148654: <http://trac.webkit.org/changeset/148654>
Comment 12 WebKit Commit Bot 2013-04-17 18:10:18 PDT
All reviewed patches have been landed.  Closing bug.