<!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>[200844] releases/WebKitGTK/webkit-2.12</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/200844">200844</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2016-05-13 04:51:43 -0700 (Fri, 13 May 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/200188">r200188</a> - AX: [ATK] We need to be smarter about flattening and the accessible text implementation
https://bugs.webkit.org/show_bug.cgi?id=144639

Reviewed by Chris Fleizach.

Source/WebCore:

Defer to WebCore Accessibility more regarding when to include anonymous blocks in the
accessibility tree. Explicitly flatten menu items, headings, list items, and paragraphs
in order to preserve the expected platform behavior for backwards compatibility. Also
map anonymous table parts to DivRole rather than GroupRole for GTK and EFL because ATK
has separate roles for generic text block elements and other generic containers.

Tests: accessibility/gtk/nested-block-element-children.html
       accessibility/gtk/spans-paragraphs-and-divs-tree.html

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
* accessibility/atk/AccessibilityObjectAtk.cpp:
(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):

LayoutTests:

Added two new tests and updated three existing tests to reflect the new behavior
regarding inclusion of elements in the accessibility tree and the text value of
included elements.

* accessibility/gtk/nested-block-element-children-expected.txt: Added.
* accessibility/gtk/nested-block-element-children.html: Added.
* accessibility/gtk/spans-paragraphs-and-divs-expected.txt: Updated for new behavior.
* accessibility/gtk/spans-paragraphs-and-divs-tree-expected.txt: Added.
* accessibility/gtk/spans-paragraphs-and-divs-tree.html: Added.
* accessibility/gtk/spans-paragraphs-and-divs.html: Updated for new behavior.
* platform/gtk/accessibility/generated-content-with-display-table-crash-expected.txt: Updated for new behavior.
* platform/gtk/accessibility/gtk/replaced-objects-in-anonymous-blocks-expected.txt: Updated for new behavior.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit212LayoutTestsChangeLog">releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit212LayoutTestsaccessibilitygtkspansparagraphsanddivsexpectedtxt">releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/spans-paragraphs-and-divs-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit212LayoutTestsaccessibilitygtkspansparagraphsanddivshtml">releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/spans-paragraphs-and-divs.html</a></li>
<li><a href="#releasesWebKitGTKwebkit212LayoutTestsplatformgtkaccessibilitygeneratedcontentwithdisplaytablecrashexpectedtxt">releases/WebKitGTK/webkit-2.12/LayoutTests/platform/gtk/accessibility/generated-content-with-display-table-crash-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit212LayoutTestsplatformgtkaccessibilitygtkreplacedobjectsinanonymousblocksexpectedtxt">releases/WebKitGTK/webkit-2.12/LayoutTests/platform/gtk/accessibility/gtk/replaced-objects-in-anonymous-blocks-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit212SourceWebCoreChangeLog">releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit212SourceWebCoreaccessibilityAccessibilityRenderObjectcpp">releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityRenderObject.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit212SourceWebCoreaccessibilityatkAccessibilityObjectAtkcpp">releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/atk/AccessibilityObjectAtk.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit212LayoutTestsaccessibilitygtknestedblockelementchildrenexpectedtxt">releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/nested-block-element-children-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit212LayoutTestsaccessibilitygtknestedblockelementchildrenhtml">releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/nested-block-element-children.html</a></li>
<li><a href="#releasesWebKitGTKwebkit212LayoutTestsaccessibilitygtkspansparagraphsanddivstreeexpectedtxt">releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/spans-paragraphs-and-divs-tree-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit212LayoutTestsaccessibilitygtkspansparagraphsanddivstreehtml">releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/spans-paragraphs-and-divs-tree.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit212LayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog (200843 => 200844)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog        2016-05-13 11:49:56 UTC (rev 200843)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog        2016-05-13 11:51:43 UTC (rev 200844)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2016-04-28  Joanmarie Diggs  &lt;jdiggs@igalia.com&gt;
+
+        AX: [ATK] We need to be smarter about flattening and the accessible text implementation
+        https://bugs.webkit.org/show_bug.cgi?id=144639
+
+        Reviewed by Chris Fleizach.
+
+        Added two new tests and updated three existing tests to reflect the new behavior
+        regarding inclusion of elements in the accessibility tree and the text value of
+        included elements.
+
+        * accessibility/gtk/nested-block-element-children-expected.txt: Added.
+        * accessibility/gtk/nested-block-element-children.html: Added.
+        * accessibility/gtk/spans-paragraphs-and-divs-expected.txt: Updated for new behavior.
+        * accessibility/gtk/spans-paragraphs-and-divs-tree-expected.txt: Added.
+        * accessibility/gtk/spans-paragraphs-and-divs-tree.html: Added.
+        * accessibility/gtk/spans-paragraphs-and-divs.html: Updated for new behavior.
+        * platform/gtk/accessibility/generated-content-with-display-table-crash-expected.txt: Updated for new behavior.
+        * platform/gtk/accessibility/gtk/replaced-objects-in-anonymous-blocks-expected.txt: Updated for new behavior.
+
</ins><span class="cx"> 2016-04-27  Hunseop Jeong  &lt;hs85.jeong@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [EFL][GTK] Volume slider only changes volume when thumb is released, not while dragging
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit212LayoutTestsaccessibilitygtknestedblockelementchildrenexpectedtxt"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/nested-block-element-children-expected.txt (0 => 200844)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/nested-block-element-children-expected.txt                                (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/nested-block-element-children-expected.txt        2016-05-13 11:51:43 UTC (rev 200844)
</span><span class="lines">@@ -0,0 +1,47 @@
</span><ins>+AXRole: AXWebArea 
+    AXRole: AXSection AXValue: Test 1
+    AXRole: AXHeading AXValue: Test 1
+        AXRole: AXLink AXValue: Test 1
+    AXRole: AXHeading AXValue: Test 1
+    AXRole: AXParagraph AXValue: Test 1
+    AXRole: AXHeading AXValue: Test 2
+        AXRole: AXLink AXValue: Test 2
+    AXRole: AXHeading AXValue: Test 2
+    AXRole: AXParagraph AXValue: Test 2
+    AXRole: AXSection AXValue: Test 3
+    AXRole: AXHeading AXValue: Test 3
+        AXRole: AXLink AXValue: Test 3
+    AXRole: AXHeading AXValue: Test 3
+    AXRole: AXHeading AXValue: Test 3
+    AXRole: AXParagraph AXValue: Test 3
+    AXRole: AXHeading AXValue: Test 4
+        AXRole: AXLink AXValue: Test 4
+    AXRole: AXHeading AXValue: Test 4
+    AXRole: AXParagraph AXValue: Test 4
+    AXRole: AXSection AXValue: Test 5
+    AXRole: AXSection AXValue: Test 5
+    AXRole: AXSection AXValue: Test 5&lt;\n&gt;
+    AXRole: AXParagraph AXValue: Test 6
+    AXRole: AXParagraph AXValue: Test 7
+    AXRole: AXParagraph AXValue: Test 8&lt;\n&gt;
+    AXRole: AXParagraph AXValue: Test 9 Test 9
+    AXRole: AXParagraph AXValue: Test 10&lt;\n&gt;Test 10&lt;\n&gt;
+    AXRole: AXParagraph AXValue: Test 11 Test 11&lt;\n&gt;Test 11&lt;\n&gt;
+    AXRole: AXParagraph AXValue: &lt;obj&gt;
+        AXRole: AXButton 
+    AXRole: AXParagraph AXValue: Test 13  &lt;obj&gt;
+        AXRole: AXButton 
+    AXRole: AXParagraph AXValue: Test 14  &lt;obj&gt;
+        AXRole: AXButton 
+    AXRole: AXParagraph AXValue: &lt;obj&gt;&lt;\n&gt;Test 15&lt;\n&gt;
+        AXRole: AXButton 
+    AXRole: AXSection AXValue: End of test
+This verifies the accessibility tree when there are nested block element children.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit212LayoutTestsaccessibilitygtknestedblockelementchildrenhtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/nested-block-element-children.html (0 => 200844)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/nested-block-element-children.html                                (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/nested-block-element-children.html        2016-05-13 11:51:43 UTC (rev 200844)
</span><span class="lines">@@ -0,0 +1,94 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;style&gt;
+.cell { display:table-cell; width:100px; border:solid red; }
+&lt;/style&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../resources/accessibility-helper.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body id=&quot;body&quot;&gt;
+&lt;div id=&quot;content&quot;&gt;
+  &lt;div&gt;
+    &lt;span&gt;Test 1&lt;/span&gt;
+    &lt;h1&gt;&lt;a href=&quot;foo&quot;&gt;Test 1&lt;/a&gt;&lt;/h1&gt;
+    &lt;h2&gt;Test 1&lt;/h2&gt;
+    &lt;p&gt;Test 1&lt;/p&gt;
+  &lt;/div&gt;
+  &lt;div&gt;
+    &lt;span style=&quot;display:block;&quot;&gt;Test 2&lt;/span&gt;
+    &lt;h1&gt;&lt;a href=&quot;foo&quot;&gt;Test 2&lt;/a&gt;&lt;/h1&gt;
+    &lt;h2&gt;Test 2&lt;/h2&gt;
+    &lt;p&gt;Test 2&lt;/p&gt;
+  &lt;/div&gt;
+  &lt;div&gt;
+    Test 3
+    &lt;h1&gt;&lt;a href=&quot;foo&quot;&gt;Test 3&lt;/a&gt;&lt;/h1&gt;
+    &lt;h1&gt;Test 3&lt;/h1&gt;
+    &lt;h2&gt;Test 3&lt;/h2&gt;
+    &lt;p&gt;Test 3&lt;/p&gt;
+  &lt;/div&gt;
+  &lt;div&gt;
+    &lt;h1&gt;&lt;a href=&quot;foo&quot;&gt;Test 4&lt;/a&gt;&lt;/h1&gt;
+    &lt;h2&gt;Test 4&lt;/h2&gt;
+    &lt;p&gt;Test 4&lt;/p&gt;
+  &lt;/div&gt;
+  &lt;div style=&quot;display:table;&quot;&gt;
+    &lt;div style=&quot;display:table-row;&quot;&gt;
+      &lt;div class=&quot;cell&quot;&gt;Test 5&lt;/div&gt;
+      &lt;div class=&quot;cell&quot;&gt;&lt;span&gt;Test 5&lt;/span&gt;&lt;/div&gt;
+      &lt;div class=&quot;cell&quot;&gt;&lt;span style=&quot;display:block&quot;&gt;Test 5&lt;/span&gt;&lt;/div&gt;
+    &lt;/div&gt;
+  &lt;/div&gt;
+  &lt;p&gt;Test 6&lt;/p&gt;
+  &lt;p&gt;
+    &lt;span&gt;Test 7&lt;/span&gt;
+  &lt;/p&gt;
+  &lt;p&gt;
+    &lt;span style=&quot;display:block;&quot;&gt;Test 8&lt;/span&gt;
+  &lt;/p&gt;
+  &lt;p&gt;
+    Test 9
+    &lt;span&gt;Test 9&lt;/span&gt;
+  &lt;/p&gt;
+  &lt;p&gt;
+    Test 10
+    &lt;span style=&quot;display:block;&quot;&gt;Test 10&lt;/span&gt;
+  &lt;/p&gt;
+  &lt;p&gt;
+    Test 11
+    &lt;span&gt;Test 11&lt;/span&gt;
+    &lt;span style=&quot;display:block;&quot;&gt;Test 11&lt;/span&gt;
+  &lt;/p&gt;
+  &lt;p&gt;
+    &lt;button&gt;Test 12&lt;/button&gt;
+  &lt;/p&gt;
+  &lt;p&gt;
+    Test 13
+    &lt;button&gt;Test 13&lt;/button&gt;
+  &lt;/p&gt;
+  &lt;p&gt;
+    &lt;span&gt;Test 14&lt;/span&gt;
+    &lt;button&gt;Test 14&lt;/button&gt;
+  &lt;/p&gt;
+  &lt;p&gt;
+    &lt;button&gt;Test 15&lt;/button&gt;
+    &lt;span style=&quot;display:block;&quot;&gt;Test 15&lt;/span&gt;
+  &lt;/p&gt;
+  &lt;div id=&quot;stopElement&quot;&gt;End of test&lt;/div&gt;
+&lt;/div&gt;
+&lt;pre id=&quot;tree&quot;&gt;&lt;/pre&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 verifies the accessibility tree when there are nested block element children.&quot;);
+    if (window.accessibilityController) {
+        document.body.focus();
+        var stopElement = accessibilityController.accessibleElementById(&quot;stopElement&quot;);
+        dumpAccessibilityTree(accessibilityController.focusedElement, stopElement, 0);
+    }
+    document.getElementById(&quot;content&quot;).style.visibility = &quot;hidden&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></pre></div>
<a id="releasesWebKitGTKwebkit212LayoutTestsaccessibilitygtkspansparagraphsanddivsexpectedtxt"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/spans-paragraphs-and-divs-expected.txt (200843 => 200844)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/spans-paragraphs-and-divs-expected.txt        2016-05-13 11:49:56 UTC (rev 200843)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/spans-paragraphs-and-divs-expected.txt        2016-05-13 11:51:43 UTC (rev 200844)
</span><span class="lines">@@ -34,11 +34,9 @@
</span><span class="cx"> PASS link.childrenCount is 0
</span><span class="cx"> PASS element.role is 'AXRole: AXParagraph'
</span><span class="cx"> PASS element.childrenCount is 0
</span><ins>+PASS element.role is 'AXRole: AXLink'
+PASS element.childrenCount is 0
</ins><span class="cx"> PASS element.role is 'AXRole: AXSection'
</span><del>-PASS element.childrenCount is 1
-PASS link.role is 'AXRole: AXLink'
-PASS link.childrenCount is 0
-PASS element.role is 'AXRole: AXSection'
</del><span class="cx"> PASS element.childrenCount is 0
</span><span class="cx"> PASS element.role is 'AXRole: AXSection'
</span><span class="cx"> PASS element.childrenCount is 1
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit212LayoutTestsaccessibilitygtkspansparagraphsanddivstreeexpectedtxt"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/spans-paragraphs-and-divs-tree-expected.txt (0 => 200844)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/spans-paragraphs-and-divs-tree-expected.txt                                (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/spans-paragraphs-and-divs-tree-expected.txt        2016-05-13 11:51:43 UTC (rev 200844)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+AXRole: AXWebArea 
+    AXRole: AXParagraph AXValue: Block span in a link in a paragraph&lt;\n&gt;Inline span in a link in a paragraph
+        AXRole: AXLink AXValue: Block span in a link in a paragraph&lt;\n&gt;Inline span in a link in a paragraph
+    AXRole: AXParagraph AXValue: Block span in a paragraph&lt;\n&gt;Inline span in a paragraph
+    AXRole: AXParagraph AXValue: Inline span in a link in a paragraph&lt;\n&gt;Block span in a link in a paragraph&lt;\n&gt;
+        AXRole: AXLink AXValue: Inline span in a link in a paragraph&lt;\n&gt;Block span in a link in a paragraph&lt;\n&gt;
+    AXRole: AXParagraph AXValue: Inline span in a paragraph&lt;\n&gt;Block span in a paragraph&lt;\n&gt;
+    AXRole: AXLink AXValue: Block span in a link in a div&lt;\n&gt;Inline span in a link in a div
+    AXRole: AXSection AXValue: Inline span in a div
+    AXRole: AXSection AXValue: Inline span in a link in a div&lt;\n&gt;Block span in a link in a div&lt;\n&gt;
+        AXRole: AXLink AXValue: Inline span in a link in a div&lt;\n&gt;Block span in a link in a div&lt;\n&gt;
+    AXRole: AXSection AXValue: Inline span in a div
+    AXRole: AXSection AXValue: End of test
+This verifies the accessibility tree of spans, paragraphs, and divs.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit212LayoutTestsaccessibilitygtkspansparagraphsanddivstreehtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/spans-paragraphs-and-divs-tree.html (0 => 200844)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/spans-paragraphs-and-divs-tree.html                                (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/spans-paragraphs-and-divs-tree.html        2016-05-13 11:51:43 UTC (rev 200844)
</span><span class="lines">@@ -0,0 +1,66 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../resources/accessibility-helper.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body id=&quot;body&quot;&gt;
+&lt;div id=&quot;content&quot;&gt;
+  &lt;p&gt;
+    &lt;a href='foo'&gt;
+       &lt;span style='display:block;'&gt;Block span in a link in a paragraph&lt;/span&gt;
+       &lt;span&gt;Inline span in a link in a paragraph&lt;/span&gt;
+    &lt;/a&gt;
+  &lt;/p&gt;
+  &lt;p&gt;
+    &lt;span style='display:block;'&gt;Block span in a paragraph&lt;/span&gt;
+    &lt;span&gt;Inline span in a paragraph&lt;/span&gt;
+  &lt;/p&gt;
+  &lt;p&gt;
+    &lt;a href='foo'&gt;
+       &lt;span&gt;Inline span in a link in a paragraph&lt;/span&gt;
+       &lt;span style='display:block;'&gt;Block span in a link in a paragraph&lt;/span&gt;
+    &lt;/a&gt;
+  &lt;/p&gt;
+  &lt;p&gt;
+    &lt;span&gt;Inline span in a paragraph&lt;/span&gt;
+    &lt;span style='display:block;'&gt;Block span in a paragraph&lt;/span&gt;
+  &lt;/p&gt;
+  &lt;div&gt;
+    &lt;a href='foo'&gt;
+       &lt;span style='display:block;'&gt;Block span in a link in a div&lt;/span&gt;
+       &lt;span&gt;Inline span in a link in a div&lt;/span&gt;
+    &lt;/a&gt;
+  &lt;/div&gt;
+  &lt;div&gt;
+    &lt;span style='display:block;'&gt;Block span in a div&lt;/span&gt;
+    &lt;span&gt;Inline span in a div&lt;/span&gt;
+  &lt;/div&gt;
+  &lt;div&gt;
+    &lt;a href='foo'&gt;
+       &lt;span&gt;Inline span in a link in a div&lt;/span&gt;
+       &lt;span style='display:block;'&gt;Block span in a link in a div&lt;/span&gt;
+    &lt;/a&gt;
+  &lt;/div&gt;
+  &lt;div&gt;
+    &lt;span&gt;Inline span in a div&lt;/span&gt;
+    &lt;span style='display:block;'&gt;Block span in a div&lt;/span&gt;
+  &lt;/div&gt;
+
+&lt;div id=&quot;stopElement&quot;&gt;End of test&lt;/div&gt;
+&lt;/div&gt;
+&lt;pre id=&quot;tree&quot;&gt;&lt;/pre&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 verifies the accessibility tree of spans, paragraphs, and divs.&quot;);
+    if (window.accessibilityController) {
+        document.body.focus();
+        var stopElement = accessibilityController.accessibleElementById(&quot;stopElement&quot;);
+        dumpAccessibilityTree(accessibilityController.focusedElement, stopElement, 0);
+    }
+    document.getElementById(&quot;content&quot;).style.visibility = &quot;hidden&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></pre></div>
<a id="releasesWebKitGTKwebkit212LayoutTestsaccessibilitygtkspansparagraphsanddivshtml"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/spans-paragraphs-and-divs.html (200843 => 200844)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/spans-paragraphs-and-divs.html        2016-05-13 11:49:56 UTC (rev 200843)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/spans-paragraphs-and-divs.html        2016-05-13 11:51:43 UTC (rev 200844)
</span><span class="lines">@@ -83,13 +83,9 @@
</span><span class="cx">     shouldBe(&quot;element.childrenCount&quot;, &quot;0&quot;);
</span><span class="cx"> 
</span><span class="cx">     element = webArea.childAtIndex(4);
</span><del>-    shouldBe(&quot;element.role&quot;, &quot;'AXRole: AXSection'&quot;);
-    shouldBe(&quot;element.childrenCount&quot;, &quot;1&quot;);
</del><ins>+    shouldBe(&quot;element.role&quot;, &quot;'AXRole: AXLink'&quot;);
+    shouldBe(&quot;element.childrenCount&quot;, &quot;0&quot;);
</ins><span class="cx"> 
</span><del>-    link = element.childAtIndex(0);
-    shouldBe(&quot;link.role&quot;, &quot;'AXRole: AXLink'&quot;);
-    shouldBe(&quot;link.childrenCount&quot;, &quot;0&quot;);
-
</del><span class="cx">     element = webArea.childAtIndex(5);
</span><span class="cx">     shouldBe(&quot;element.role&quot;, &quot;'AXRole: AXSection'&quot;);
</span><span class="cx">     shouldBe(&quot;element.childrenCount&quot;, &quot;0&quot;);
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit212LayoutTestsplatformgtkaccessibilitygeneratedcontentwithdisplaytablecrashexpectedtxt"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/platform/gtk/accessibility/generated-content-with-display-table-crash-expected.txt (200843 => 200844)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/LayoutTests/platform/gtk/accessibility/generated-content-with-display-table-crash-expected.txt        2016-05-13 11:49:56 UTC (rev 200843)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/platform/gtk/accessibility/generated-content-with-display-table-crash-expected.txt        2016-05-13 11:51:43 UTC (rev 200844)
</span><span class="lines">@@ -4,7 +4,8 @@
</span><span class="cx"> End of test
</span><span class="cx"> AXRole: AXWebArea 
</span><span class="cx">     AXRole: AXSection AXValue: foo !
</span><del>-    AXRole: AXSection AXValue: bar !
</del><ins>+    AXRole: AXSection AXValue: bar
+    AXRole: AXSection AXValue: !
</ins><span class="cx">     AXRole: AXSection AXValue: baz
</span><span class="cx">     AXRole: AXSection AXValue: End of test
</span><span class="cx"> This verifies that getting content of an element with generated content in CSS table doesn't cause a crash.
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit212LayoutTestsplatformgtkaccessibilitygtkreplacedobjectsinanonymousblocksexpectedtxt"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/platform/gtk/accessibility/gtk/replaced-objects-in-anonymous-blocks-expected.txt (200843 => 200844)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/LayoutTests/platform/gtk/accessibility/gtk/replaced-objects-in-anonymous-blocks-expected.txt        2016-05-13 11:49:56 UTC (rev 200843)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/platform/gtk/accessibility/gtk/replaced-objects-in-anonymous-blocks-expected.txt        2016-05-13 11:51:43 UTC (rev 200844)
</span><span class="lines">@@ -20,7 +20,8 @@
</span><span class="cx">                 AXRole: AXWebArea 
</span><span class="cx">     AXRole: AXSection AXValue: &lt;obj&gt;
</span><span class="cx">         AXRole: AXTextField AXValue: text area
</span><del>-    AXRole: AXSection AXValue: Div&lt;\n&gt;&lt;obj&gt;
</del><ins>+    AXRole: AXSection AXValue: Div
+    AXRole: AXSection AXValue: &lt;obj&gt;
</ins><span class="cx">         AXRole: AXButton 
</span><span class="cx">     AXRole: AXHeading AXValue: Heading&lt;\n&gt;&lt;obj&gt;&lt;\n&gt;&lt;obj&gt;
</span><span class="cx">         AXRole: AXButton 
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit212SourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog (200843 => 200844)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog        2016-05-13 11:49:56 UTC (rev 200843)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog        2016-05-13 11:51:43 UTC (rev 200844)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2016-04-28  Joanmarie Diggs  &lt;jdiggs@igalia.com&gt;
+
+        AX: [ATK] We need to be smarter about flattening and the accessible text implementation
+        https://bugs.webkit.org/show_bug.cgi?id=144639
+
+        Reviewed by Chris Fleizach.
+
+        Defer to WebCore Accessibility more regarding when to include anonymous blocks in the
+        accessibility tree. Explicitly flatten menu items, headings, list items, and paragraphs
+        in order to preserve the expected platform behavior for backwards compatibility. Also
+        map anonymous table parts to DivRole rather than GroupRole for GTK and EFL because ATK
+        has separate roles for generic text block elements and other generic containers.
+
+        Tests: accessibility/gtk/nested-block-element-children.html
+               accessibility/gtk/spans-paragraphs-and-divs-tree.html
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
+        * accessibility/atk/AccessibilityObjectAtk.cpp:
+        (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
+
</ins><span class="cx"> 2016-04-28  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION(r199659): Web Process crash when RenderTheme::adjustMenuListStyle is called with a null element
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit212SourceWebCoreaccessibilityAccessibilityRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (200843 => 200844)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2016-05-13 11:49:56 UTC (rev 200843)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2016-05-13 11:51:43 UTC (rev 200844)
</span><span class="lines">@@ -86,6 +86,7 @@
</span><span class="cx"> #include &quot;RenderMenuList.h&quot;
</span><span class="cx"> #include &quot;RenderSVGRoot.h&quot;
</span><span class="cx"> #include &quot;RenderSVGShape.h&quot;
</span><ins>+#include &quot;RenderTableCell.h&quot;
</ins><span class="cx"> #include &quot;RenderText.h&quot;
</span><span class="cx"> #include &quot;RenderTextControl.h&quot;
</span><span class="cx"> #include &quot;RenderTextControlSingleLine.h&quot;
</span><span class="lines">@@ -2640,7 +2641,7 @@
</span><span class="cx">     // the cell should not be treated as a cell (e.g. because it is a layout table.
</span><span class="cx">     // In ATK, there is a distinction between generic text block elements and other
</span><span class="cx">     // generic containers; AX API does not make this distinction.
</span><del>-    if (node &amp;&amp; (node-&gt;hasTagName(tdTag) || node-&gt;hasTagName(thTag)))
</del><ins>+    if (is&lt;RenderTableCell&gt;(m_renderer))
</ins><span class="cx"> #if PLATFORM(GTK) || PLATFORM(EFL)
</span><span class="cx">         return DivRole;
</span><span class="cx"> #else
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit212SourceWebCoreaccessibilityatkAccessibilityObjectAtkcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/atk/AccessibilityObjectAtk.cpp (200843 => 200844)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/atk/AccessibilityObjectAtk.cpp        2016-05-13 11:49:56 UTC (rev 200843)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/atk/AccessibilityObjectAtk.cpp        2016-05-13 11:51:43 UTC (rev 200844)
</span><span class="lines">@@ -21,8 +21,11 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;AccessibilityObject.h&quot;
</span><span class="cx"> 
</span><del>-#include &quot;HTMLElement.h&quot;
-#include &quot;HTMLNames.h&quot;
</del><ins>+#include &quot;HTMLSpanElement.h&quot;
+#include &quot;RenderBlock.h&quot;
+#include &quot;RenderInline.h&quot;
+#include &quot;RenderIterator.h&quot;
+#include &quot;RenderTableCell.h&quot;
</ins><span class="cx"> #include &quot;RenderText.h&quot;
</span><span class="cx"> #include &quot;TextControlInnerElements.h&quot;
</span><span class="cx"> #include &lt;glib-object.h&gt;
</span><span class="lines">@@ -85,16 +88,57 @@
</span><span class="cx">     if (!renderObject)
</span><span class="cx">         return DefaultBehavior;
</span><span class="cx"> 
</span><del>-    // The text displayed by an ARIA menu item is exposed through the accessible name.
-    if (renderObject-&gt;isAnonymousBlock() &amp;&amp; parent-&gt;isMenuItem())
-        return IgnoreObject;
</del><ins>+    // We always want to include paragraphs that have rendered content.
+    // WebCore Accessibility does so unless there is a RenderBlock child.
+    if (role == ParagraphRole) {
+        auto child = childrenOfType&lt;RenderBlock&gt;(downcast&lt;RenderElement&gt;(*renderObject)).first();
+        return child ? IncludeObject : DefaultBehavior;
+    }
</ins><span class="cx"> 
</span><ins>+    // We always want to include table cells (layout and CSS) that have rendered text content.
+    if (is&lt;RenderTableCell&gt;(renderObject)) {
+        for (const auto&amp; child : childrenOfType&lt;RenderObject&gt;(downcast&lt;RenderElement&gt;(*renderObject))) {
+            if (is&lt;RenderInline&gt;(child) || is&lt;RenderText&gt;(child) || is&lt;HTMLSpanElement&gt;(child.node()))
+                return IncludeObject;
+        }
+        return DefaultBehavior;
+    }
+
+    if (renderObject-&gt;isAnonymousBlock()) {
+        // The text displayed by an ARIA menu item is exposed through the accessible name.
+        if (parent-&gt;isMenuItem())
+            return IgnoreObject;
+
+        // The text displayed in headings is typically exposed in the heading itself.
+        if (parent-&gt;isHeading())
+            return IgnoreObject;
+
+        // The text displayed in list items is typically exposed in the list item itself.
+        if (parent-&gt;isListItem())
+            return IgnoreObject;
+
+        // The text displayed in links is typically exposed in the link itself.
+        if (parent-&gt;isLink())
+            return IgnoreObject;
+
+        // FIXME: This next one needs some further consideration. But paragraphs are not
+        // typically huge (like divs). And ignoring anonymous block children of paragraphs
+        // will preserve existing behavior.
+        if (parent-&gt;roleValue() == ParagraphRole)
+            return IgnoreObject;
+
+        return DefaultBehavior;
+    }
+
+    Node* node = renderObject-&gt;node();
+    if (!node)
+        return DefaultBehavior;
+
</ins><span class="cx">     // We don't want &lt;span&gt; elements to show up in the accessibility hierarchy unless
</span><span class="cx">     // we have good reasons for that (e.g. focusable or visible because of containing
</span><span class="cx">     // a meaningful accessible name, maybe set through ARIA), so we can use
</span><span class="cx">     // atk_component_grab_focus() to set the focus to it.
</span><del>-    Node* node = renderObject-&gt;node();
-    if (node &amp;&amp; node-&gt;hasTagName(HTMLNames::spanTag) &amp;&amp; !canSetFocusAttribute() &amp;&amp; !hasAttributesRequiredForInclusion())
</del><ins>+    if (is&lt;HTMLSpanElement&gt;(node) &amp;&amp; !canSetFocusAttribute() &amp;&amp; !hasAttributesRequiredForInclusion())
</ins><span class="cx">         return IgnoreObject;
</span><span class="cx"> 
</span><span class="cx">     // If we include TextControlInnerTextElement children, changes to those children
</span><span class="lines">@@ -104,41 +148,6 @@
</span><span class="cx">     if (is&lt;TextControlInnerTextElement&gt;(node))
</span><span class="cx">         return IgnoreObject;
</span><span class="cx"> 
</span><del>-    // Given a paragraph or div containing a non-nested anonymous block, WebCore
-    // ignores the paragraph or div and includes the block. We want the opposite:
-    // ATs are expecting accessible objects associated with textual elements. They
-    // usually have no need for the anonymous block. And when the wrong objects
-    // get included or ignored, needed accessibility signals do not get emitted.
-    if (role == ParagraphRole || role == DivRole) {
-        // Don't call textUnderElement() here, because it's slow and it can
-        // crash when called while we're in the middle of a subtree being deleted.
-        if (!renderObject-&gt;firstChildSlow())
-            return DefaultBehavior;
-
-        if (!parent-&gt;renderer() || parent-&gt;renderer()-&gt;isAnonymousBlock())
-            return DefaultBehavior;
-
-        for (RenderObject* r = renderObject-&gt;firstChildSlow(); r; r = r-&gt;nextSibling()) {
-            if (r-&gt;isAnonymousBlock())
-                return IncludeObject;
-        }
-    }
-
-    // Block spans result in objects of ATK_ROLE_PANEL which are almost always unwanted.
-    // However, if we ignore block spans whose parent is the body, the child controls
-    // will become immediate children of the ATK_ROLE_DOCUMENT_FRAME and any text will
-    // become text within the document frame itself. This ultimately may be what we want
-    // and would largely be consistent with what we see from Gecko. However, ignoring
-    // spans whose parent is the body changes the current behavior we see from WebCore.
-    // Until we have sufficient time to properly analyze these cases, we will defer to
-    // WebCore. We only check that the parent is not aria because we do not expect
-    // anonymous blocks which are aria-related to themselves have an aria role, nor
-    // have we encountered instances where the parent of an anonymous block also lacked
-    // an aria role but the grandparent had one.
-    if (renderObject &amp;&amp; renderObject-&gt;isAnonymousBlock() &amp;&amp; !parent-&gt;renderer()-&gt;isBody()
-        &amp;&amp; parent-&gt;ariaRoleAttribute() == UnknownRole)
-        return IgnoreObject;
-
</del><span class="cx">     return DefaultBehavior;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>