Title: [166279] trunk
Revision
166279
Author
commit-qu...@webkit.org
Date
2014-03-25 20:03:39 -0700 (Tue, 25 Mar 2014)

Log Message

Web Inspector: AXI: add support for aria-activedescendant and reconcile UI/testing with parentNode
https://bugs.webkit.org/show_bug.cgi?id=130712

Patch by James Craig <jcr...@apple.com> on 2014-03-25
Reviewed by Timothy Hatcher.

Source/WebCore:

Test: inspector-protocol/dom/getAccessibilityPropertiesForNode.html

Support for @aria-activedescendant; code reuse changes w/ parentNode and activeDescendantNode.

* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
* inspector/protocol/DOM.json:

Source/WebInspectorUI:

Support for @aria-activedescendant; code reuse changes w/ parentNode and activeDescendantNode.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Models/DOMNode.js:
* UserInterface/Views/DOMNodeDetailsSidebarPanel.js:

LayoutTests:

Support for @aria-activedescendant; code reuse changes w/ parentNode and activeDescendantNode.

* inspector-protocol/dom/getAccessibilityPropertiesForNode-expected.txt:
* inspector-protocol/dom/getAccessibilityPropertiesForNode.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (166278 => 166279)


--- trunk/LayoutTests/ChangeLog	2014-03-26 02:37:51 UTC (rev 166278)
+++ trunk/LayoutTests/ChangeLog	2014-03-26 03:03:39 UTC (rev 166279)
@@ -1,3 +1,15 @@
+2014-03-25  James Craig  <jcr...@apple.com>
+
+        Web Inspector: AXI: add support for aria-activedescendant and reconcile UI/testing with parentNode
+        https://bugs.webkit.org/show_bug.cgi?id=130712
+
+        Reviewed by Timothy Hatcher.
+
+        Support for @aria-activedescendant; code reuse changes w/ parentNode and activeDescendantNode.
+
+        * inspector-protocol/dom/getAccessibilityPropertiesForNode-expected.txt:
+        * inspector-protocol/dom/getAccessibilityPropertiesForNode.html:
+
 2014-03-25  Sanghyup Lee  <sh53....@samsung.com>
 
         When the mouse is upped after dragged out of shadowDOM, it should lose :active.

Modified: trunk/LayoutTests/inspector-protocol/dom/getAccessibilityPropertiesForNode-expected.txt (166278 => 166279)


--- trunk/LayoutTests/inspector-protocol/dom/getAccessibilityPropertiesForNode-expected.txt	2014-03-26 02:37:51 UTC (rev 166278)
+++ trunk/LayoutTests/inspector-protocol/dom/getAccessibilityPropertiesForNode-expected.txt	2014-03-26 03:03:39 UTC (rev 166279)
@@ -7,13 +7,15 @@
     label: 
     role: treeitem
     childNodeIds.length: 1
+    parentNodeId: exists
 
-<li role="treeitem" aria-expanded="false">collapsed</li>
+<li role="treeitem" aria-expanded="false" id="activedescendant">collapsed</li>
     exists: true
     label: 
     role: treeitem
     childNodeIds.length: 1
     expanded: false
+    parentNodeId: exists
 
 <li role="treeitem" aria-expanded="true">expanded</li>
     exists: true
@@ -21,26 +23,31 @@
     role: treeitem
     childNodeIds.length: 1
     expanded: true
+    parentNodeId: exists
 
-<ul role="tree" id="flowedTo1">
+<ul role="tree" id="flowedTo1" aria-activedescendant="activedescendant">
     <li role="treeitem" aria-expanded="true">expanded</li>
-    <li role="treeitem" aria-expanded="false">collapsed</li>
+    <li role="treeitem" aria-expanded="false" id="activedescendant">collapsed</li>
     <li role="treeitem" aria-expanded="undefined">expanded</li>
 </ul>
     exists: true
     label: 
     role: tree
+    activeDescendantNodeId: exists
     childNodeIds.length: 3
+    parentNodeId: exists
 
 <div role="tab" aria-selected="false">not selected</div>
     exists: true
     label: 
     role: tab
+    parentNodeId: exists
 
 <div role="tab" aria-selected="true">selected</div>
     exists: true
     label: 
     role: tab
