Changeset 207553 in webkit


Ignore:
Timestamp:
Oct 19, 2016 11:59:23 AM (8 years ago)
Author:
commit-queue@webkit.org
Message:

Web Inspector: AXI: expose computed tree node and heading level
https://bugs.webkit.org/show_bug.cgi?id=130825
<rdar://problem/16442349>

Patch by Aaron Chu <aaron_chu@apple.com> on 2016-10-19
Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

Exposing two new accessibility properties: Heading Level and Hierarchical Level.

  • inspector/protocol/DOM.json:

Source/WebCore:

Exposing two new accessibility properties: Heading Level and Hierarchical Level.

Updated Test: LayoutTest/inspector/dom/getAccessibilityPropertiesForNode.html

  • inspector/InspectorDOMAgent.cpp:

(WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):

Source/WebInspectorUI:

Updating the Web Accessibility Inspector to display Heading Level and Hierarchical Level.

  • Localizations/en.lproj/localizedStrings.js:
  • UserInterface/Models/DOMNode.js:

(WebInspector.DOMNode.prototype.accessibilityProperties.accessibilityPropertiesCallback):
(WebInspector.DOMNode.prototype.accessibilityProperties):

  • UserInterface/Views/DOMNodeDetailsSidebarPanel.js:

(WebInspector.DOMNodeDetailsSidebarPanel):
(WebInspector.DOMNodeDetailsSidebarPanel.prototype._refreshAccessibility.accessibilityPropertiesCallback):
(WebInspector.DOMNodeDetailsSidebarPanel.prototype._refreshAccessibility):

LayoutTests:

