<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[164332] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/164332">164332</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2014-02-18 16:45:07 -0800 (Tue, 18 Feb 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Web Inspector: AX: more properties: exists, required, and invalid (exists was previously combined with ignored)
https://bugs.webkit.org/show_bug.cgi?id=128504
Patch by James Craig <jcraig@apple.com> on 2014-02-18
Reviewed by Timothy Hatcher.
Source/WebCore:
Additions to the accessibility node inspector: exists, required, invalid.
Test: inspector-protocol/dom/getAccessibilityPropertiesForNode.html
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
* inspector/protocol/DOM.json:
Source/WebInspectorUI:
Additions to the accessibility node inspector: exists, required, invalid.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/DOMNode.js:
* UserInterface/DOMNodeDetailsSidebarPanel.js:
LayoutTests:
New files test the inspector protocol for DOM.getAccessibilityPropertiesForNode
* inspector-protocol/dom/getAccessibilityPropertiesForNode-expected.txt: Added.
* inspector-protocol/dom/getAccessibilityPropertiesForNode.html: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorDOMAgentcpp">trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorprotocolDOMjson">trunk/Source/WebCore/inspector/protocol/DOM.json</a></li>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs">trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDOMNodejs">trunk/Source/WebInspectorUI/UserInterface/DOMNode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDOMNodeDetailsSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/DOMNodeDetailsSidebarPanel.js</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsinspectorprotocoldomgetAccessibilityPropertiesForNodeexpectedtxt">trunk/LayoutTests/inspector-protocol/dom/getAccessibilityPropertiesForNode-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectorprotocoldomgetAccessibilityPropertiesForNodehtml">trunk/LayoutTests/inspector-protocol/dom/getAccessibilityPropertiesForNode.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (164331 => 164332)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-02-19 00:43:35 UTC (rev 164331)
+++ trunk/LayoutTests/ChangeLog        2014-02-19 00:45:07 UTC (rev 164332)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2014-02-18 James Craig <jcraig@apple.com>
+
+ Web Inspector: AX: more properties: exists, required, and invalid (exists was previously combined with ignored)
+ https://bugs.webkit.org/show_bug.cgi?id=128504
+
+ Reviewed by Timothy Hatcher.
+
+ New files test the inspector protocol for DOM.getAccessibilityPropertiesForNode
+
+ * inspector-protocol/dom/getAccessibilityPropertiesForNode-expected.txt: Added.
+ * inspector-protocol/dom/getAccessibilityPropertiesForNode.html: Added.
+
</ins><span class="cx"> 2014-02-18 Viatcheslav Ostapenko <sl.ostapenko@samsung.com>
</span><span class="cx">
</span><span class="cx"> Bottom/right sticky positioning don't correctly handle scroll containers with padding
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorprotocoldomgetAccessibilityPropertiesForNodeexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector-protocol/dom/getAccessibilityPropertiesForNode-expected.txt (0 => 164332)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector-protocol/dom/getAccessibilityPropertiesForNode-expected.txt         (rev 0)
+++ trunk/LayoutTests/inspector-protocol/dom/getAccessibilityPropertiesForNode-expected.txt        2014-02-19 00:45:07 UTC (rev 164332)
</span><span class="lines">@@ -0,0 +1,94 @@
</span><ins>+Checking Web Inspector protocol for the Accessibility Node Inspector.
+
+
+Total elements to be tested: 15.
+
+<img src="./404.gif" alt="x">
+ exists: true
+ label:
+ role: img
+
+<img src="./404.gif" alt="">
+ exists: true
+ label:
+ role: img
+ ignored: true
+
+<img src="./404.gif">
+ exists: true
+ label:
+ role: img
+ ignored: true
+
+<input aria-invalid="fake-value-will-eval-to-true">
+ exists: true
+ label:
+ role:
+ invalid: true
+ required: false
+
+<input aria-invalid="spelling">
+ exists: true
+ label:
+ role:
+ invalid: spelling
+ required: false
+
+<input aria-required="true">
+ exists: true
+ label:
+ role:
+ required: true
+
+<input required="">
+ exists: true
+ label:
+ role:
+ required: true
+
+<input type="button">
+ exists: true
+ label:
+ role: button
+
+<button></button>
+ exists: true
+ label:
+ role: button
+
+<div role="button" tabindex="0"></div>
+ exists: true
+ label:
+ role: button
+
+<span></span>
+ exists: true
+ label:
+ role:
+ ignored: true
+
+<div></div>
+ exists: true
+ label:
+ role:
+ ignored: true
+
+<div role="presentation"><div></div></div>
+ exists: true
+ label:
+ role: presentation
+ ignored: true
+
+<div><div></div></div>
+ exists: true
+ label:
+ role:
+ ignored: true
+
+<script></script>
+ exists: false
+ label:
+ role:
+
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectorprotocoldomgetAccessibilityPropertiesForNodehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector-protocol/dom/getAccessibilityPropertiesForNode.html (0 => 164332)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector-protocol/dom/getAccessibilityPropertiesForNode.html         (rev 0)
+++ trunk/LayoutTests/inspector-protocol/dom/getAccessibilityPropertiesForNode.html        2014-02-19 00:45:07 UTC (rev 164332)
</span><span class="lines">@@ -0,0 +1,90 @@
</span><ins>+<html>
+<head>
+<script type="text/javascript" src="../../http/tests/inspector-protocol/resources/protocol-test.js"></script>
+</head>
+<body onLoad="runTest()">
+
+<p>Checking Web Inspector protocol for the Accessibility Node Inspector.</p>
+
+<!-- This one is never rendered, so "exists" should return false. -->
+<script class="ex"></script>
+
+<!-- The rest are rendered with various property differences. -->
+<div class="ex"><div></div></div>
+<div class="ex" role="presentation"><div></div></div>
+<div class="ex"></div>
+<span class="ex"></span>
+
+<div class="ex" role="button" tabindex="0"></div>
+<button class="ex"></button>
+<input class="ex" type="button">
+
+<input class="ex" required>
+<input class="ex" aria-required="true">
+<input class="ex" aria-invalid="spelling">
+<input class="ex" aria-invalid="fake-value-will-eval-to-true">
+
+<img class="ex" src="./404.gif">
+<img class="ex" src="./404.gif" alt="">
+<img class="ex" src="./404.gif" alt="x">
+
+<script type="text/javascript">
+
+function $(selector) {
+ return document.querySelectorAll(selector);
+}
+function cleanup() {
+ var examples = $(".ex");
+ for (el in examples)
+ el.style.display = "none";
+}
+
+function test() {
+
+ var examples = [];
+
+ function loop() {
+ if (examples.length) {
+ InspectorTest.sendCommand("DOM.getOuterHTML", {"nodeId": examples[examples.length-1]}, onGotOuterHTML);
+ } else {
+ InspectorTest.log("\n");
+ InspectorTest.sendCommand("Runtime.evaluate", {"expression": "cleanup()"}, function(){
+ InspectorTest.completeTest();
+ });
+ }
+ };
+
+ function onGotDocument(response) {
+ InspectorTest.checkForError(response);
+ InspectorTest.sendCommand("DOM.querySelectorAll", {"nodeId": response.result.root.nodeId, "selector": ".ex"}, onQuerySelectorAll);
+ }
+
+ function onQuerySelectorAll(response) {
+ InspectorTest.checkForError(response);
+ examples = response.result.nodeIds;
+ InspectorTest.log("Total elements to be tested: " + examples.length + ".");
+ loop();
+ }
+
+ function onGotOuterHTML(response) {
+ InspectorTest.checkForError(response);
+ InspectorTest.log("\n" + response.result.outerHTML.replace(" class=\"ex\"", ""));
+ InspectorTest.sendCommand("DOM.getAccessibilityPropertiesForNode", {"nodeId": examples[examples.length-1]}, onGotAXProps);
+ }
+
+ function onGotAXProps(response) {
+ InspectorTest.checkForError(response);
+ for (prop in response.result.properties) {
+ if (prop !== "nodeId")
+ InspectorTest.log(" " + prop + ": " + response.result.properties[prop]);
+ }
+ examples.pop();
+ loop();
+ }
+
+ InspectorTest.sendCommand("DOM.getDocument", {}, onGotDocument);
+
+}
+</script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (164331 => 164332)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-02-19 00:43:35 UTC (rev 164331)
+++ trunk/Source/WebCore/ChangeLog        2014-02-19 00:45:07 UTC (rev 164332)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2014-02-18 James Craig <jcraig@apple.com>
+
+ Web Inspector: AX: more properties: exists, required, and invalid (exists was previously combined with ignored)
+ https://bugs.webkit.org/show_bug.cgi?id=128504
+
+ Reviewed by Timothy Hatcher.
+
+ Additions to the accessibility node inspector: exists, required, invalid.
+
+ Test: inspector-protocol/dom/getAccessibilityPropertiesForNode.html
+
+ * inspector/InspectorDOMAgent.cpp:
+ (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
+ * inspector/protocol/DOM.json:
+
</ins><span class="cx"> 2014-02-18 Ryosuke Niwa <rniwa@webkit.org>
</span><span class="cx">
</span><span class="cx"> Commit the code change supposed to happen in r164320.
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorDOMAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp (164331 => 164332)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp        2014-02-19 00:43:35 UTC (rev 164331)
+++ trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp        2014-02-19 00:45:07 UTC (rev 164332)
</span><span class="lines">@@ -1414,28 +1414,41 @@
</span><span class="cx"> if (!WebCore::AXObjectCache::accessibilityEnabled())
</span><span class="cx"> WebCore::AXObjectCache::enableAccessibility();
</span><span class="cx">
</span><ins>+ bool exists = false;
</ins><span class="cx"> bool ignored = true;
</span><del>-
- // Computed ARIA Role
</del><ins>+ String invalid = "false"; // String values: true, false, spelling, grammar, etc.
+ String label; // FIXME: Waiting on http://webkit.org/b/121134
+ bool required = false;
</ins><span class="cx"> String role;
</span><ins>+ bool supportsRequired = false;
</ins><span class="cx">
</span><del>- // Computed Label
- // FIXME: Waiting on http://webkit.org/b/121134
- String label;
-
</del><span class="cx"> if (AXObjectCache* axObjectCache = node->document().axObjectCache()) {
</span><span class="cx"> if (AccessibilityObject* axObject = axObjectCache->getOrCreate(node)) {
</span><ins>+ exists = true;
</ins><span class="cx"> ignored = axObject->accessibilityIsIgnored();
</span><ins>+ invalid = axObject->invalidStatus();
</ins><span class="cx"> role = axObject->computedRoleString();
</span><ins>+ supportsRequired = axObject->supportsRequiredAttribute();
+ if (supportsRequired)
+ required = axObject->isRequired();
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RefPtr<Inspector::TypeBuilder::DOM::AccessibilityProperties> value = Inspector::TypeBuilder::DOM::AccessibilityProperties::create()
</span><del>- .setIgnored(ignored)
</del><ins>+ .setExists(exists)
+ .setLabel(label)
</ins><span class="cx"> .setRole(role)
</span><del>- .setLabel(label)
</del><span class="cx"> .setNodeId(pushNodePathToFrontend(node));
</span><span class="cx">
</span><ins>+ if (exists) {
+ if (ignored)
+ value->setIgnored(ignored);
+ if (invalid != "false")
+ value->setInvalid(invalid);
+ if (supportsRequired)
+ value->setRequired(required);
+ }
+
</ins><span class="cx"> return value.release();
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorprotocolDOMjson"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/protocol/DOM.json (164331 => 164332)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/protocol/DOM.json        2014-02-19 00:43:35 UTC (rev 164331)
+++ trunk/Source/WebCore/inspector/protocol/DOM.json        2014-02-19 00:45:07 UTC (rev 164332)
</span><span class="lines">@@ -59,9 +59,12 @@
</span><span class="cx"> "description": "A structure holding accessibility properties.",
</span><span class="cx"> "type": "object",
</span><span class="cx"> "properties": [
</span><del>- { "name": "ignored", "type": "boolean", "description": "Returns whether the accessibility of the DOM node is ignored, whether heuristically or explicitly." },
</del><ins>+ { "name": "exists", "type": "boolean", "description": "Returns whether there is an existing AX object for the DOM node. If this is false, all the other properties will be default values." },
+ { "name": "ignored", "type": "boolean", "optional": true, "description": "Returns whether the accessibility of the associated AX object node is ignored, whether heuristically or explicitly." },
+ { "name": "invalid", "type": "string", "optional": true, "description": "Returns the invalid status for form fields: true, false, grammar, spelling." },
+ { "name": "label", "type": "string", "description": "Computed label value for the node, sometimes calculated by referencing other nodes." },
+ { "name": "required", "type": "boolean", "optional": true, "description": "Returns whether the element is required or not required." },
</ins><span class="cx"> { "name": "role", "type": "string", "description": "Computed value for first recognized role token, default role per element, or overridden role." },
</span><del>- { "name": "label", "type": "string", "description": "Computed label value for the node, sometimes calculated by referencing other nodes." },
</del><span class="cx"> { "name": "nodeId", "$ref": "NodeId", "description": "Target <code>DOMNode</code> id." }
</span><span class="cx"> ]
</span><span class="cx"> },
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (164331 => 164332)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2014-02-19 00:43:35 UTC (rev 164331)
+++ trunk/Source/WebInspectorUI/ChangeLog        2014-02-19 00:45:07 UTC (rev 164332)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2014-02-18 James Craig <jcraig@apple.com>
+
+ Web Inspector: AX: more properties: exists, required, and invalid (exists was previously combined with ignored)
+ https://bugs.webkit.org/show_bug.cgi?id=128504
+
+ Reviewed by Timothy Hatcher.
+
+ Additions to the accessibility node inspector: exists, required, invalid.
+
+ * Localizations/en.lproj/localizedStrings.js:
+ * UserInterface/DOMNode.js:
+ * UserInterface/DOMNodeDetailsSidebarPanel.js:
+
</ins><span class="cx"> 2014-02-18 Antoine Quint <graouts@webkit.org>
</span><span class="cx">
</span><span class="cx"> Web Inspector: editing a color in the Styles sidebar using the color picker only works once for a given color
</span></span></pre></div>
<a id="trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (164331 => 164332)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2014-02-19 00:43:35 UTC (rev 164331)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2014-02-19 00:45:07 UTC (rev 164332)
</span><span class="lines">@@ -206,11 +206,13 @@
</span><span class="cx">