+    parentNodeId: exists
     selected: true
 
 <div role="tablist" aria-flowto="flowedTo1 invalidIdRef flowedTo2">
@@ -52,16 +59,19 @@
     role: tablist
     childNodeIds.length: 2
     flowedNodeIds.length: 2
+    parentNodeId: exists
 
 <div role="option" aria-selected="false">not selected</div>
     exists: true
     label: 
     role: option
+    parentNodeId: exists
 
 <div role="option" aria-selected="true">selected</div>
     exists: true
     label: 
     role: option
+    parentNodeId: exists
     selected: true
 
 <div role="listbox" id="ownedlistbox">
@@ -72,6 +82,7 @@
     label: 
     role: listbox
     childNodeIds.length: 2
+    parentNodeId: exists
     required: false
 
 <input role="combobox" aria-owns="ownedlistbox invalidIdRef" aria-controls="ownedlistbox invalidIdRef">
@@ -148,6 +159,7 @@
     label: 
     role: radio
     checked: false
+    parentNodeId: exists
     required: false
 
 <div role="radio" aria-checked="mixed">unchecked [sic] mixed state will not be exposed on radios per ARIA spec.</div>
@@ -155,6 +167,7 @@
     label: 
     role: radio
     checked: false
+    parentNodeId: exists
     required: false
 
 <div role="radio" aria-checked="true">checked</div>
@@ -162,6 +175,7 @@
     label: 
     role: radio
     checked: true
+    parentNodeId: exists
     required: false
 
 <div role="radio">unchecked (checked undefined evals to false on radio)</div>
@@ -169,6 +183,7 @@
     label: 
     role: radio
     checked: false
+    parentNodeId: exists
     required: false
 
 <input type="radio" checked="">
@@ -192,6 +207,7 @@
     label: 
     role: checkbox
     checked: false
+    parentNodeId: exists
     required: false
 
 <div role="checkbox" aria-checked="mixed">mixed</div>
@@ -199,6 +215,7 @@
     label: 
     role: checkbox
     checked: mixed
+    parentNodeId: exists
     required: false
 
 <div role="checkbox" aria-checked="true">checked</div>
@@ -206,6 +223,7 @@
     label: 
     role: checkbox
     checked: true
+    parentNodeId: exists
     required: false
 
 <div role="checkbox">unchecked (checked undefined evals to false on checkbox)</div>
@@ -213,6 +231,7 @@
     label: 
     role: checkbox
     checked: false
+    parentNodeId: exists
     required: false
 
 <input type="checkbox" checked="">
@@ -237,6 +256,7 @@
     role: 
     disabled: true
     focused: false
+    parentNodeId: exists
     readonly: true
     required: false
 
@@ -253,6 +273,7 @@
     label: 
     role: 
     focused: false
+    parentNodeId: exists
     readonly: true
     required: false
 
@@ -322,6 +343,7 @@
     label: 
     role: 
     focused: false
+    parentNodeId: exists
     pressed: false
     required: false
 
@@ -330,6 +352,7 @@
     label: 
     role: 
     focused: false
+    parentNodeId: exists
     pressed: false
     required: false
 
@@ -339,12 +362,14 @@
     role: button
     disabled: true
     focused: false
+    parentNodeId: exists
 
 <div role="button" tabindex="0"></div>
     exists: true
     label: 
     role: button
     focused: false
+    parentNodeId: exists
 
 <span aria-hidden="true"></span>
     exists: true
@@ -353,6 +378,7 @@
     ignored: true
     ignoredByDefault: true
     hidden: true
+    parentNodeId: exists
 
 <span></span>
     exists: true
@@ -360,6 +386,7 @@
     role: 
     ignored: true
     ignoredByDefault: true
+    parentNodeId: exists
 
 <div aria-hidden="true"></div>
     exists: true
@@ -368,18 +395,21 @@
     ignored: true
     ignoredByDefault: true
     hidden: true
+    parentNodeId: exists
 
 <div></div>
     exists: true
     label: 
     role: 
     ignored: true
+    parentNodeId: exists
 
 <div role="presentation"><div></div></div>
     exists: true
     label: 
     role: presentation
     ignored: true
