<!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>[187582] 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/187582">187582</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-07-30 04:10:38 -0700 (Thu, 30 Jul 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>AX: VoiceOver unable to access content in malformed trees
https://bugs.webkit.org/show_bug.cgi?id=147295
&lt;rdar://problem/14862892&gt;

Patch by Nan Wang &lt;n_wang@apple.com&gt; on 2015-07-30
Reviewed by Chris Fleizach.

Source/WebCore:

VoiceOver is skipping the content of malformed trees. This fixes the problem
by having the tree check if it has valid children (treeitems) and makes treeitems
check if they are inside trees.

Test: platform/mac/accessibility/malformed-tree.html

* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/AXObjectCache.cpp:
(WebCore::createFromRenderer):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::addChildren):
(WebCore::AccessibilityObject::addChild):
(WebCore::AccessibilityObject::insertChild):
(WebCore::AccessibilityObject::shouldIgnoreAttributeRole):
(WebCore::AccessibilityObject::canHaveChildren):
(WebCore::AccessibilityObject::hasChildren):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
* accessibility/AccessibilityTree.cpp: Added.
(WebCore::AccessibilityTree::AccessibilityTree):
(WebCore::AccessibilityTree::~AccessibilityTree):
(WebCore::AccessibilityTree::create):
(WebCore::AccessibilityTree::computeAccessibilityIsIgnored):
(WebCore::AccessibilityTree::determineAccessibilityRole):
(WebCore::AccessibilityTree::isTreeValid):
* accessibility/AccessibilityTree.h: Added.
* accessibility/AccessibilityTreeItem.cpp: Added.
(WebCore::AccessibilityTreeItem::AccessibilityTreeItem):
(WebCore::AccessibilityTreeItem::~AccessibilityTreeItem):
(WebCore::AccessibilityTreeItem::create):
(WebCore::AccessibilityTreeItem::determineAccessibilityRole):
* accessibility/AccessibilityTreeItem.h: Added.

LayoutTests:

