Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Web Inspector: AXI: add support for aria-activedescendant and reconci…
…le UI/testing with parentNode

https://bugs.webkit.org/show_bug.cgi?id=130712

Patch by James Craig <jcraig@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:

Canonical link: https://commits.webkit.org/148801@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@166279 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
cookiecrook authored and webkit-commit-queue committed Mar 26, 2014
1 parent cdfd403 commit fc237ca
Show file tree
Hide file tree
Showing 10 changed files with 110 additions and 14 deletions.
12 changes: 12 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
2014-03-25 James Craig <jcraig@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.lee@samsung.com>

When the mouse is upped after dragged out of shadowDOM, it should lose :active.
Expand Down
Expand Up @@ -7,40 +7,47 @@ Total elements to be tested: 57.
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
label:
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">
Expand All @@ -52,16 +59,19 @@ Total elements to be tested: 57.
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">
Expand All @@ -72,6 +82,7 @@ Total elements to be tested: 57.
label:
role: listbox
childNodeIds.length: 2
parentNodeId: exists
required: false

<input role="combobox" aria-owns="ownedlistbox invalidIdRef" aria-controls="ownedlistbox invalidIdRef">
Expand Down Expand Up @@ -148,27 +159,31 @@ Total elements to be tested: 57.
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>
exists: true
label:
role: radio
checked: false
parentNodeId: exists
required: false

<div role="radio" aria-checked="true">checked</div>
exists: true
label:
role: radio
checked: true
parentNodeId: exists
required: false

<div role="radio">unchecked (checked undefined evals to false on radio)</div>
exists: true
label:
role: radio
checked: false
parentNodeId: exists
required: false

<input type="radio" checked="">
Expand All @@ -192,27 +207,31 @@ Total elements to be tested: 57.
label:
role: checkbox
checked: false
parentNodeId: exists
required: false

<div role="checkbox" aria-checked="mixed">mixed</div>
exists: true
label:
role: checkbox
checked: mixed
parentNodeId: exists
required: false

<div role="checkbox" aria-checked="true">checked</div>
exists: true
label:
role: checkbox
checked: true
parentNodeId: exists
required: false

<div role="checkbox">unchecked (checked undefined evals to false on checkbox)</div>
exists: true
label:
role: checkbox
checked: false
parentNodeId: exists
required: false

<input type="checkbox" checked="">
Expand All @@ -237,6 +256,7 @@ Total elements to be tested: 57.
role:
disabled: true
focused: false
parentNodeId: exists
readonly: true
required: false

Expand All @@ -253,6 +273,7 @@ Total elements to be tested: 57.
label:
role:
focused: false
parentNodeId: exists
readonly: true
required: false

Expand Down Expand Up @@ -322,6 +343,7 @@ Total elements to be tested: 57.
label:
role:
focused: false
parentNodeId: exists
pressed: false
required: false

Expand All @@ -330,6 +352,7 @@ Total elements to be tested: 57.
label:
role:
focused: false
parentNodeId: exists
pressed: false
required: false

Expand All @@ -339,12 +362,14 @@ Total elements to be tested: 57.
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
Expand All @@ -353,13 +378,15 @@ Total elements to be tested: 57.
ignored: true
ignoredByDefault: true
hidden: true
parentNodeId: exists

<span></span>
exists: true
label:
role:
ignored: true
ignoredByDefault: true
parentNodeId: exists

<div aria-hidden="true"></div>
exists: true
Expand All @@ -368,18 +395,21 @@ Total elements to be tested: 57.
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 -->
Expand All @@ -395,18 +425,21 @@ Total elements to be tested: 57.
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
Expand Down
Expand Up @@ -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>

Expand Down Expand Up @@ -152,13 +152,17 @@
var value = response.result.properties[key];
switch (key){
case "nodeId":
case "parentNodeId":
continue;
case "activeDescendantNodeId":
case "parentNodeId":
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:
Expand Down
15 changes: 15 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,18 @@
2014-03-25 James Craig <jcraig@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.lee@samsung.com>

When the mouse is upped after dragged out of shadowDOM, it should lose :active.
Expand Down
10 changes: 8 additions & 2 deletions Source/WebCore/inspector/InspectorDOMAgent.cpp
Expand Up @@ -1424,6 +1424,7 @@ PassRefPtr<TypeBuilder::DOM::AccessibilityProperties> InspectorDOMAgent::buildOb
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;
Expand All @@ -1438,7 +1439,7 @@ PassRefPtr<TypeBuilder::DOM::AccessibilityProperties> InspectorDOMAgent::buildOb
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;
Expand All @@ -1453,6 +1454,9 @@ PassRefPtr<TypeBuilder::DOM::AccessibilityProperties> InspectorDOMAgent::buildOb
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.
Expand Down Expand Up @@ -1556,6 +1560,8 @@ PassRefPtr<TypeBuilder::DOM::AccessibilityProperties> InspectorDOMAgent::buildOb
.setNodeId(pushNodePathToFrontend(node));

if (exists) {
if (activeDescendantNode)
value->setActiveDescendantNodeId(pushNodePathToFrontend(activeDescendantNode));
if (supportsChecked)
value->setChecked(checked);
if (childNodeIds)
Expand All @@ -1580,7 +1586,7 @@ PassRefPtr<TypeBuilder::DOM::AccessibilityProperties> InspectorDOMAgent::buildOb
value->setHidden(hidden);
if (ownedNodeIds)
value->setOwnedNodeIds(ownedNodeIds);
if (parentNode && parentNode != node)
if (parentNode)
value->setParentNodeId(pushNodePathToFrontend(parentNode));
if (supportsPressed)
value->setPressed(pressed);
Expand Down
1 change: 1 addition & 0 deletions Source/WebCore/inspector/protocol/DOM.json
Expand Up @@ -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." },
Expand Down
13 changes: 13 additions & 0 deletions Source/WebInspectorUI/ChangeLog
@@ -1,3 +1,16 @@
2014-03-25 James Craig <jcraig@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 <mrobinson@igalia.com>

[GTK] Remove the autotools build
Expand Down
Binary file modified Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
Binary file not shown.
1 change: 1 addition & 0 deletions Source/WebInspectorUI/UserInterface/Models/DOMNode.js
Expand Up @@ -456,6 +456,7 @@ WebInspector.DOMNode.prototype = {
{
if (!error && callback && accessibilityProperties) {
callback({
activeDescendantNodeId: accessibilityProperties.activeDescendantNodeId,
checked: accessibilityProperties.checked,
childNodeIds: accessibilityProperties.childNodeIds,
controlledNodeIds: accessibilityProperties.controlledNodeIds,
Expand Down

0 comments on commit fc237ca

Please sign in to comment.