+    parentNodeId: exists
 
 <div role="group">
     <!-- FIXME: childNodeIds.length should be 3 (foo, bar, baz). WebCore only reports 1 (foo). http://webkit.org/b/130563 -->
@@ -395,18 +425,21 @@
     label: 
     role: group
     childNodeIds.length: 1
+    parentNodeId: exists
 
 <div><div></div></div>
     exists: true
     label: 
     role: 
     ignored: true
+    parentNodeId: exists
 
 <script style="display:block;"></script>
     exists: true
     label: 
     role: group
     ignored: true
+    parentNodeId: exists
 
 <script></script>
     exists: false

Modified: trunk/LayoutTests/inspector-protocol/dom/getAccessibilityPropertiesForNode.html (166278 => 166279)


--- trunk/LayoutTests/inspector-protocol/dom/getAccessibilityPropertiesForNode.html	2014-03-26 02:37:51 UTC (rev 166278)
+++ trunk/LayoutTests/inspector-protocol/dom/getAccessibilityPropertiesForNode.html	2014-03-26 03:03:39 UTC (rev 166279)
@@ -92,9 +92,9 @@
     <div class="ex" role="tab" aria-selected="false">not selected</div>
 </div>
 
-<ul role="tree" class="ex" id="flowedTo1">
+<ul role="tree" class="ex" id="flowedTo1" aria-activedescendant="activedescendant">
     <li class="ex" role="treeitem" aria-expanded="true">expanded</li>
-    <li class="ex" role="treeitem" aria-expanded="false">collapsed</li>
+    <li class="ex" role="treeitem" aria-expanded="false" id="activedescendant">collapsed</li>
     <li class="ex" role="treeitem" aria-expanded="undefined">expanded</li>
 </ul>
 
