<!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>[163891] 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/163891">163891</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2014-02-11 11:27:12 -0800 (Tue, 11 Feb 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Web Inspector: AX: Accessibility Node Inspection
https://bugs.webkit.org/show_bug.cgi?id=127447
Patch by James Craig <jcraig@apple.com> on 2014-02-11
Reviewed by Timothy Hatcher.
Source/WebCore:
New methods supporting WebCore::AccessibilityObject::computedRoleString()
used for Accessibility section in WebInspector Node Inspector. Other updates
support the JSON interface for the WebInspectorUI feature.
Test: accessibility/roles-computedRoleString.html
* accessibility/AccessibilityObject.cpp:
(WebCore::initializeRoleMap):
(WebCore::ariaRoleMap):
(WebCore::reverseAriaRoleMap):
(WebCore::AccessibilityObject::ariaRoleToWebCoreRole):
(WebCore::AccessibilityObject::computedRoleString):
* accessibility/AccessibilityObject.h:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper computedRoleString]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::getAccessibilityPropertiesForNode):
(WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
* inspector/InspectorDOMAgent.h:
* inspector/protocol/DOM.json:
Source/WebInspectorUI:
New Accessibility section in WebInspector Node Inspector.
Version 1.0 only shows computed role. Computed label should come soon.
Removed CSS fixed table layout b/c CSS bug: http://webkit.org/b/128294
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/DOMNode.js:
* UserInterface/DOMNodeDetailsSidebarPanel.js:
* UserInterface/DetailsSection.css:
* UserInterface/InspectorWebBackendCommands.js:
Tools:
New computedRoleString interfaces in DumpRenderTree/WebKitTestRunner
to support LayoutTest coverage of AccessibilityObject::computedRoleString()
* DumpRenderTree/AccessibilityUIElement.cpp:
* DumpRenderTree/AccessibilityUIElement.h:
* DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:
* DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
* DumpRenderTree/win/AccessibilityUIElementWin.cpp:
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
LayoutTests:
New layout verifying AccessibilityObject::computedRoleString()
* accessibility/roles-computedRoleString-expected.txt: Added.
* accessibility/roles-computedRoleString.html: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformgtkTestExpectations">trunk/LayoutTests/platform/gtk/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityObject.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityObjecth">trunk/Source/WebCore/accessibility/AccessibilityObject.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilitymacWebAccessibilityObjectWrapperMacmm">trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorDOMAgentcpp">trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorDOMAgenth">trunk/Source/WebCore/inspector/InspectorDOMAgent.h</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>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDetailsSectioncss">trunk/Source/WebInspectorUI/UserInterface/DetailsSection.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceInspectorWebBackendCommandsjs">trunk/Source/WebInspectorUI/UserInterface/InspectorWebBackendCommands.js</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsDumpRenderTreeAccessibilityUIElementcpp">trunk/Tools/DumpRenderTree/AccessibilityUIElement.cpp</a></li>
<li><a href="#trunkToolsDumpRenderTreeAccessibilityUIElementh">trunk/Tools/DumpRenderTree/AccessibilityUIElement.h</a></li>
<li><a href="#trunkToolsDumpRenderTreeatkAccessibilityUIElementAtkcpp">trunk/Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp</a></li>
<li><a href="#trunkToolsDumpRenderTreeiosAccessibilityUIElementIOSmm">trunk/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm</a></li>
<li><a href="#trunkToolsDumpRenderTreemacAccessibilityUIElementMacmm">trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm</a></li>
<li><a href="#trunkToolsDumpRenderTreewinAccessibilityUIElementWincpp">trunk/Tools/DumpRenderTree/win/AccessibilityUIElementWin.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleAccessibilityUIElementcpp">trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleAccessibilityUIElementh">trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleBindingsAccessibilityUIElementidl">trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleatkAccessibilityUIElementAtkcpp">trunk/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleiosAccessibilityUIElementIOSmm">trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundlemacAccessibilityUIElementMacmm">trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsaccessibilityrolescomputedRoleStringexpectedtxt">trunk/LayoutTests/accessibility/roles-computedRoleString-expected.txt</a></li>
<li><a href="#trunkLayoutTestsaccessibilityrolescomputedRoleStringhtml">trunk/LayoutTests/accessibility/roles-computedRoleString.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (163890 => 163891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-02-11 18:59:17 UTC (rev 163890)
+++ trunk/LayoutTests/ChangeLog        2014-02-11 19:27:12 UTC (rev 163891)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2014-02-11 James Craig <jcraig@apple.com>
+
+ Web Inspector: AX: Accessibility Node Inspection
+ https://bugs.webkit.org/show_bug.cgi?id=127447
+
+ Reviewed by Timothy Hatcher.
+
+ New layout verifying AccessibilityObject::computedRoleString()
+
+ * accessibility/roles-computedRoleString-expected.txt: Added.
+ * accessibility/roles-computedRoleString.html: Added.
+
</ins><span class="cx"> 2014-02-10 Oliver Hunt <oliver@apple.com>
</span><span class="cx">
</span><span class="cx"> Stop throwing when attempting to read instance properties directly from the prototype
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilityrolescomputedRoleStringexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/accessibility/roles-computedRoleString-expected.txt (0 => 163891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/roles-computedRoleString-expected.txt         (rev 0)
+++ trunk/LayoutTests/accessibility/roles-computedRoleString-expected.txt        2014-02-11 19:27:12 UTC (rev 163891)
</span><span class="lines">@@ -0,0 +1,169 @@
</span><ins>+ X
+This tests that native elements and ARIA overrides result in the same ARIA computed role, regardless of platform.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS: a[href] -> link.
+PASS: article -> article.
+PASS: aside -> complementary.
+PASS: button -> button.
+PASS: dfn -> definition.
+PASS: dl -> .
+PASS: footer -> .
+PASS: form -> .
+PASS: header -> banner.
+PASS: h1 -> heading.
+PASS: h2 -> heading.
+PASS: h3 -> heading.
+PASS: h4 -> heading.
+PASS: h5 -> heading.
+PASS: h5 -> heading.
+PASS: img[alt='X'] -> img.
+PASS: input[type='button'] -> button.
+PASS: input[type='checkbox'] -> checkbox.
+PASS: input[type='date'] -> .
+PASS: input[type='datetime'] -> .
+PASS: input[type='datetime-local'] -> .
+PASS: input[type='email'] -> .
+PASS: input[type='file'] -> button.
+PASS: input[type='image'] -> button.
+PASS: input[type='month'] -> .
+PASS: input[type='number'] -> .
+PASS: input[type='password'] -> .
+PASS: input[type='radio'] -> radio.
+PASS: input[type='range'] -> slider.
+PASS: input[type='reset'] -> button.
+PASS: input[type='search'] -> .
+PASS: input[type='submit'] -> button.
+PASS: input[type='tel'] -> .
+PASS: input[type='text'] -> .
+PASS: input[type='time'] -> .
+PASS: input[type='url'] -> .
+PASS: input[type='week'] -> .
+PASS: math -> math.
+PASS: meter -> progressbar.
+PASS: nav -> navigation.
+PASS: ol -> list.
+PASS: li -> listitem.
+PASS: p -> .
+PASS: pre -> group.
+PASS: progress -> progressbar.
+PASS: section -> region.
+PASS: select:not([multiple]) -> .
+PASS: select[multiple] -> listbox.
+PASS: option -> option.
+PASS: optgroup -> option.
+PASS: option -> option.
+PASS: option -> option.
+PASS: table -> grid.
+PASS: tr -> row.
+PASS: th -> gridcell.
+PASS: tr -> row.
+PASS: td -> gridcell.
+PASS: tr -> row.
+PASS: td -> gridcell.
+PASS: textarea -> textbox.
+PASS: ul -> list.
+PASS: li -> listitem.
+PASS: div[role="command"] -> .
+PASS: div[role="composite"] -> .
+PASS: div[role="input"] -> .
+PASS: div[role="landmark"] -> .
+PASS: div[role="range"] -> .
+PASS: div[role="roletype"] -> .
+PASS: div[role="section"] -> .
+PASS: div[role="sectionhead"] -> .
+PASS: div[role="select"] -> .
+PASS: div[role="structure"] -> .
+PASS: div[role="widget"] -> .
+PASS: div[role="window"] -> .
+PASS: div[role="alert"] -> alert.
+PASS: div[role="alertdialog"] -> alertdialog.
+PASS: div[role="application"] -> application.
+PASS: div[role="article"] -> article.
+PASS: div[role="banner"] -> banner.
+PASS: div[role="button"] -> button.
+PASS: div[role="checkbox"] -> checkbox.
+PASS: div[role="combobox"] -> combobox.
+PASS: div[role="complementary"] -> complementary.
+PASS: div[role="contentinfo"] -> contentinfo.
+PASS: div[role="definition"] -> definition.
+PASS: div[role="dialog"] -> dialog.
+PASS: div[role="directory"] -> list.
+PASS: div[role="document"] -> document.
+PASS: div[role="form"] -> .
+PASS: div[role="grid"] -> grid.
+PASS: div[role="row"] -> row.
+PASS: div[role="rowheader"] -> gridcell.
+PASS: div[role="columnheader"] -> gridcell.
+PASS: div[role="gridcell"] -> gridcell.
+PASS: div[role="group"] -> group.
+PASS: div[role="heading"] -> heading.
+PASS: div[role="img"] -> img.
+PASS: div[role="link"] -> link.
+PASS: div[role="list"] -> list.
+PASS: div[role="listitem"] -> listitem.
+PASS: div[role="listbox"] -> listbox.
+PASS: div[role="option"] -> option.
+PASS: div[role="log"] -> log.
+PASS: div[role="main"] -> main.
+PASS: div[role="marquee"] -> marquee.
+PASS: div[role="math"] -> math.
+PASS: div[role="menu"] -> menu.
+PASS: div[role="menuitem"] -> menuitem.
+PASS: div[role="menuitemcheckbox"] -> menuitemcheckbox.
+PASS: div[role="menuitemradio"] -> menuitemradio.
+PASS: div[role="menubar"] -> menubar.
+PASS: div[role="menuitem"] -> menuitem.
+PASS: div[role="menuitemcheckbox"] -> menuitemcheckbox.
+PASS: div[role="menuitemradio"] -> menuitemradio.
+PASS: div[role="navigation"] -> navigation.
+PASS: div[role="note"] -> note.
+PASS: div[role="progressbar"] -> progressbar.
+PASS: div[role="radiogroup"] -> radiogroup.
+PASS: div[role="radio"] -> radio.
+PASS: div[role="region"] -> region.
+PASS: div[role="scrollbar"] -> scrollbar.
+PASS: div[role="search"] -> search.
+PASS: div[role="separator"] -> separator.
+PASS: div[role="slider"] -> slider.
+PASS: div[role="spinbutton"] -> spinbutton.
+PASS: div[role="status"] -> status.
+PASS: div[role="tablist"] -> tablist.
+PASS: div[role="tab"] -> tab.
+PASS: div[role="tabpanel"] -> tabpanel.
+PASS: div[role="textbox"] -> .
+PASS: div[role="timer"] -> timer.
+PASS: div[role="toolbar"] -> toolbar.
+PASS: div[role="tooltip"] -> tooltip.
+PASS: div[role="tree"] -> tree.
+PASS: div[role="treeitem"] -> treeitem.
+PASS: div[role="treeitem"] -> treeitem.
+PASS: div[role="treegrid"] -> grid.
+PASS: div[role="row"] -> row.
+PASS: div[role="rowheader"] -> gridcell.
+PASS: div[role="columnheader"] -> gridcell.
+PASS: div[role="gridcell"] -> gridcell.
+PASS: div[role="button foo"] -> button.
+PASS: div[role="foo button bar"] -> button.
+PASS: div[role="foo button bar"] -> button.
+PASS: div[role="foo        button        bar"] -> .
+PASS: div[role="foo
+button
+bar"] -> .
+PASS: img[role="foo"] -> img.
+PASS: img[role="foo bar"] -> img.
+PASS: img[role="foo bar"] -> img.
+PASS: img[role="foo        bar"] -> img.
+PASS: img[role="foo        
+bar"] -> img.
+PASS: img[role="text"] -> text.
+PASS: img[role="text img"] -> text.
+PASS: img[role="img text"] -> img.
+PASS: img[role="presentation"][aria-label] -> img.
+PASS: a[role="foo bar"] -> link.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsaccessibilityrolescomputedRoleStringhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/accessibility/roles-computedRoleString.html (0 => 163891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/roles-computedRoleString.html         (rev 0)
+++ trunk/LayoutTests/accessibility/roles-computedRoleString.html        2014-02-11 19:27:12 UTC (rev 163891)
</span><span class="lines">@@ -0,0 +1,311 @@
</span><ins>+<!DOCTYPE HTML>
+<html>
+<body>
+<script src="../resources/js-test-pre.js"></script>
+
+<!-- ==================================================================================================== -->
+<!-- HTML elements in alphabetical order, excepting the need for nesting (e.g. <li> is with its <ol> and <ul> parents) -->
+<!-- This only tests elements that have an exact 1:1 ARIA role mapping, and computed role overrides. -->
+<!-- ==================================================================================================== -->
+<a data-role="link" href="#" data-note="[href]" class="ex">X</a>
+<article data-role="article" class="ex">X</article>
+<aside data-role="complementary" class="ex">X</aside>
+<button data-role="button" class="ex">X</button>
+<dfn data-role="definition" class="ex">X</dfn>
+<dl data-role="" class="ex">
+ <dt>X</dt>
+ <dd>X</dd>
+</dl>
+<footer data-role="" class="ex">X</footer>
+<form data-role="" class="ex">X</form><!-- FIXME: should be form -->
+<header data-role="banner" class="ex">X</header>
+<h1 data-role="heading" class="ex">X</h1>
+<h2 data-role="heading" class="ex">X</h2>
+<h3 data-role="heading" class="ex">X</h3>
+<h4 data-role="heading" class="ex">X</h4>
+<h5 data-role="heading" class="ex">X</h5>
+<h5 data-role="heading" class="ex">X</h6>
+<hr data-role="separator" class="ex">
+<img data-role="img" class="ex" data-note=":not([src]):not([alt])">
+<img data-role="" class="ex" alt="" data-note="[alt='']">
+<img data-role="img" class="ex" src="foo.png" data-note="[src]:not([alt])">
+<img data-role="img" class="ex" alt="X" data-note="[alt='X']">
+<input type="button" value="X" data-role="button" class="ex" data-note="[type='button']">
+<input type="checkbox" data-role="checkbox" class="ex" data-note="[type='checkbox']">
+<input type="date" data-role=""class="ex" data-note="[type='date']">
+<input type="datetime" value="X" data-role="" class="ex" data-note="[type='datetime']">
+<input type="datetime-local" value="X" data-role="" class="ex" data-note="[type='datetime-local']">
+<input type="email" value="X" data-role="" class="ex" data-note="[type='email']">
+<input type="file" data-role="button" class="ex" data-note="[type='file']">
+<input type="hidden" data-role="" class="ex" data-note="[type='hidden']">
+<input type="image" data-role="button" class="ex" data-note="[type='image']">
+<input type="month" value="X" data-role="" class="ex" data-note="[type='month']">
+<input type="number" value="X" data-role="" class="ex" data-note="[type='number']">
+<input type="password" value="X" data-role="" class="ex" data-note="[type='password']">
+<input type="radio" data-role="radio" class="ex" data-note="[type='radio']">
+<input type="range" data-role="slider" class="ex" data-note="[type='range']">
+<input type="reset" data-role="button" class="ex" data-note="[type='reset']">
+<input type="search" value="X" data-role="" class="ex" data-note="[type='search']">
+<input type="submit" data-role="button" class="ex" data-note="[type='submit']">
+<input type="tel" value="X" data-role="" class="ex" data-note="[type='tel']">
+<input type="text" value="X" data-role="" class="ex" data-note="[type='text']">
+<input type="time" value="X" data-role="" class="ex" data-note="[type='time']">
+<input type="url" value="X" data-role="" class="ex" data-note="[type='url']">
+<input type="week" value="X" data-role="" class="ex" data-note="[type='week']">
+<ins data-role="" class="ex">X</ins>
+<mark data-role="" class="ex">X</mark>
+<math data-role="math" class="ex">X</math>
+<!-- skipped <menu> -->
+<!-- skipped <meta> -->
+<meter data-role="progressbar" class="ex" value="0.75">X</meter>
+<nav data-role="navigation" class="ex">X</nav>
+<!-- skipped <noscript> -->
+<!-- skipped <object> -->
+<ol data-role="list" class="ex">
+ <li data-role="listitem" class="ex">X</li>
+</ol>
+<!-- skipped <optgroup> -->
+<!-- skipped <option> -->
+<!-- skipped <output> -->
+<p data-role="" class="ex">X</p>
+<!-- skipped <param> -->
+<pre data-role="group" class="ex">X</pre>
+<progress data-role="progressbar" class="ex" value="0.75">X</progress>
+<q data-role="" class="ex">X</q>
+<!-- skipped <ruby/rp/rt> -->
+<s data-role="" class="ex">X</s>
+<samp data-role="" class="ex">X</samp>
+<!-- skipped <script> -->
+<section data-role="region" class="ex">X</section>
+<select data-role="" class="ex" data-note=":not([multiple])">
+ <option data-role="" class="ex">X</option>
+ <optgroup data-role="" class="ex" label="more">
+ <option data-role="" class="ex">X</option>
+ </optgroup>
+</select>
+<select data-role="listbox" class="ex" multiple data-note="[multiple]">
+ <option data-role="option" class="ex">X</option>
+ <optgroup data-role="option" class="ex" label="more">
+ <option data-role="option" class="ex">Y</option>
+ <option data-role="option" class="ex">Z</option>
+ </optgroup>
+</select>
+<small data-role="" class="ex">X</small>
+<span data-role="" class="ex">X</span>
+<strong data-role="" class="ex">X</strong>
+<sub data-role="" class="ex">X</sub>
+<sup data-role="" class="ex">X</sup>
+<svg data-role="" class="ex">X</svg>
+
+<table data-role="grid" class="ex">
+ <caption data-role="" class="ex">X</caption>
+ <thead data-role="rowgroup" class="ex">
+ <tr data-role="row" class="ex">
+ <th data-role="gridcell" class="ex">X</th><!-- FIXME: should be columnheader -->
+ </tr>
+ </thead>
+ <tbody data-role="rowgroup" class="ex">
+ <tr data-role="row" class="ex">
+ <td data-role="gridcell" class="ex">X</td>
+ </tr>
+ </tbody>
+ <tfoot data-role="rowgroup" class="ex">
+ <tr data-role="row" class="ex">
+ <td data-role="gridcell" class="ex">X</td>
+ </tr>
+ </tfoot>
+</table>
+<textarea data-role="textbox" class="ex">X</textarea>
+<time data-role="" class="ex">X</time>
+<ul data-role="list" class="ex">
+ <li data-role="listitem" class="ex">X</li>
+</ul>
+<var data-role="" class="ex">X</var>
+<wbr data-role="" class="ex">X</wbr>
+
+<!-- ==================================================================================================== -->
+<!-- Abstract ARIA roles in alphabetical order; only generic role should be exposed on abstract roles -->
+<!-- ==================================================================================================== -->
+<div role="command" data-role="" class="ex">X</div>
+<div role="composite" data-role="" class="ex">X</div>
+<div role="input" data-role="" class="ex">X</div>
+<div role="landmark" data-role="" class="ex">X</div>
+<div role="range" data-role="" class="ex">X</div>
+<div role="roletype" data-role="" class="ex">X</div>
+<div role="section" data-role="" class="ex">X</div>
+<div role="sectionhead" data-role="" class="ex">X</div>
+<div role="select" data-role="" class="ex">X</div>
+<div role="structure" data-role="" class="ex">X</div>
+<div role="widget" data-role="" class="ex">X</div>
+<div role="window" data-role="" class="ex">X</div>
+
+
+<!-- ==================================================================================================== -->
+<!-- Non-abstract ARIA roles in alphabetical order, excepting the need for nesting (e.g. row is with its grid parent) -->
+<!-- ==================================================================================================== -->
+<div role="alert" data-role="alert" class="ex">X</div>
+<div role="alertdialog" data-role="alertdialog" class="ex">X</div>
+<div role="application" data-role="application" class="ex">X</div>
+<div role="article" data-role="article" class="ex">X</div>
+<div role="banner" data-role="banner" class="ex">X</div>
+<div role="button" data-role="button" class="ex">X</div>
+<div role="checkbox" data-role="checkbox" class="ex">X</div>
+<div role="combobox" data-role="combobox" class="ex">X</div>
+<div role="complementary" data-role="complementary" class="ex">X</div>
+<div role="contentinfo" data-role="contentinfo" class="ex">X</div>
+<div role="definition" data-role="definition" class="ex">X</div>
+<div role="dialog" data-role="dialog" class="ex">X</div>
+<div role="directory" data-role="list" class="ex">X</div><!-- FIXME: should be directory -->
+<div role="document" data-role="document" class="ex">X</div>
+<div role="form" data-role="" class="ex">X</div><!-- FIXME: should be form -->
+<div role="grid" data-role="grid" class="ex">
+ <div role="rowgroup" data-role="rowgroup" class="ex">
+ <div role="row" data-role="row" class="ex">
+ <div role="rowheader" data-role="gridcell" class="ex">X</div><!-- FIXME: should be rowheader -->
+ <div role="columnheader" data-role="gridcell" class="ex">X</div><!-- FIXME: should be columnheader -->
+ <div role="gridcell" data-role="gridcell" class="ex">X</div>
+ </div>
+ </div>
+</div>
+<div role="group" data-role="group" class="ex">X</div>
+<div role="heading" data-role="heading" class="ex">X</div>
+<div role="img" data-role="img" class="ex">X</div>
+<div role="link" data-role="link" class="ex">X</div>
+<div role="list" data-role="list" class="ex">
+ <div role="listitem" data-role="listitem" class="ex">X</div>
+</div>
+<div role="listbox" data-role="listbox" class="ex">
+ <div role="option" data-role="option" class="ex">X</div>
+</div>
+<div role="log" data-role="log" class="ex">X</div>
+<div role="main" data-role="main" class="ex">X</div>
+<div role="marquee" data-role="marquee" class="ex">X</div>
+<div role="math" data-role="math" class="ex">X</div>
+<div role="menu" data-role="menu" class="ex">
+ <div role="menuitem" data-role="menuitem" class="ex">X</div>
+ <div role="menuitemcheckbox" data-role="menuitemcheckbox" class="ex">X</div>
+ <div role="menuitemradio" data-role="menuitemradio" class="ex">X</div>
+</div>
+<div role="menubar" data-role="menubar" class="ex">
+ <div role="menuitem" data-role="menuitem" class="ex">X</div>
+ <div role="menuitemcheckbox" data-role="menuitemcheckbox" class="ex">X</div>
+ <div role="menuitemradio" data-role="menuitemradio" class="ex">X</div>
+</div>
+<div role="navigation" data-role="navigation" class="ex">X</div>
+<div role="note" data-role="note" class="ex">X</div>
+<div role="presentation" data-role="" class="ex">X</div>
+<div role="progressbar" data-role="progressbar" class="ex">X</div>
+<div role="radiogroup" data-role="radiogroup" class="ex">
+ <div role="radio" data-role="radio" class="ex">X</div>
+</div>
+<div role="region" data-role="region" class="ex">X</div>
+<div role="scrollbar" data-role="scrollbar" class="ex">X</div>
+<div role="search" data-role="search" class="ex">X</div>
+<div role="separator" data-role="separator" class="ex">X</div>
+<div role="slider" data-role="slider" class="ex">X</div>
+<div role="spinbutton" data-role="spinbutton" class="ex">X</div>
+<div role="status" data-role="status" class="ex">X</div>
+<div role="tablist" data-role="tablist" class="ex">
+ <div role="tab" data-role="tab" class="ex">X</div>
+</div>
+<div role="tabpanel" data-role="tabpanel" class="ex">X</div>
+<div role="textbox" data-role="" class="ex">X</div><!-- FIXME: should be textbox -->
+<div role="timer" data-role="timer" class="ex">X</div>
+<div role="toolbar" data-role="toolbar" class="ex">X</div>
+<div role="tooltip" data-role="tooltip" class="ex">X</div>
+<div role="tree" data-role="tree" class="ex">
+ <div role="treeitem" data-role="treeitem" class="ex">X</div>
+ <div role="group" data-role="group" class="ex">
+ <div role="treeitem" data-role="treeitem" class="ex">X</div>
+ </div>
+</div>
+<div role="treegrid" data-role="grid" class="ex"><!-- FIXME: should be treegrid -->
+ <div role="rowgroup" data-role="rowgroup" class="ex">
+ <div role="row" data-role="row" class="ex">
+ <div role="rowheader" data-role="gridcell" class="ex">X</div><!-- FIXME: should be rowheader -->
+ <div role="columnheader" data-role="gridcell" class="ex">X</div><!-- FIXME: should be columnheader -->
+ <div role="gridcell" data-role="gridcell" class="ex">X</div>
+ </div>
+ </div>
+</div>
+
+
+<!-- ==================================================================================================== -->
+<!-- generic role attribute parsing tests -->
+<!-- ==================================================================================================== -->
+<div role="button foo" data-role="button" class="ex">X</div>
+<div role="foo button bar" data-role="button" class="ex">X</div>
+<div role="foo button bar" data-role="button" class="ex">X</div><!-- [sic] Two spaces in role string -->
+
+<!-- FIXME: These two should be button but fail b/c of http://webkit.org/b/128400 -->
+<div role="foo        button        bar" data-role="" class="ex">X</div><!-- [sic] Tab chars in role string -->
+<div role="foo
+button
+bar" data-role="" class="ex">X</div><!-- [sic] Newlines in role string -->
+
+
+<!-- ==================================================================================================== -->
+<!-- implicit role parsing tests -->
+<!-- ==================================================================================================== -->
+<img role="foo" src="foo.png" data-role="img" alt="X" class="ex">
+<img role="foo bar" src="foo.png" data-role="img" alt="X" class="ex">
+<img role="foo bar" src="foo.png" data-role="img" alt="X" class="ex"><!-- [sic] Two spaces in role string -->
+<img role="foo        bar" src="foo.png" data-role="img" alt="X" class="ex"><!-- [sic] Newline in role string -->
+<img role="foo        
+bar" src="foo.png" data-role="img" alt="X" class="ex"><!-- [sic] Tab char in role string -->
+<img role="text" src="foo.png" data-role="text" alt="X" class="ex">
+<img role="text img" src="foo.png" data-role="text" alt="X" class="ex">
+<img role="img text" src="foo.png" data-role="img" alt="X" class="ex">
+<img role="presentation" data-role="img" data-note="[aria-label]" alt="X" src="foo.png" aria-label="X" class="ex"><!-- presentation with global attr should fallback to implicit role -->
+<a href="#" role="foo bar" data-role="link" class="ex">X</a>
+
+<div id="console"></div>
+<script>
+if (window.testRunner && window.accessibilityController) {
+ description("This tests that native elements and ARIA overrides result in the same ARIA computed role, regardless of platform.")
+ var examples = document.querySelectorAll(".ex");
+ var el, contentAttrRoleString, axElement, computedAriaRole, output, expectedRole, expectation, result, note;
+ for (var i = 0, c = examples.length; i < c; i++) {
+ el = examples[i];
+                el.id = "ex" + i
+
+ axElement = accessibilityController.accessibleElementById(el.id);
+ if (!axElement)
+         continue;
+
+ computedAriaRole = axElement.computedRoleString;
+
+ contentAttrRoleString = el.getAttribute("role");
+ note = el.getAttribute("data-note")
+ output = el.tagName.toLowerCase() + (contentAttrRoleString ? ("[role=\""+contentAttrRoleString+"\"]") : "") + (note ? note : "");
+ output += " -> ";
+ output += computedAriaRole;
+ output += ". ";
+
+ expectedRole = "";
+ if (el.hasAttribute("data-role")) {
+ expectedRole = el.getAttribute("data-role");
+ }
+
+ expectation = expectedRole;
+ matchedResults = (computedAriaRole == expectedRole)
+
+ result = document.getElementById('console');
+ if (matchedResults) {
+ result.innerText += "PASS: " + output + "\n";
+ } else {
+ result.innerText += "FAIL: " + output + "Expected: " + expectation + ".\n";
+ }
+ }
+
+ // Once tests are complete, hide all the example markup.
+ examples = document.querySelectorAll(".ex");
+ for (var i = 0, c = examples.length; i < c; i++) {
+ el = examples[i];
+ el.style.display = "none";
+ }
+}
+</script>
+<script src="../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformgtkTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/TestExpectations (163890 => 163891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/TestExpectations        2014-02-11 18:59:17 UTC (rev 163890)
+++ trunk/LayoutTests/platform/gtk/TestExpectations        2014-02-11 19:27:12 UTC (rev 163891)
</span><span class="lines">@@ -1316,6 +1316,8 @@
</span><span class="cx">
</span><span class="cx"> webkit.org/b/106316 accessibility/render-counter-text.html [ Failure ]
</span><span class="cx">
</span><ins>+webkit.org/b/128420 accessibility/roles-computedRoleString.html [ Skip ]
+
</ins><span class="cx"> webkit.org/b/103927 http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_cross_origin_resource_request.html [ Failure ]
</span><span class="cx"> webkit.org/b/103927 http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_timing_allow_cross_origin_resource_request.html [ Failure ]
</span><span class="cx"> webkit.org/b/103927 http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_attribute_order.html [ Failure ]
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (163890 => 163891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-02-11 18:59:17 UTC (rev 163890)
+++ trunk/Source/WebCore/ChangeLog        2014-02-11 19:27:12 UTC (rev 163891)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2014-02-11 James Craig <jcraig@apple.com>
+
+ Web Inspector: AX: Accessibility Node Inspection
+ https://bugs.webkit.org/show_bug.cgi?id=127447
+
+ Reviewed by Timothy Hatcher.
+
+ New methods supporting WebCore::AccessibilityObject::computedRoleString()
+ used for Accessibility section in WebInspector Node Inspector. Other updates
+ support the JSON interface for the WebInspectorUI feature.
+
+ Test: accessibility/roles-computedRoleString.html
+
+ * accessibility/AccessibilityObject.cpp:
+ (WebCore::initializeRoleMap):
+ (WebCore::ariaRoleMap):
+ (WebCore::reverseAriaRoleMap):
+ (WebCore::AccessibilityObject::ariaRoleToWebCoreRole):
+ (WebCore::AccessibilityObject::computedRoleString):
+ * accessibility/AccessibilityObject.h:
+ * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+ (-[WebAccessibilityObjectWrapper computedRoleString]):
+ (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
+ * inspector/InspectorDOMAgent.cpp:
+ (WebCore::InspectorDOMAgent::getAccessibilityPropertiesForNode):
+ (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
+ * inspector/InspectorDOMAgent.h:
+ * inspector/protocol/DOM.json:
+
</ins><span class="cx"> 2014-02-10 Oliver Hunt <oliver@apple.com>
</span><span class="cx">
</span><span class="cx"> Stop throwing when attempting to read instance properties directly from the prototype
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (163890 => 163891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp        2014-02-11 18:59:17 UTC (rev 163890)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp        2014-02-11 19:27:12 UTC (rev 163891)
</span><span class="lines">@@ -1610,14 +1610,22 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> typedef HashMap<String, AccessibilityRole, CaseFoldingHash> ARIARoleMap;
</span><ins>+typedef HashMap<AccessibilityRole, String, DefaultHash<int>::Hash, WTF::UnsignedWithZeroKeyHashTraits<int>> ARIAReverseRoleMap;
</ins><span class="cx">
</span><ins>+static ARIARoleMap* gAriaRoleMap = nullptr;
+static ARIAReverseRoleMap* gAriaReverseRoleMap = nullptr;
+
</ins><span class="cx"> struct RoleEntry {
</span><span class="cx"> String ariaRole;
</span><span class="cx"> AccessibilityRole webcoreRole;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-static ARIARoleMap* createARIARoleMap()
</del><ins>+static void initializeRoleMap()
</ins><span class="cx"> {
</span><ins>+ if (gAriaRoleMap)
+ return;
+ ASSERT(!gAriaReverseRoleMap);
+
</ins><span class="cx"> const RoleEntry roles[] = {
</span><span class="cx"> { "alert", ApplicationAlertRole },
</span><span class="cx"> { "alertdialog", ApplicationAlertDialogRole },
</span><span class="lines">@@ -1681,26 +1689,39 @@
</span><span class="cx"> { "treegrid", TreeGridRole },
</span><span class="cx"> { "treeitem", TreeItemRole }
</span><span class="cx"> };
</span><del>- ARIARoleMap* roleMap = new ARIARoleMap;
</del><span class="cx">
</span><del>- for (size_t i = 0; i < WTF_ARRAY_LENGTH(roles); ++i)
- roleMap->set(roles[i].ariaRole, roles[i].webcoreRole);
- return roleMap;
</del><ins>+ gAriaRoleMap = new ARIARoleMap;
+ gAriaReverseRoleMap = new ARIAReverseRoleMap;
+ size_t roleLength = WTF_ARRAY_LENGTH(roles);
+ for (size_t i = 0; i < roleLength; ++i) {
+ gAriaRoleMap->set(roles[i].ariaRole, roles[i].webcoreRole);
+ gAriaReverseRoleMap->set(roles[i].webcoreRole, roles[i].ariaRole);
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+static ARIARoleMap& ariaRoleMap()
+{
+ initializeRoleMap();
+ return *gAriaRoleMap;
+}
+
+static ARIAReverseRoleMap& reverseAriaRoleMap()
+{
+ initializeRoleMap();
+ return *gAriaReverseRoleMap;
+}
+
</ins><span class="cx"> AccessibilityRole AccessibilityObject::ariaRoleToWebCoreRole(const String& value)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(!value.isEmpty());
</span><span class="cx">
</span><del>- static const ARIARoleMap* roleMap = createARIARoleMap();
-
</del><span class="cx"> Vector<String> roleVector;
</span><span class="cx"> value.split(' ', roleVector);
</span><span class="cx"> AccessibilityRole role = UnknownRole;
</span><span class="cx"> unsigned size = roleVector.size();
</span><span class="cx"> for (unsigned i = 0; i < size; ++i) {
</span><span class="cx"> String roleName = roleVector[i];
</span><del>- role = roleMap->get(roleName);
</del><ins>+ role = ariaRoleMap().get(roleName);
</ins><span class="cx"> if (role)
</span><span class="cx"> return role;
</span><span class="cx"> }
</span><span class="lines">@@ -1708,6 +1729,12 @@
</span><span class="cx"> return role;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+String AccessibilityObject::computedRoleString() const
+{
+ // FIXME: Need a few special cases that aren't in the RoleMap: option, etc. http://webkit.org/b/128296
+ return reverseAriaRoleMap().get(roleValue());
+}
+
</ins><span class="cx"> bool AccessibilityObject::hasHighlighting() const
</span><span class="cx"> {
</span><span class="cx"> for (Node* node = this->node(); node; node = node->parentNode()) {
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.h (163890 => 163891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObject.h        2014-02-11 18:59:17 UTC (rev 163890)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.h        2014-02-11 19:27:12 UTC (rev 163891)
</span><span class="lines">@@ -805,6 +805,8 @@
</span><span class="cx">
</span><span class="cx"> unsigned doAXLineForIndex(unsigned);
</span><span class="cx">
</span><ins>+ String computedRoleString() const;
+
</ins><span class="cx"> virtual String stringValueForMSAA() const { return String(); }
</span><span class="cx"> virtual String stringRoleForMSAA() const { return String(); }
</span><span class="cx"> virtual String nameForMSAA() const { return String(); }
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilitymacWebAccessibilityObjectWrapperMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (163890 => 163891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm        2014-02-11 18:59:17 UTC (rev 163890)
+++ trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm        2014-02-11 19:27:12 UTC (rev 163891)
</span><span class="lines">@@ -2123,6 +2123,13 @@
</span><span class="cx"> return NSAccessibilityRoleDescription(NSAccessibilityUnknownRole, nil);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+- (NSString *)computedRoleString
+{
+ if (!m_object)
+ return nil;
+ return m_object->computedRoleString();
+}
+
</ins><span class="cx"> - (id)scrollViewParent
</span><span class="cx"> {
</span><span class="cx"> if (!m_object || !m_object->isAccessibilityScrollView())
</span><span class="lines">@@ -2160,6 +2167,10 @@
</span><span class="cx">
</span><span class="cx"> if ([attributeName isEqualToString: NSAccessibilityRoleDescriptionAttribute])
</span><span class="cx"> return [self roleDescription];
</span><ins>+
+ // AXARIARole is only used by DumpRenderTree (so far).
+ if ([attributeName isEqualToString:@"AXARIARole"])
+ return [self computedRoleString];
</ins><span class="cx">
</span><span class="cx"> if ([attributeName isEqualToString: NSAccessibilityParentAttribute]) {
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorDOMAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp (163890 => 163891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp        2014-02-11 18:59:17 UTC (rev 163890)
+++ trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp        2014-02-11 19:27:12 UTC (rev 163891)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx">
</span><span class="cx"> #include "InspectorDOMAgent.h"
</span><span class="cx">
</span><ins>+#include "AXObjectCache.h"
</ins><span class="cx"> #include "Attr.h"
</span><span class="cx"> #include "CSSComputedStyleDeclaration.h"
</span><span class="cx"> #include "CSSPropertyNames.h"
</span><span class="lines">@@ -874,6 +875,12 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void InspectorDOMAgent::getAccessibilityPropertiesForNode(ErrorString* errorString, int nodeId, RefPtr<Inspector::TypeBuilder::DOM::AccessibilityProperties>& axProperties)
+{
+ Node* node = assertNode(errorString, nodeId);
+ axProperties = buildObjectForAccessibilityProperties(node);
+}
+
</ins><span class="cx"> void InspectorDOMAgent::performSearch(ErrorString* errorString, const String& whitespaceTrimmedQuery, const RefPtr<InspectorArray>* nodeIds, String* searchId, int* resultCount)
</span><span class="cx"> {
</span><span class="cx"> // FIXME: Search works with node granularity - number of matches within node is not calculated.
</span><span class="lines">@@ -1399,6 +1406,40 @@
</span><span class="cx"> return value.release();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+PassRefPtr<TypeBuilder::DOM::AccessibilityProperties> InspectorDOMAgent::buildObjectForAccessibilityProperties(Node* node)
+{
+ ASSERT(node);
+ if (!node)
+ return nullptr;
+
+ if (!WebCore::AXObjectCache::accessibilityEnabled())
+ WebCore::AXObjectCache::enableAccessibility();
+
+ bool ignored = true;
+
+ // Computed ARIA Role
+ String role;
+
+ // Computed Label
+ // FIXME: Waiting on http://webkit.org/b/121134
+ String label;
+
+ if (AXObjectCache* axObjectCache = node->document().axObjectCache()) {
+ if (AccessibilityObject* axObject = axObjectCache->getOrCreate(node)) {
+ ignored = axObject->accessibilityIsIgnored();
+ role = axObject->computedRoleString();
+ }
+ }
+
+ RefPtr<Inspector::TypeBuilder::DOM::AccessibilityProperties> value = Inspector::TypeBuilder::DOM::AccessibilityProperties::create()
+ .setIgnored(ignored)
+ .setRole(role)
+ .setLabel(label)
+ .setNodeId(pushNodePathToFrontend(node));
+
+ return value.release();
+}
+
</ins><span class="cx"> Node* InspectorDOMAgent::innerFirstChild(Node* node)
</span><span class="cx"> {
</span><span class="cx"> node = node->firstChild();
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorDOMAgenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorDOMAgent.h (163890 => 163891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorDOMAgent.h        2014-02-11 18:59:17 UTC (rev 163890)
+++ trunk/Source/WebCore/inspector/InspectorDOMAgent.h        2014-02-11 19:27:12 UTC (rev 163891)
</span><span class="lines">@@ -131,6 +131,7 @@
</span><span class="cx"> virtual void setOuterHTML(ErrorString*, int nodeId, const String& outerHTML) override;
</span><span class="cx"> virtual void setNodeValue(ErrorString*, int nodeId, const String& value) override;
</span><span class="cx"> virtual void getEventListenersForNode(ErrorString*, int nodeId, const WTF::String* objectGroup, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::DOM::EventListener>>& listenersArray) override;
</span><ins>+ virtual void getAccessibilityPropertiesForNode(ErrorString*, int nodeId, RefPtr<Inspector::TypeBuilder::DOM::AccessibilityProperties>& axProperties) override;
</ins><span class="cx"> virtual void performSearch(ErrorString*, const String& whitespaceTrimmedQuery, const RefPtr<Inspector::InspectorArray>* nodeIds, String* searchId, int* resultCount) override;
</span><span class="cx"> virtual void getSearchResults(ErrorString*, const String& searchId, int fromIndex, int toIndex, RefPtr<Inspector::TypeBuilder::Array<int>>&) override;
</span><span class="cx"> virtual void discardSearchResults(ErrorString*, const String& searchId) override;
</span><span class="lines">@@ -233,6 +234,7 @@
</span><span class="cx"> PassRefPtr<Inspector::TypeBuilder::Array<String>> buildArrayForElementAttributes(Element*);
</span><span class="cx"> PassRefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::DOM::Node>> buildArrayForContainerChildren(Node* container, int depth, NodeToIdMap* nodesMap);
</span><span class="cx"> PassRefPtr<Inspector::TypeBuilder::DOM::EventListener> buildObjectForEventListener(const RegisteredEventListener&, const AtomicString& eventType, Node*, const String* objectGroupId);
</span><ins>+ PassRefPtr<Inspector::TypeBuilder::DOM::AccessibilityProperties> buildObjectForAccessibilityProperties(Node*);
</ins><span class="cx">
</span><span class="cx"> Node* nodeForPath(const String& path);
</span><span class="cx"> Node* nodeForObjectId(const String& objectId);
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorprotocolDOMjson"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/protocol/DOM.json (163890 => 163891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/protocol/DOM.json        2014-02-11 18:59:17 UTC (rev 163890)
+++ trunk/Source/WebCore/inspector/protocol/DOM.json        2014-02-11 19:27:12 UTC (rev 163891)
</span><span class="lines">@@ -55,6 +55,17 @@
</span><span class="cx"> "description": "DOM interaction is implemented in terms of mirror objects that represent the actual DOM nodes. DOMNode is a base node mirror type."
</span><span class="cx"> },
</span><span class="cx"> {
</span><ins>+ "id": "AccessibilityProperties",
+ "description": "A structure holding accessibility properties.",
+ "type": "object",
+ "properties": [
+ { "name": "ignored", "type": "boolean", "description": "Returns whether the accessibility of the DOM node is ignored, whether heuristically or explicitly." },
+ { "name": "role", "type": "string", "description": "Computed value for first recognized role token, default role per element, or overridden role." },
+ { "name": "label", "type": "string", "description": "Computed label value for the node, sometimes calculated by referencing other nodes." },
+ { "name": "nodeId", "$ref": "NodeId", "description": "Target <code>DOMNode</code> id." }
+ ]
+ },
+ {
</ins><span class="cx"> "id": "RGBA",
</span><span class="cx"> "type": "object",
</span><span class="cx"> "properties": [
</span><span class="lines">@@ -188,6 +199,16 @@
</span><span class="cx"> "description": "Returns event listeners relevant to the node."
</span><span class="cx"> },
</span><span class="cx"> {
</span><ins>+ "name": "getAccessibilityPropertiesForNode",
+ "description": "Returns a dictionary of accessibility properties for the node.",
+ "parameters": [
+ { "name": "nodeId", "$ref": "NodeId", "description": "Id of the node for which to get accessibility properties." }
+ ],
+ "returns": [
+ { "name": "properties", "$ref": "AccessibilityProperties", "description": "Dictionary of relevant accessibility properties." }
+ ]
+ },
+ {
</ins><span class="cx"> "name": "getOuterHTML",
</span><span class="cx"> "parameters": [
</span><span class="cx"> { "name": "nodeId", "$ref": "NodeId", "description": "Id of the node to get markup for." }
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (163890 => 163891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2014-02-11 18:59:17 UTC (rev 163890)
+++ trunk/Source/WebInspectorUI/ChangeLog        2014-02-11 19:27:12 UTC (rev 163891)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2014-02-11 James Craig <jcraig@apple.com>
+
+ Web Inspector: AX: Accessibility Node Inspection
+ https://bugs.webkit.org/show_bug.cgi?id=127447
+
+ Reviewed by Timothy Hatcher.
+
+ New Accessibility section in WebInspector Node Inspector.
+ Version 1.0 only shows computed role. Computed label should come soon.
+
+ Removed CSS fixed table layout b/c CSS bug: http://webkit.org/b/128294
+
+ * Localizations/en.lproj/localizedStrings.js:
+ * UserInterface/DOMNode.js:
+ * UserInterface/DOMNodeDetailsSidebarPanel.js:
+ * UserInterface/DetailsSection.css:
+ * UserInterface/InspectorWebBackendCommands.js:
+
</ins><span class="cx"> 2014-02-10 Joseph Pecoraro <pecoraro@apple.com>
</span><span class="cx">
</span><span class="cx"> Web Inspector: Update License copyrights in minified JavaScript
</span></span></pre></div>
<a id="trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (163890 => 163891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2014-02-11 18:59:17 UTC (rev 163890)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2014-02-11 19:27:12 UTC (rev 163891)
</span><span class="lines">@@ -23,10 +23,13 @@
</span><span class="cx">