Included logging of the two newly exposed accessibility properties:
Heading Level and Hierarchical Level.

  • inspector/dom/getAccessibilityPropertiesForNode-expected.txt:
  • inspector/dom/getAccessibilityPropertiesForNode.html:
Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r207547 r207553  
     12016-10-19  Aaron Chu  <aaron_chu@apple.com>
     2
     3        Web Inspector: AXI: expose computed tree node and heading level
     4        https://bugs.webkit.org/show_bug.cgi?id=130825
     5        <rdar://problem/16442349>
     6
     7        Reviewed by Joseph Pecoraro.
     8
     9        Included logging of the two newly exposed accessibility properties:
     10        Heading Level and Hierarchical Level.
     11
     12        * inspector/dom/getAccessibilityPropertiesForNode-expected.txt:
     13        * inspector/dom/getAccessibilityPropertiesForNode.html:
     14
    1152016-10-19  Zalan Bujtas  <zalan@apple.com>
    216
  • trunk/LayoutTests/inspector/dom/getAccessibilityPropertiesForNode-expected.txt

    r200698 r207553  
    55    label:
    66    role:
    7     childNodeIds.length: 43
    8 
    9 
    10 Total elements to be tested: 65.
     7    childNodeIds.length: 52
     8
     9
     10Total elements to be tested: 81.
    1111
    1212<div onclick="void(0);">click</div>
     
    1818    parentNodeId: exists
    1919
     20<li role="treeitem">Tree Item Level 2</li>
     21    exists: true
     22    label:
     23    role: treeitem
     24    childNodeIds.length: 1
     25    parentNodeId: exists
     26    hierarchyLevel: 2
     27
     28<ul>
     29            <li role="treeitem">Tree Item Level 2</li>
     30        </ul>
     31    exists: true
     32    label:
     33    role: group
     34    childNodeIds.length: 1
     35    parentNodeId: exists
     36
     37<li role="treeitem">
     38        <span>Tree Item Level 1</span>
     39        <ul>
     40            <li role="treeitem">Tree Item Level 2</li>
     41        </ul>
     42    </li>
     43    exists: true
     44    label:
     45    role: treeitem
     46    childNodeIds.length: 2
     47    parentNodeId: exists
     48    hierarchyLevel: 1
     49
     50<ul role="tree">
     51    <li role="treeitem">
     52        <span>Tree Item Level 1</span>
     53        <ul>
     54            <li role="treeitem">Tree Item Level 2</li>
     55        </ul>
     56    </li>
     57</ul>
     58    exists: true
     59    label:
     60    role: tree
     61    childNodeIds.length: 1
     62    parentNodeId: exists
     63
     64<li aria-level="1">List Item Level 1</li>
     65    exists: true
     66    label:
     67    role: listitem
     68    childNodeIds.length: 1
     69    parentNodeId: exists
     70    hierarchyLevel: 1
     71
     72<li aria-level="2">List Item Level 2</li>
     73    exists: true
     74    label:
     75    role: listitem
     76    childNodeIds.length: 1
     77    parentNodeId: exists
     78    hierarchyLevel: 2
     79
     80<ol>
     81            <li aria-level="2">List Item Level 2</li>
     82        </ol>
     83    exists: true
     84    label:
     85    role: list
     86    childNodeIds.length: 1
     87    parentNodeId: exists
     88
     89<li aria-level="1">
     90        <span>List Item Level 1</span>
     91        <ol>
     92            <li aria-level="2">List Item Level 2</li>
     93        </ol>
     94    </li>
     95    exists: true
     96    label:
     97    role: listitem
     98    childNodeIds.length: 2
     99    parentNodeId: exists
     100    hierarchyLevel: 1
     101
     102<ul>
     103    <li aria-level="1">
     104        <span>List Item Level 1</span>
     105        <ol>
     106            <li aria-level="2">List Item Level 2</li>
     107        </ol>
     108    </li>
     109    <li aria-level="1">List Item Level 1</li>
     110</ul>
     111    exists: true
     112    label:
     113    role: list
     114    childNodeIds.length: 2
     115    parentNodeId: exists
     116
     117<h1 style="color: red;" aria-level="8">H1</h1>
     118    exists: true
     119    label: H1
     120    role: heading
     121    childNodeIds.length: 1
     122    parentNodeId: exists
     123    headingLevel: 8
     124
     125<h6>H6</h6>
     126    exists: true
     127    label: H6
     128    role: heading
     129    childNodeIds.length: 1
     130    parentNodeId: exists
     131    headingLevel: 6
     132
     133<h5>H5</h5>
     134    exists: true
     135    label: H5
     136    role: heading
     137    childNodeIds.length: 1
     138    parentNodeId: exists
     139    headingLevel: 5
     140
     141<h4>H4</h4>
     142    exists: true
     143    label: H4
     144    role: heading
     145    childNodeIds.length: 1
     146    parentNodeId: exists
     147    headingLevel: 4
     148
     149<h3>H3</h3>
     150    exists: true
     151    label: H3
     152    role: heading
     153    childNodeIds.length: 1
     154    parentNodeId: exists
     155    headingLevel: 3
     156
     157<h2>H2</h2>
     158    exists: true
     159    label: H2
     160    role: heading
     161    childNodeIds.length: 1
     162    parentNodeId: exists
     163    headingLevel: 2
     164
     165<h1>H1</h1>
     166    exists: true
     167    label: H1
     168    role: heading
     169    childNodeIds.length: 1
     170    parentNodeId: exists
     171    headingLevel: 1
     172
    20173<li role="treeitem" aria-expanded="undefined">expanded</li>
    21174    exists: true
     
    24177    childNodeIds.length: 1
    25178    parentNodeId: exists
     179    hierarchyLevel: 1
    26180
    27181<li role="treeitem" aria-expanded="false" id="activedescendant" aria-selected="true">collapsed</li>
     
    33187    parentNodeId: exists
    34188    selected: true
     189    hierarchyLevel: 1
    35190
    36191<li role="treeitem" aria-expanded="true">expanded</li>
     
    41196    expanded: true
    42197    parentNodeId: exists
     198    hierarchyLevel: 1
    43199
    44200<ul role="tree" id="flowedTo1" aria-activedescendant="activedescendant">
  • trunk/LayoutTests/inspector/dom/getAccessibilityPropertiesForNode.html

    r188267 r207553  
    118118    <li class="ex" role="treeitem" aria-expanded="undefined">expanded</li>
    119119</ul>
     120
     121<div>
     122<h1 class="ex">H1</h1>
     123<h2 class="ex">H2</h2>
     124<h3 class="ex">H3</h3>
     125<h4 class="ex">H4</h4>
     126<h5 class="ex">H5</h5>
     127<h6 class="ex">H6</h6>
     128
     129<h1  class="ex" style="color: red;" aria-level="8">H1</h1>
     130
     131<ul class="ex">
     132    <li class="ex" aria-level="1">
     133        <span>List Item Level 1</span>
     134        <ol class="ex">
     135            <li class="ex" aria-level="2">List Item Level 2</li>
     136        </ol>
     137    </li>
     138    <li class="ex" aria-level="1">List Item Level 1</li>
     139</ul>
     140
     141<ul class="ex" role="tree">
     142    <li class="ex" role="treeitem">
     143        <span>Tree Item Level 1</span>
     144        <ul class="ex">
     145            <li class="ex" role="treeitem">Tree Item Level 2</li>
     146        </ul>
     147    </li>
     148</ul>
     149
     150</div>
    120151
    121152<!-- Full test of mouseEventNodeId in getAccessibilityPropertiesForNode_mouseEventNodeId.html. -->
  • trunk/Source/JavaScriptCore/ChangeLog

    r207545 r207553  
     12016-10-19  Aaron Chu  <aaron_chu@apple.com>
     2
     3        Web Inspector: AXI: expose computed tree node and heading level
     4        https://bugs.webkit.org/show_bug.cgi?id=130825
     5        <rdar://problem/16442349>
     6
     7        Reviewed by Joseph Pecoraro.
     8
     9        Exposing two new accessibility properties: Heading Level and Hierarchical Level.
     10
     11        * inspector/protocol/DOM.json:
     12
    1132016-10-18  Filip Pizlo  <fpizlo@apple.com>
    214
  • trunk/Source/JavaScriptCore/inspector/protocol/DOM.json

    r204114 r207553  
    9090                { "name": "current", "type": "string", "optional": true, "enum": ["true", "false", "page", "step", "location", "date", "time"], "description": "Current item within a container or set of related elements." },
    9191                { "name": "disabled", "type": "boolean", "optional": true, "description": "Disabled state of form controls." },
     92                { "name": "headingLevel", "type": "number", "optional": true, "description": "Heading level of a heading element." },
     93                { "name": "hierarchyLevel", "type": "number", "optional": true, "description": "The hierarchical level of an element." },
    9294                { "name": "exists", "type": "boolean", "description": "Indicates whether there is an existing AX object for the DOM node. If this is false, all the other properties will be default values." },
    9395                { "name": "expanded", "type": "boolean", "optional": true, "description": "Expanded state." },
  • trunk/Source/WebCore/ChangeLog

    r207552 r207553  
     12016-10-19  Aaron Chu  <aaron_chu@apple.com>
     2
     3        Web Inspector: AXI: expose computed tree node and heading level
     4        https://bugs.webkit.org/show_bug.cgi?id=130825
     5        <rdar://problem/16442349>
     6
     7        Reviewed by Joseph Pecoraro.
     8
     9        Exposing two new accessibility properties: Heading Level and Hierarchical Level.
     10
     11        Updated Test: LayoutTest/inspector/dom/getAccessibilityPropertiesForNode.html
     12
     13        * inspector/InspectorDOMAgent.cpp:
     14        (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
     15
    1162016-10-19  Adam Bergkvist  <adam.bergkvist@ericsson.com>
    217
  • trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp

    r207496 r207553  
    16001600    bool supportsRequired = false;
    16011601    bool supportsFocused = false;
     1602    int headingLevel = 0;
     1603    unsigned hierarchicalLevel = 0;
     1604    unsigned level = 0;
    16021605
    16031606    if (AXObjectCache* axObjectCache = node->document().axObjectCache()) {
     
    17731776                }
    17741777            }
     1778           
     1779            headingLevel = axObject->headingLevel();
     1780            hierarchicalLevel = axObject->hierarchicalLevel();
     1781           
     1782            level = hierarchicalLevel ? hierarchicalLevel : headingLevel;
    17751783        }
    17761784    }
     
    18341842        if (selectedChildNodeIds)
    18351843            value->setSelectedChildNodeIds(selectedChildNodeIds);
     1844       
     1845        // H1 -- H6 always have a headingLevel property that can be complimented by a hierarchicalLevel
     1846        // property when aria-level is set on the element, in which case we want to remain calling
     1847        // this value the "Heading Level" in the inspector.
     1848        // Also, we do not want it to say Hierarchy Level: 0
     1849        if (headingLevel)
     1850            value->setHeadingLevel(level);
     1851        else if (level)
     1852            value->setHierarchyLevel(level);
    18361853    }
    18371854
  • trunk/Source/WebInspectorUI/ChangeLog

    r207489 r207553  
     12016-10-19  Aaron Chu  <aaron_chu@apple.com>
     2
     3        Web Inspector: AXI: expose computed tree node and heading level
     4        https://bugs.webkit.org/show_bug.cgi?id=130825
     5        <rdar://problem/16442349>
     6
     7        Reviewed by Joseph Pecoraro.
     8
     9        Updating the Web Accessibility Inspector to display Heading Level and Hierarchical Level.
     10
     11        * Localizations/en.lproj/localizedStrings.js:
     12        * UserInterface/Models/DOMNode.js:
     13        (WebInspector.DOMNode.prototype.accessibilityProperties.accessibilityPropertiesCallback):
     14        (WebInspector.DOMNode.prototype.accessibilityProperties):
     15        * UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
     16        (WebInspector.DOMNodeDetailsSidebarPanel):
     17        (WebInspector.DOMNodeDetailsSidebarPanel.prototype._refreshAccessibility.accessibilityPropertiesCallback):
     18        (WebInspector.DOMNodeDetailsSidebarPanel.prototype._refreshAccessibility):
     19
    1202016-10-18  Joseph Pecoraro  <pecoraro@apple.com>
    221
  • trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js

    r207444 r207553  
    394394localizedStrings["Heap Snapshot Object (@%d)"] = "Heap Snapshot Object (@%d)";
    395395localizedStrings["Height"] = "Height";
     396localizedStrings["Heading Level"] = "Heading Level";
     397localizedStrings["Hierarchy Level"] = "Hierarchy Level";
    396398localizedStrings["Hide compositing borders"] = "Hide compositing borders";
    397399localizedStrings["Hide shadow DOM nodes"] = "Hide shadow DOM nodes";
  • trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js

    r206008 r207553  
    518518                    ignoredByDefault: accessibilityProperties.ignoredByDefault,
    519519                    invalid: accessibilityProperties.invalid,
     520                    headingLevel: accessibilityProperties.headingLevel,
     521                    hierarchyLevel: accessibilityProperties.hierarchyLevel,
    520522                    hidden: accessibilityProperties.hidden,
    521523                    label: accessibilityProperties.label,
  • trunk/Source/WebInspectorUI/UserInterface/Views/DOMNodeDetailsSidebarPanel.js

    r205425 r207553  
    7474            this._accessibilityNodeFlowsRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Flows"));
    7575            this._accessibilityNodeFocusedRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Focused"));
     76            this._accessibilityNodeHeadingLevelRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Heading Level"));
     77            this._accessibilityNodehierarchyLevelRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Hierarchy Level"));
    7678            this._accessibilityNodeIgnoredRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Ignored"));
    7779            this._accessibilityNodeInvalidRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Invalid"));
     
    502504                var selectedChildNodeLinkList = linkListForNodeIds(accessibilityProperties.selectedChildNodeIds);
    503505
     506                var headingLevel = accessibilityProperties.headingLevel;
     507                var hierarchyLevel = accessibilityProperties.hierarchyLevel;
    504508                // Assign all the properties to their respective views.
    505509                this._accessibilityNodeActiveDescendantRow.value = activeDescendantLink || "";
     
    513517                this._accessibilityNodeFlowsRow.value = flowedNodeLinkList || "";
    514518                this._accessibilityNodeFocusedRow.value = focused;
     519                this._accessibilityNodeHeadingLevelRow.value = headingLevel || "";
     520                this._accessibilityNodehierarchyLevelRow.value = hierarchyLevel || "";
    515521                this._accessibilityNodeIgnoredRow.value = ignored;
    516522                this._accessibilityNodeInvalidRow.value = invalid;
     
    550556                    this._accessibilityNodeMouseEventRow,
    551557                    this._accessibilityNodeFocusedRow,
     558                    this._accessibilityNodeHeadingLevelRow,
     559                    this._accessibilityNodehierarchyLevelRow,
    552560                    this._accessibilityNodeBusyRow,
    553561                    this._accessibilityNodeLiveRegionStatusRow,
Note: See TracChangeset for help on using the changeset viewer.