@@ -152,13 +152,17 @@
             var value = response.result.properties[key];
             switch (key){
             case "nodeId":
+                continue;
+            case "activeDescendantNodeId":
             case "parentNodeId":
-                continue;
+                if (typeof value === "number")
+                    InspectorTest.log("    " + key + ": exists");
+                break;
             case "childNodeIds":
             case "controlledNodeIds":
             case "flowedNodeIds":
             case "ownedNodeIds":
-                if (value.length)
+                if (typeof value === "object" && value.length)
                     InspectorTest.log("    " + key + ".length: " + value.length);
                 break;
             default:

Modified: trunk/Source/WebCore/ChangeLog (166278 => 166279)


--- trunk/Source/WebCore/ChangeLog	2014-03-26 02:37:51 UTC (rev 166278)
+++ trunk/Source/WebCore/ChangeLog	2014-03-26 03:03:39 UTC (rev 166279)
@@ -1,3 +1,18 @@
+2014-03-25  James Craig  <jcr...@apple.com>
+
+        Web Inspector: AXI: add support for aria-activedescendant and reconcile UI/testing with parentNode
+        https://bugs.webkit.org/show_bug.cgi?id=130712
+
+        Reviewed by Timothy Hatcher.
+
+        Test: inspector-protocol/dom/getAccessibilityPropertiesForNode.html
+
+        Support for @aria-activedescendant; code reuse changes w/ parentNode and activeDescendantNode.
+
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
+        * inspector/protocol/DOM.json:
+
 2014-03-25  Sanghyup Lee  <sh53....@samsung.com>
 
         When the mouse is upped after dragged out of shadowDOM, it should lose :active.

Modified: trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp (166278 => 166279)


--- trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp	2014-03-26 02:37:51 UTC (rev 166278)
+++ trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp	2014-03-26 03:03:39 UTC (rev 166279)
@@ -1424,6 +1424,7 @@
     if (!WebCore::AXObjectCache::accessibilityEnabled())
         WebCore::AXObjectCache::enableAccessibility();
 
+    Node* activeDescendantNode = nullptr;
     TypeBuilder::DOM::AccessibilityProperties::Checked::Enum checked = TypeBuilder::DOM::AccessibilityProperties::Checked::False;
     RefPtr<Inspector::TypeBuilder::Array<int>> childNodeIds;
     RefPtr<Inspector::TypeBuilder::Array<int>> controlledNodeIds;
@@ -1438,7 +1439,7 @@
     bool hidden = false;
     String label; // FIXME: Waiting on http://webkit.org/b/121134
     RefPtr<Inspector::TypeBuilder::Array<int>> ownedNodeIds;
-    Node* parentNode = node;
+    Node* parentNode = nullptr;
     bool pressed = false;
     bool readonly = false;
     bool required = false;
@@ -1453,6 +1454,9 @@
     if (AXObjectCache* axObjectCache = node->document().axObjectCache()) {
         if (AccessibilityObject* axObject = axObjectCache->getOrCreate(node)) {
 
+            if (AccessibilityObject* activeDescendant = axObject->activeDescendant())
+                activeDescendantNode = activeDescendant->node();
+
             supportsChecked = axObject->supportsChecked();
             if (supportsChecked) {
                 int checkValue = axObject->checkboxOrRadioValue(); // Element using aria-checked.
@@ -1556,6 +1560,8 @@
         .setNodeId(pushNodePathToFrontend(node));
 
     if (exists) {
+        if (activeDescendantNode)
+            value->setActiveDescendantNodeId(pushNodePathToFrontend(activeDescendantNode));
         if (supportsChecked)
             value->setChecked(checked);
         if (childNodeIds)
@@ -1580,7 +1586,7 @@
             value->setHidden(hidden);
         if (ownedNodeIds)
             value->setOwnedNodeIds(ownedNodeIds);
-        if (parentNode && parentNode != node)
+        if (parentNode)
             value->setParentNodeId(pushNodePathToFrontend(parentNode));
         if (supportsPressed)
             value->setPressed(pressed);

Modified: trunk/Source/WebCore/inspector/protocol/DOM.json (166278 => 166279)


--- trunk/Source/WebCore/inspector/protocol/DOM.json	2014-03-26 02:37:51 UTC (rev 166278)
+++ trunk/Source/WebCore/inspector/protocol/DOM.json	2014-03-26 03:03:39 UTC (rev 166279)
@@ -60,6 +60,7 @@
             "description": "A structure holding accessibility properties.",
             "type": "object",
             "properties": [
+                { "name": "activeDescendantNodeId", "$ref": "NodeId", "optional": true, "description": "<code>DOMNode</code> id of the accessibility object referenced by aria-activedescendant." },
                 { "name": "checked", "type": "string", "optional": true, "enum": ["true", "false", "mixed"], "description": "Checked state of certain form controls." },
                 { "name": "childNodeIds", "type": "array", "items": { "$ref": "NodeId" }, "optional": true, "description": "Array of <code>DOMNode</code> ids of the accessibility tree children if available." },
                 { "name": "controlledNodeIds", "type": "array", "items": { "$ref": "NodeId" }, "optional": true, "description": "Array of <code>DOMNode</code> ids of any nodes referenced via @aria-controls." },

Modified: trunk/Source/WebInspectorUI/ChangeLog (166278 => 166279)


--- trunk/Source/WebInspectorUI/ChangeLog	2014-03-26 02:37:51 UTC (rev 166278)
+++ trunk/Source/WebInspectorUI/ChangeLog	2014-03-26 03:03:39 UTC (rev 166279)
@@ -1,3 +1,16 @@
+2014-03-25  James Craig  <jcr...@apple.com>
+
+        Web Inspector: AXI: add support for aria-activedescendant and reconcile UI/testing with parentNode
+        https://bugs.webkit.org/show_bug.cgi?id=130712
+
+        Reviewed by Timothy Hatcher.
+
+        Support for @aria-activedescendant; code reuse changes w/ parentNode and activeDescendantNode.
+
+        * Localizations/en.lproj/localizedStrings.js:
+        * UserInterface/Models/DOMNode.js:
+        * UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
+
 2014-03-25  Martin Robinson  <mrobin...@igalia.com>
 
         [GTK] Remove the autotools build

Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (166278 => 166279)


--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js	2014-03-26 02:37:51 UTC (rev 166278)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js	2014-03-26 03:03:39 UTC (rev 166279)
@@ -369,6 +369,7 @@
 localizedStrings["Session Storage"] = "Session Storage";
 localizedStrings["Set to Automatically Continue"] = "Set to Automatically Continue";
 localizedStrings["Shadow Content"] = "Shadow Content";
+localizedStrings["Shared Focus"] = "Shared Focus";
 localizedStrings["Show All"] = "Show All";
 localizedStrings["Show All Nodes (%d More)"] = "Show All Nodes (%d More)";
 localizedStrings["Show compositing borders"] = "Show compositing borders";

Modified: trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js (166278 => 166279)


--- trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js	2014-03-26 02:37:51 UTC (rev 166278)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js	2014-03-26 03:03:39 UTC (rev 166279)
@@ -456,6 +456,7 @@
         {
             if (!error && callback && accessibilityProperties) {
                 callback({
+                    activeDescendantNodeId: accessibilityProperties.activeDescendantNodeId,
                     checked: accessibilityProperties.checked,
                     childNodeIds: accessibilityProperties.childNodeIds,
                     controlledNodeIds: accessibilityProperties.controlledNodeIds,

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DOMNodeDetailsSidebarPanel.js (166278 => 166279)


--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMNodeDetailsSidebarPanel.js	2014-03-26 02:37:51 UTC (rev 166278)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMNodeDetailsSidebarPanel.js	2014-03-26 03:03:39 UTC (rev 166279)
@@ -58,6 +58,7 @@
 
     if (this._accessibilitySupported()) {
         this._accessibilityEmptyRow = new WebInspector.DetailsSectionRow(WebInspector.UIString("No Accessibility Information"));
+        this._accessibilityNodeActiveDescendantRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Shared Focus"));
         this._accessibilityNodeCheckedRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Checked"));
         this._accessibilityNodeChildrenRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Children"));
         this._accessibilityNodeControlsRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Controls"));
@@ -275,6 +276,16 @@
             return "";
         }
 
+        function linkForNodeId(nodeId) {
+            var link = null;
+            if (nodeId !== undefined && typeof nodeId === "number") {
+                var node = WebInspector.domTreeManager.nodeForId(nodeId);
+                if (node)
+                    link = WebInspector.linkifyAccessibilityNodeReference(node);
+            }
+            return link;
+        }
+
         function linkListForNodeIds(nodeIds) {
             var hasLinks = false;
             var linkList = null;
@@ -306,6 +317,8 @@
 
             if (accessibilityProperties && accessibilityProperties.exists) {
 
+                var activeDescendantLink = linkForNodeId(accessibilityProperties.activeDescendantNodeId);
+
                 var checked = "";
                 if (accessibilityProperties.checked !== undefined) {
                     if (accessibilityProperties.checked === DOMAgent.AccessibilityPropertiesChecked.True)
@@ -350,11 +363,7 @@
                 var ownedNodeLinkList = linkListForNodeIds(accessibilityProperties.ownedNodeIds);
 
                 // Accessibility tree parent is not a 1:1 mapping with the DOM tree parent.
-                var parentNodeLink = null;
-                if (accessibilityProperties.parentNodeId !== undefined) {
-                    var parentNode = WebInspector.domTreeManager.nodeForId(accessibilityProperties.parentNodeId);
-                    parentNodeLink = WebInspector.linkifyAccessibilityNodeReference(parentNode);
-                }
+                var parentNodeLink = linkForNodeId(accessibilityProperties.parentNodeId);
 
                 var pressed = booleanValueToLocalizedStringIfPropertyDefined("pressed");
                 var readonly = booleanValueToLocalizedStringIfTrue("readonly");
@@ -373,6 +382,7 @@
                 var selected = booleanValueToLocalizedStringIfTrue("selected");
 
                 // Assign all the properties to their respective views.
+                this._accessibilityNodeActiveDescendantRow.value = activeDescendantLink || "";
                 this._accessibilityNodeCheckedRow.value = checked;
                 this._accessibilityNodeChildrenRow.value = childNodeLinkList || "";
                 this._accessibilityNodeControlsRow.value = controlledNodeLinkList || "";
@@ -399,6 +409,7 @@
                     this._accessibilityNodeLabelRow,
                     this._accessibilityNodeParentRow,
                     this._accessibilityNodeChildrenRow,
+                    this._accessibilityNodeActiveDescendantRow,
                     this._accessibilityNodeOwnsRow,
                     this._accessibilityNodeControlsRow,
                     this._accessibilityNodeFlowsRow,
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to