* accessibility/aria-mappings.html:
* accessibility/treeitem-child-exposed-expected.txt:
* accessibility/treeitem-child-exposed.html:
* platform/mac/accessibility/malformed-tree-expected.txt: Added.
* platform/mac/accessibility/malformed-tree.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsaccessibilityariamappingshtml">trunk/LayoutTests/accessibility/aria-mappings.html</a></li>
<li><a href="#trunkLayoutTestsaccessibilitytreeitemchildexposedexpectedtxt">trunk/LayoutTests/accessibility/treeitem-child-exposed-expected.txt</a></li>
<li><a href="#trunkLayoutTestsaccessibilitytreeitemchildexposedhtml">trunk/LayoutTests/accessibility/treeitem-child-exposed.html</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAXObjectCachecpp">trunk/Source/WebCore/accessibility/AXObjectCache.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityObjecth">trunk/Source/WebCore/accessibility/AccessibilityObject.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityRenderObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsplatformmacaccessibilitymalformedtreeexpectedtxt">trunk/LayoutTests/platform/mac/accessibility/malformed-tree-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacaccessibilitymalformedtreehtml">trunk/LayoutTests/platform/mac/accessibility/malformed-tree.html</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityTreecpp">trunk/Source/WebCore/accessibility/AccessibilityTree.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityTreeh">trunk/Source/WebCore/accessibility/AccessibilityTree.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityTreeItemcpp">trunk/Source/WebCore/accessibility/AccessibilityTreeItem.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityTreeItemh">trunk/Source/WebCore/accessibility/AccessibilityTreeItem.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (187581 => 187582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-07-30 09:52:48 UTC (rev 187581)
+++ trunk/LayoutTests/ChangeLog        2015-07-30 11:10:38 UTC (rev 187582)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2015-07-30  Nan Wang  &lt;n_wang@apple.com&gt;
+
+        AX: VoiceOver unable to access content in malformed trees
+        https://bugs.webkit.org/show_bug.cgi?id=147295
+        &lt;rdar://problem/14862892&gt;
+
+        Reviewed by Chris Fleizach.
+
+        * accessibility/aria-mappings.html:
+        * accessibility/treeitem-child-exposed-expected.txt:
+        * accessibility/treeitem-child-exposed.html:
+        * platform/mac/accessibility/malformed-tree-expected.txt: Added.
+        * platform/mac/accessibility/malformed-tree.html: Added.
+
</ins><span class="cx"> 2015-07-30  Benjamin Poulain  &lt;benjamin@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Update JSC's standalone-pre.js for r187575
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilityariamappingshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/accessibility/aria-mappings.html (187581 => 187582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/aria-mappings.html        2015-07-30 09:52:48 UTC (rev 187581)
+++ trunk/LayoutTests/accessibility/aria-mappings.html        2015-07-30 11:10:38 UTC (rev 187582)
</span><span class="lines">@@ -12,8 +12,8 @@
</span><span class="cx"> &lt;div id=&quot;document&quot; role=&quot;document&quot;&gt;document role&lt;/div&gt;
</span><span class="cx"> &lt;div id=&quot;status&quot; role=&quot;status&quot;&gt;status role&lt;/div&gt;
</span><span class="cx"> &lt;div id=&quot;tooltip&quot; role=&quot;tooltip&quot;&gt;tooltip role&lt;/div&gt;
</span><del>-&lt;div id=&quot;tree&quot; role=&quot;tree&quot;&gt;tree role&lt;/div&gt;
-&lt;div id=&quot;treeitem&quot; role=&quot;treeitem&quot;&gt;treeitem role&lt;/div&gt;
</del><ins>+&lt;div id=&quot;tree&quot; role=&quot;tree&quot;&gt;&lt;div role=&quot;treeitem&quot;&gt;tree role&lt;/div&gt;&lt;/div&gt;
+&lt;div role=&quot;tree&quot;&gt;&lt;div id=&quot;treeitem&quot; role=&quot;treeitem&quot;&gt;treeitem role&lt;/div&gt;&lt;/div&gt;
</ins><span class="cx"> &lt;br&gt;
</span><span class="cx"> &lt;p id=&quot;description&quot;&gt;&lt;/p&gt;
</span><span class="cx"> &lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilitytreeitemchildexposedexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/accessibility/treeitem-child-exposed-expected.txt (187581 => 187582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/treeitem-child-exposed-expected.txt        2015-07-30 09:52:48 UTC (rev 187581)
+++ trunk/LayoutTests/accessibility/treeitem-child-exposed-expected.txt        2015-07-30 11:10:38 UTC (rev 187582)
</span><span class="lines">@@ -6,7 +6,7 @@
</span><span class="cx"> On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-PASS tree.childrenCount is 2
</del><ins>+PASS tree.childrenCount is 3
</ins><span class="cx"> PASS inputField.isValid is true
</span><span class="cx"> PASS inputField3.isValid is true
</span><span class="cx"> PASS successfullyParsed is true
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilitytreeitemchildexposedhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/accessibility/treeitem-child-exposed.html (187581 => 187582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/treeitem-child-exposed.html        2015-07-30 09:52:48 UTC (rev 187581)
+++ trunk/LayoutTests/accessibility/treeitem-child-exposed.html        2015-07-30 11:10:38 UTC (rev 187582)
</span><span class="lines">@@ -26,9 +26,9 @@
</span><span class="cx">     description(&quot;This tests if a treeitem contains an element other than static text, it should be exposed&quot;);
</span><span class="cx"> 
</span><span class="cx">     if (window.accessibilityController) {
</span><del>-            // tree should only have 2 child, since only treeitem or static text can be a tree's child
</del><ins>+            // tree should only have 3 child, since malformed tree should also be accessible.
</ins><span class="cx">         var tree = accessibilityController.accessibleElementById(&quot;tree&quot;);
</span><del>-        shouldBe(&quot;tree.childrenCount&quot;, &quot;2&quot;);
</del><ins>+        shouldBe(&quot;tree.childrenCount&quot;, &quot;3&quot;);
</ins><span class="cx">         
</span><span class="cx">         // input filed in treeitem1 should be exposed
</span><span class="cx">         var inputField = accessibilityController.accessibleElementById(&quot;input1&quot;);
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacaccessibilitymalformedtreeexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac/accessibility/malformed-tree-expected.txt (0 => 187582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/accessibility/malformed-tree-expected.txt                                (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/malformed-tree-expected.txt        2015-07-30 11:10:38 UTC (rev 187582)
</span><span class="lines">@@ -0,0 +1,26 @@
</span><ins>+text
+treeitem
+Entry A
+
+
+text
+
+text
+This tests that a malformed tree is accessible.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS tree.role is 'AXRole: AXOutline'
+PASS tree1.role is 'AXRole: AXGroup'
+PASS tree2.role is 'AXRole: AXGroup'
+PASS itemA != null is true
+PASS itemB != null is true
+PASS itemC != null is true
+PASS itemD != null is true
+PASS itemE != null is true
+PASS itemF != null is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacaccessibilitymalformedtreehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac/accessibility/malformed-tree.html (0 => 187582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/accessibility/malformed-tree.html                                (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/malformed-tree.html        2015-07-30 11:10:38 UTC (rev 187582)
</span><span class="lines">@@ -0,0 +1,63 @@
</span><ins>+&lt;!DOCTYPE HTML&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;   
+
+&lt;div role=&quot;tree&quot; id=&quot;goodtree&quot;&gt;
+&lt;div role=&quot;treeitem&quot;&gt;text&lt;/div&gt;
+&lt;div role=&quot;group&quot;&gt;&lt;div role=&quot;group&quot;&gt;&lt;div role=&quot;treeitem&quot;&gt;treeitem&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
+&lt;/div&gt;
+        
+&lt;ul id=&quot;malformedTree1&quot; role=&quot;tree&quot;&gt;
+&lt;li role=&quot;treeitem&quot;&gt;
+&lt;span&gt;&lt;a id=&quot;ITEM_A&quot; href=&quot;http://apple.com&quot;&gt;Entry A&lt;/a&gt;&lt;/span&gt;
+&lt;/li&gt;
+&lt;li id=&quot;list1&quot;&gt;&lt;input id=&quot;ITEM_B&quot;&gt;&lt;/li&gt;
+&lt;/ul&gt;
+
+&lt;ul id=&quot;malformedTree2&quot; role=&quot;tree&quot;&gt;
+&lt;li&gt;&lt;input id=&quot;ITEM_C&quot;&gt;&lt;/li&gt;
+&lt;li id=&quot;ITEM_D&quot;&gt;text&lt;/li&gt;
+&lt;/ul&gt;
+
+&lt;ul id=&quot;malformedTree3&quot;&gt;
+&lt;li role=&quot;treeitem&quot;&gt;&lt;input id=&quot;ITEM_E&quot;&gt;&lt;/li&gt;
+&lt;li role=&quot;treeitem&quot; id=&quot;ITEM_F&quot;&gt;text&lt;/li&gt;
+&lt;/ul&gt;
+
+&lt;p id=&quot;description&quot;&gt;&lt;/p&gt;
+&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+
+&lt;script&gt;
+
+description(&quot;This tests that a malformed tree is accessible.&quot;)
+
+if (window.accessibilityController) {
+
+    var tree = accessibilityController.accessibleElementById(&quot;goodtree&quot;);
+    shouldBe(&quot;tree.role&quot;, &quot;'AXRole: AXOutline'&quot;);
+    var tree1 = accessibilityController.accessibleElementById(&quot;malformedTree1&quot;);
+    shouldBe(&quot;tree1.role&quot;, &quot;'AXRole: AXGroup'&quot;);
+    var tree2 = accessibilityController.accessibleElementById(&quot;malformedTree2&quot;);
+    shouldBe(&quot;tree2.role&quot;, &quot;'AXRole: AXGroup'&quot;);
+
+    var itemA = accessibilityController.accessibleElementById(&quot;ITEM_A&quot;);
+    var itemB = accessibilityController.accessibleElementById(&quot;ITEM_B&quot;);
+    var itemC = accessibilityController.accessibleElementById(&quot;ITEM_C&quot;);
+    var itemD = accessibilityController.accessibleElementById(&quot;ITEM_D&quot;);
+    var itemE = accessibilityController.accessibleElementById(&quot;ITEM_E&quot;);
+    var itemF = accessibilityController.accessibleElementById(&quot;ITEM_F&quot;);
+    
+    shouldBeTrue(&quot;itemA != null&quot;);
+    shouldBeTrue(&quot;itemB != null&quot;);
+    shouldBeTrue(&quot;itemC != null&quot;);
+    shouldBeTrue(&quot;itemD != null&quot;);
+    shouldBeTrue(&quot;itemE != null&quot;);
+    shouldBeTrue(&quot;itemF != null&quot;);
+}
+
+&lt;/script&gt;
+
+&lt;script src=&quot;../../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (187581 => 187582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2015-07-30 09:52:48 UTC (rev 187581)
+++ trunk/Source/WebCore/CMakeLists.txt        2015-07-30 11:10:38 UTC (rev 187582)
</span><span class="lines">@@ -1063,6 +1063,8 @@
</span><span class="cx">     accessibility/AccessibilityTableColumn.cpp
</span><span class="cx">     accessibility/AccessibilityTableHeaderContainer.cpp
</span><span class="cx">     accessibility/AccessibilityTableRow.cpp
</span><ins>+    accessibility/AccessibilityTree.cpp
+    accessibility/AccessibilityTreeItem.cpp
</ins><span class="cx"> 
</span><span class="cx">     bindings/generic/ActiveDOMCallback.cpp
</span><span class="cx">     bindings/generic/RuntimeEnabledFeatures.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (187581 => 187582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-07-30 09:52:48 UTC (rev 187581)
+++ trunk/Source/WebCore/ChangeLog        2015-07-30 11:10:38 UTC (rev 187582)
</span><span class="lines">@@ -1,3 +1,47 @@
</span><ins>+2015-07-30  Nan Wang  &lt;n_wang@apple.com&gt;
+
+        AX: VoiceOver unable to access content in malformed trees
+        https://bugs.webkit.org/show_bug.cgi?id=147295
+        &lt;rdar://problem/14862892&gt;
+
+        Reviewed by Chris Fleizach.
+
+        VoiceOver is skipping the content of malformed trees. This fixes the problem
+        by having the tree check if it has valid children (treeitems) and makes treeitems
+        check if they are inside trees.
+
+        Test: platform/mac/accessibility/malformed-tree.html
+
+        * CMakeLists.txt:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        * WebCore.xcodeproj/project.pbxproj:
+        * accessibility/AXObjectCache.cpp:
+        (WebCore::createFromRenderer):
+        * accessibility/AccessibilityObject.h:
+        (WebCore::AccessibilityObject::addChildren):
+        (WebCore::AccessibilityObject::addChild):
+        (WebCore::AccessibilityObject::insertChild):
+        (WebCore::AccessibilityObject::shouldIgnoreAttributeRole):
+        (WebCore::AccessibilityObject::canHaveChildren):
+        (WebCore::AccessibilityObject::hasChildren):
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
+        * accessibility/AccessibilityTree.cpp: Added.
+        (WebCore::AccessibilityTree::AccessibilityTree):
+        (WebCore::AccessibilityTree::~AccessibilityTree):
+        (WebCore::AccessibilityTree::create):
+        (WebCore::AccessibilityTree::computeAccessibilityIsIgnored):
+        (WebCore::AccessibilityTree::determineAccessibilityRole):
+        (WebCore::AccessibilityTree::isTreeValid):
+        * accessibility/AccessibilityTree.h: Added.
+        * accessibility/AccessibilityTreeItem.cpp: Added.
+        (WebCore::AccessibilityTreeItem::AccessibilityTreeItem):
+        (WebCore::AccessibilityTreeItem::~AccessibilityTreeItem):
+        (WebCore::AccessibilityTreeItem::create):
+        (WebCore::AccessibilityTreeItem::determineAccessibilityRole):
+        * accessibility/AccessibilityTreeItem.h: Added.
+
</ins><span class="cx"> 2015-07-29  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] Paste data is removed from clipboard when closing browser tab
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (187581 => 187582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-07-30 09:52:48 UTC (rev 187581)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-07-30 11:10:38 UTC (rev 187582)
</span><span class="lines">@@ -7209,6 +7209,34 @@
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\accessibility\AccessibilityTree.cpp&quot;&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='DebugSuffix|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+    &lt;/ClCompile&gt;
+    &lt;ClCompile Include=&quot;..\accessibility\AccessibilityTreeItem.cpp&quot;&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='DebugSuffix|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\accessibility\win\AccessibilityObjectWrapperWin.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\accessibility\win\AccessibilityObjectWin.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\accessibility\win\AXObjectCacheWin.cpp&quot; /&gt;
</span><span class="lines">@@ -19864,6 +19892,8 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\accessibility\AccessibilityTableColumn.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\accessibility\AccessibilityTableHeaderContainer.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\accessibility\AccessibilityTableRow.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\accessibility\AccessibilityTree.h&quot; /&gt;
+    &lt;ClInclude Include=&quot;..\accessibility\AccessibilityTreeItem.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\accessibility\AXObjectCache.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\accessibility\AXTextStateChangeIntent.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\accessibility\win\AccessibilityObjectWrapperWin.h&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (187581 => 187582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2015-07-30 09:52:48 UTC (rev 187581)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2015-07-30 11:10:38 UTC (rev 187582)
</span><span class="lines">@@ -669,6 +669,12 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\accessibility\AccessibilityTableRow.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;accessibility&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\accessibility\AccessibilityTree.cpp&quot;&gt;
+      &lt;Filter&gt;accessibility&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
+    &lt;ClCompile Include=&quot;..\accessibility\AccessibilityTreeItem.cpp&quot;&gt;
+      &lt;Filter&gt;accessibility&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\accessibility\AXObjectCache.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;accessibility&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="lines">@@ -7670,6 +7676,12 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\accessibility\AccessibilityTableRow.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;accessibility&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\accessibility\AccessibilityTree.h&quot;&gt;
+      &lt;Filter&gt;accessibility&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
+    &lt;ClInclude Include=&quot;..\accessibility\AccessibilityTreeItem.h&quot;&gt;
+      &lt;Filter&gt;accessibility&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\accessibility\AXObjectCache.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;accessibility&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (187581 => 187582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-07-30 09:52:48 UTC (rev 187581)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-07-30 11:10:38 UTC (rev 187582)
</span><span class="lines">@@ -4397,6 +4397,10 @@
</span><span class="cx">                 A8EA800E0A19516E00A8EF5F /* MediaList.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA80060A19516E00A8EF5F /* MediaList.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 A8FA6E5D0E4CFDED00D5CF49 /* Pattern.h in Headers */ = {isa = PBXBuildFile; fileRef = A8FA6E5B0E4CFDED00D5CF49 /* Pattern.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 A8FA6E5E0E4CFDED00D5CF49 /* Pattern.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8FA6E5C0E4CFDED00D5CF49 /* Pattern.cpp */; };
</span><ins>+                A91C9FBE1B6586DE00AFFD54 /* AccessibilityTree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A91C9FBC1B6586DE00AFFD54 /* AccessibilityTree.cpp */; };
+                A91C9FBF1B6586DE00AFFD54 /* AccessibilityTree.h in Headers */ = {isa = PBXBuildFile; fileRef = A91C9FBD1B6586DE00AFFD54 /* AccessibilityTree.h */; };
+                A91C9FC21B659A6700AFFD54 /* AccessibilityTreeItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A91C9FC01B659A6700AFFD54 /* AccessibilityTreeItem.cpp */; };
+                A91C9FC31B659A6700AFFD54 /* AccessibilityTreeItem.h in Headers */ = {isa = PBXBuildFile; fileRef = A91C9FC11B659A6700AFFD54 /* AccessibilityTreeItem.h */; };
</ins><span class="cx">                 A9C6E4E30D745E05006442E9 /* DOMMimeType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A9C6E4E10D745E05006442E9 /* DOMMimeType.cpp */; };
</span><span class="cx">                 A9C6E4E40D745E05006442E9 /* DOMMimeType.h in Headers */ = {isa = PBXBuildFile; fileRef = A9C6E4E20D745E05006442E9 /* DOMMimeType.h */; };
</span><span class="cx">                 A9C6E4E70D745E18006442E9 /* DOMMimeTypeArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A9C6E4E50D745E18006442E9 /* DOMMimeTypeArray.cpp */; };
</span><span class="lines">@@ -11792,6 +11796,10 @@
</span><span class="cx">                 A8EA80060A19516E00A8EF5F /* MediaList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MediaList.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A8FA6E5B0E4CFDED00D5CF49 /* Pattern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Pattern.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A8FA6E5C0E4CFDED00D5CF49 /* Pattern.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Pattern.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                A91C9FBC1B6586DE00AFFD54 /* AccessibilityTree.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityTree.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A91C9FBD1B6586DE00AFFD54 /* AccessibilityTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityTree.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A91C9FC01B659A6700AFFD54 /* AccessibilityTreeItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityTreeItem.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A91C9FC11B659A6700AFFD54 /* AccessibilityTreeItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityTreeItem.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 A9C6E4E10D745E05006442E9 /* DOMMimeType.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DOMMimeType.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A9C6E4E20D745E05006442E9 /* DOMMimeType.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMMimeType.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A9C6E4E50D745E18006442E9 /* DOMMimeTypeArray.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DOMMimeTypeArray.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -15780,6 +15788,10 @@
</span><span class="cx">                                 29A8121D0FBB9C1D00510293 /* AccessibilityImageMapLink.h */,
</span><span class="cx">                                 2981CAA1131822EC00D12F2A /* AccessibilityList.cpp */,
</span><span class="cx">                                 29A8120E0FBB9C1D00510293 /* AccessibilityList.h */,
</span><ins>+                                A91C9FBC1B6586DE00AFFD54 /* AccessibilityTree.cpp */,
+                                A91C9FBD1B6586DE00AFFD54 /* AccessibilityTree.h */,
+                                A91C9FC01B659A6700AFFD54 /* AccessibilityTreeItem.cpp */,
+                                A91C9FC11B659A6700AFFD54 /* AccessibilityTreeItem.h */,
</ins><span class="cx">                                 2981CAA2131822EC00D12F2A /* AccessibilityListBox.cpp */,
</span><span class="cx">                                 29A812250FBB9C1D00510293 /* AccessibilityListBox.h */,
</span><span class="cx">                                 2981CAA3131822EC00D12F2A /* AccessibilityListBoxOption.cpp */,
</span><span class="lines">@@ -26853,6 +26865,7 @@
</span><span class="cx">                                 B22279C80D00BF220071B782 /* SVGFEBlendElement.h in Headers */,
</span><span class="cx">                                 B22279CB0D00BF220071B782 /* SVGFEColorMatrixElement.h in Headers */,
</span><span class="cx">                                 B22279CE0D00BF220071B782 /* SVGFEComponentTransferElement.h in Headers */,
</span><ins>+                                A91C9FBF1B6586DE00AFFD54 /* AccessibilityTree.h in Headers */,
</ins><span class="cx">                                 B22279D10D00BF220071B782 /* SVGFECompositeElement.h in Headers */,
</span><span class="cx">                                 1921327511C0E6BB00456238 /* SVGFEConvolveMatrixElement.h in Headers */,
</span><span class="cx">                                 B22279D40D00BF220071B782 /* SVGFEDiffuseLightingElement.h in Headers */,
</span><span class="lines">@@ -27355,6 +27368,7 @@
</span><span class="cx">                                 B10B6980140C174000BC1C26 /* WebVTTToken.h in Headers */,
</span><span class="cx">                                 B10B6982140C174000BC1C26 /* WebVTTTokenizer.h in Headers */,
</span><span class="cx">                                 CD8203101395ACE700F956C6 /* WebWindowAnimation.h in Headers */,
</span><ins>+                                A91C9FC31B659A6700AFFD54 /* AccessibilityTreeItem.h in Headers */,
</ins><span class="cx">                                 F55B3DE01251F12D003EF269 /* WeekInputType.h in Headers */,
</span><span class="cx">                                 85031B510A44EFC700F992E0 /* WheelEvent.h in Headers */,
</span><span class="cx">                                 93EC44A2188F4BB800661DF1 /* WheelEventDeltaTracker.h in Headers */,
</span><span class="lines">@@ -28946,6 +28960,7 @@
</span><span class="cx">                                 2ECF7ADC10162B3800427DE7 /* JSErrorEvent.cpp in Sources */,
</span><span class="cx">                                 F3D461481161D53200CA0D09 /* JSErrorHandler.cpp in Sources */,
</span><span class="cx">                                 14E8378409F85D1C00B85AE4 /* JSEvent.cpp in Sources */,
</span><ins>+                                A91C9FBE1B6586DE00AFFD54 /* AccessibilityTree.cpp in Sources */,
</ins><span class="cx">                                 BCEFAF4E0C317E6900FA81F6 /* JSEventCustom.cpp in Sources */,
</span><span class="cx">                                 BC60D9BF0D2A269A00B9918F /* JSEventException.cpp in Sources */,
</span><span class="cx">                                 93B70D6909EB0C7C009D8468 /* JSEventListener.cpp in Sources */,
</span><span class="lines">@@ -30062,6 +30077,7 @@
</span><span class="cx">                                 0FE71405142170B800DB33BA /* ScrollbarThemeMock.cpp in Sources */,
</span><span class="cx">                                 5D925B670F64D4DD00B847F0 /* ScrollBehavior.cpp in Sources */,
</span><span class="cx">                                 1AA84F04143BA7BD0051D153 /* ScrollController.mm in Sources */,
</span><ins>+                                A91C9FC21B659A6700AFFD54 /* AccessibilityTreeItem.cpp in Sources */,
</ins><span class="cx">                                 0F605AEC15F94848004DF0C0 /* ScrollingConstraints.cpp in Sources */,
</span><span class="cx">                                 1AF62EE714DA22A70041556C /* ScrollingCoordinator.cpp in Sources */,
</span><span class="cx">                                 0FC4E40E187F82E10045882C /* ScrollingCoordinatorIOS.mm in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAXObjectCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AXObjectCache.cpp (187581 => 187582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AXObjectCache.cpp        2015-07-30 09:52:48 UTC (rev 187581)
+++ trunk/Source/WebCore/accessibility/AXObjectCache.cpp        2015-07-30 11:10:38 UTC (rev 187582)
</span><span class="lines">@@ -55,6 +55,8 @@
</span><span class="cx"> #include &quot;AccessibilityTableColumn.h&quot;
</span><span class="cx"> #include &quot;AccessibilityTableHeaderContainer.h&quot;
</span><span class="cx"> #include &quot;AccessibilityTableRow.h&quot;
</span><ins>+#include &quot;AccessibilityTree.h&quot;
+#include &quot;AccessibilityTreeItem.h&quot;
</ins><span class="cx"> #include &quot;Document.h&quot;
</span><span class="cx"> #include &quot;Editor.h&quot;
</span><span class="cx"> #include &quot;ElementIterator.h&quot;
</span><span class="lines">@@ -291,6 +293,12 @@
</span><span class="cx">     if (nodeHasRole(node, &quot;gridcell&quot;) || nodeHasRole(node, &quot;cell&quot;) || nodeHasRole(node, &quot;columnheader&quot;) || nodeHasRole(node, &quot;rowheader&quot;))
</span><span class="cx">         return AccessibilityARIAGridCell::create(renderer);
</span><span class="cx"> 
</span><ins>+    // aria tree
+    if (nodeHasRole(node, &quot;tree&quot;))
+        return AccessibilityTree::create(renderer);
+    if (nodeHasRole(node, &quot;treeitem&quot;))
+        return AccessibilityTreeItem::create(renderer);
+
</ins><span class="cx"> #if ENABLE(VIDEO)
</span><span class="cx">     // media controls
</span><span class="cx">     if (node &amp;&amp; node-&gt;isMediaControlElement())
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.h (187581 => 187582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObject.h        2015-07-30 09:52:48 UTC (rev 187581)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.h        2015-07-30 11:10:38 UTC (rev 187582)
</span><span class="lines">@@ -772,6 +772,8 @@
</span><span class="cx">     virtual void addChildren() { }
</span><span class="cx">     virtual void addChild(AccessibilityObject*) { }
</span><span class="cx">     virtual void insertChild(AccessibilityObject*, unsigned) { }
</span><ins>+
+    virtual bool shouldIgnoreAttributeRole() const { return false; }
</ins><span class="cx">     
</span><span class="cx">     virtual bool canHaveChildren() const { return true; }
</span><span class="cx">     virtual bool hasChildren() const { return m_haveChildren; }
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (187581 => 187582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2015-07-30 09:52:48 UTC (rev 187581)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2015-07-30 11:10:38 UTC (rev 187582)
</span><span class="lines">@@ -2497,7 +2497,9 @@
</span><span class="cx">     if (!m_renderer)
</span><span class="cx">         return UnknownRole;
</span><span class="cx"> 
</span><del>-    if ((m_ariaRole = determineAriaRoleAttribute()) != UnknownRole)
</del><ins>+    // Sometimes we need to ignore the attribute role. Like if a tree is malformed,
+    // we want to ignore the treeitem's attribute role.
+    if ((m_ariaRole = determineAriaRoleAttribute()) != UnknownRole &amp;&amp; !shouldIgnoreAttributeRole())
</ins><span class="cx">         return m_ariaRole;
</span><span class="cx">     
</span><span class="cx">     Node* node = m_renderer-&gt;node();
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityTreecpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/accessibility/AccessibilityTree.cpp (0 => 187582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityTree.cpp                                (rev 0)
+++ trunk/Source/WebCore/accessibility/AccessibilityTree.cpp        2015-07-30 11:10:38 UTC (rev 187582)
</span><span class="lines">@@ -0,0 +1,99 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Inc. (&quot;Apple&quot;) nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;AccessibilityTree.h&quot;
+
+#include &quot;AXObjectCache.h&quot;
+#include &quot;AccessibilityTreeItem.h&quot;
+#include &quot;Element.h&quot;
+#include &quot;HTMLNames.h&quot;
+
+#include &lt;wtf/Deque.h&gt;
+
+namespace WebCore {
+
+using namespace HTMLNames;
+    
+AccessibilityTree::AccessibilityTree(RenderObject* renderer)
+    : AccessibilityRenderObject(renderer)
+{
+}
+    
+AccessibilityTree::~AccessibilityTree()
+{
+}
+    
+Ref&lt;AccessibilityTree&gt; AccessibilityTree::create(RenderObject* renderer)
+{
+    return adoptRef(*new AccessibilityTree(renderer));
+}
+    
+bool AccessibilityTree::computeAccessibilityIsIgnored() const
+{
+    return accessibilityIsIgnoredByDefault();
+}
+
+AccessibilityRole AccessibilityTree::determineAccessibilityRole()
+{
+    if ((m_ariaRole = determineAriaRoleAttribute()) != TreeRole)
+        return AccessibilityRenderObject::determineAccessibilityRole();
+
+    return isTreeValid() ? TreeRole : GroupRole;
+}
+
+bool AccessibilityTree::isTreeValid() const
+{
+    // A valid tree can only have treeitem or group of treeitems as a child
+    // http://www.w3.org/TR/wai-aria/roles#tree
+
+    Node* node = this-&gt;node();
+    if (!node)
+        return false;
+    
+    Deque&lt;Node*&gt; queue;
+    for (auto child = node-&gt;firstChild(); child; child = child-&gt;nextSibling())
+        queue.append(child);
+
+    while (!queue.isEmpty()) {
+        auto child = queue.takeFirst();
+
+        if (!is&lt;Element&gt;(*child))
+            continue;
+        if (nodeHasRole(child, &quot;treeitem&quot;))
+            continue;
+        if (!nodeHasRole(child, &quot;group&quot;))
+            return false;
+
+        for (auto groupChild = child-&gt;firstChild(); groupChild; groupChild = groupChild-&gt;nextSibling())
+            queue.append(groupChild);
+    }
+    return true;
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityTreeh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/accessibility/AccessibilityTree.h (0 => 187582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityTree.h                                (rev 0)
+++ trunk/Source/WebCore/accessibility/AccessibilityTree.h        2015-07-30 11:10:38 UTC (rev 187582)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Inc. (&quot;Apple&quot;) nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+#ifndef AccessibilityTree_h
+#define AccessibilityTree_h
+
+#include &quot;AccessibilityRenderObject.h&quot;
+
+namespace WebCore {
+    
+class AccessibilityTree final : public AccessibilityRenderObject {
+public:
+    static Ref&lt;AccessibilityTree&gt; create(RenderObject*);
+    virtual ~AccessibilityTree();
+
+private:
+    explicit AccessibilityTree(RenderObject*);
+    virtual bool computeAccessibilityIsIgnored() const override;
+    virtual AccessibilityRole determineAccessibilityRole() override;
+    bool isTreeValid() const;
+};
+    
+} // namespace WebCore
+
+SPECIALIZE_TYPE_TRAITS_ACCESSIBILITY(AccessibilityTree, isTree())
+
+#endif // AccessibilityTree_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityTreeItemcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/accessibility/AccessibilityTreeItem.cpp (0 => 187582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityTreeItem.cpp                                (rev 0)
+++ trunk/Source/WebCore/accessibility/AccessibilityTreeItem.cpp        2015-07-30 11:10:38 UTC (rev 187582)
</span><span class="lines">@@ -0,0 +1,65 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Inc. (&quot;Apple&quot;) nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;AccessibilityTreeItem.h&quot;
+
+#include &quot;AXObjectCache.h&quot;
+#include &quot;HTMLNames.h&quot;
+
+namespace WebCore {
+    
+using namespace HTMLNames;
+    
+AccessibilityTreeItem::AccessibilityTreeItem(RenderObject* renderer)
+    : AccessibilityRenderObject(renderer)
+{
+}
+    
+AccessibilityTreeItem::~AccessibilityTreeItem()
+{
+}
+    
+Ref&lt;AccessibilityTreeItem&gt; AccessibilityTreeItem::create(RenderObject* renderer)
+{
+    return adoptRef(*new AccessibilityTreeItem(renderer));
+}
+
+AccessibilityRole AccessibilityTreeItem::determineAccessibilityRole()
+{
+    
+    // Walk the parent chain looking for a parent that is a tree. A treeitem is
+    // only considered valid if it is in a tree.
+    AccessibilityObject* parent = nullptr;
+    for (parent = parentObject(); parent &amp;&amp; !parent-&gt;isTree(); parent = parent-&gt;parentObject()) { }
+    m_isTreeItemValid = parent;
+
+    return AccessibilityRenderObject::determineAccessibilityRole();
+}
+    
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityTreeItemh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/accessibility/AccessibilityTreeItem.h (0 => 187582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityTreeItem.h                                (rev 0)
+++ trunk/Source/WebCore/accessibility/AccessibilityTreeItem.h        2015-07-30 11:10:38 UTC (rev 187582)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Inc. (&quot;Apple&quot;) nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef AccessibilityTreeItem_h
+#define AccessibilityTreeItem_h
+
+#include &quot;AccessibilityRenderObject.h&quot;
+
+namespace WebCore {
+    
+class AccessibilityTreeItem final : public AccessibilityRenderObject {
+public:
+    static Ref&lt;AccessibilityTreeItem&gt; create(RenderObject*);
+    virtual ~AccessibilityTreeItem();
+
+    virtual bool shouldIgnoreAttributeRole() const override { return !m_isTreeItemValid; }
+
+private:
+    explicit AccessibilityTreeItem(RenderObject*);
+    virtual AccessibilityRole determineAccessibilityRole() override;
+    bool m_isTreeItemValid;
+};
+    
+} // namespace WebCore
+
+SPECIALIZE_TYPE_TRAITS_ACCESSIBILITY(AccessibilityTreeItem, isTreeItem())
+
+#endif // AccessibilityTreeItem_h
</ins></span></pre>
</div>
</div>

</body>
</html>