<!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>[201269] 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/201269">201269</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2016-05-23 04:02:42 -0700 (Mon, 23 May 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/200369">r200369</a> - [ATK] accessibility/content-editable-as-textarea.html fails
https://bugs.webkit.org/show_bug.cgi?id=155353

Reviewed by Darin Adler.

Source/WebCore:

The test was timing out because it expected an AXValueChanged notification.
In ATK, AXValueChanged notifications are made for widgets which implement
the AtkValue interface (sliders, progress bars, etc.). We should be listening
for AXTextChanged instead.

In addition, for contenteditable elements, we should emit the notification on
the element itself. Because we were handling the notification in the same way
as native text controls (where the notification we receive from WebCore is for
StaticTextRole children), we were attempting to emit the notification from
the parent of the contenteditable.

Lastly, ATK's AccessibilityUIElement support had a number of unimplemented
methods that are being used as part of the previously-failing test. Those
methods are now implemented so that the ATK results are much more similar
to those on the Mac.

No new tests needed. The previously-failing test now passes.

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::childrenChanged):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isNonNativeTextControl):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::textChanged):
* accessibility/atk/AXObjectCacheAtk.cpp:
(WebCore::AXObjectCache::nodeTextChangePlatformNotification):

Tools:

The test was timing out because it expected an AXValueChanged notification.
In ATK, AXValueChanged notifications are made for widgets which implement
the AtkValue interface (sliders, progress bars, etc.). We should be listening
for AXTextChanged instead. AtkText's text-insert and text-remove have been
added to the AccessibilityNotificationHandler.

Also, ATK's AccessibilityUIElement support had a number of unimplemented
methods that are being used as part of the previously-failing test. Those
methods are now implemented so that the ATK results are much more similar
to those on the Mac.

* WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp:
(WTR::AccessibilityNotificationHandler::connectAccessibilityCallbacks):
* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::stringAttributeValue):
(WTR::AccessibilityUIElement::rangeForLine):
(WTR::AccessibilityUIElement::boundsForRange):
(WTR::AccessibilityUIElement::attributedStringForRange):

LayoutTests:

Updated the test identified in the bug to listen for the appropriate
notification for ATK and created platform-specific expectations.

In addition, set-selected-text-range-contenteditable.html was timing out
due to the use of shouldBecomeEqual() with an assertion that is wrong for
ATK. Modifying the test so that it verifies the result appropriate for
each platform eliminates the timeout.

* accessibility/content-editable-as-textarea.html: Updated.
* accessibility/set-selected-text-range-contenteditable.html: Updated.
* platform/gtk/TestExpectations: Unskipped the failing tests.
* platform/gtk/accessibility/content-editable-as-textarea-expected.txt: Added.
* platform/gtk/accessibility/set-selected-text-range-contenteditable-expected.txt: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit212LayoutTestsChangeLog">releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit212LayoutTestsaccessibilitycontenteditableastextareahtml">releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/content-editable-as-textarea.html</a></li>
<li><a href="#releasesWebKitGTKwebkit212SourceWebCoreChangeLog">releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit212SourceWebCoreaccessibilityAccessibilityNodeObjectcpp">releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityNodeObject.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit212SourceWebCoreaccessibilityAccessibilityObjectcpp">releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityObject.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit212SourceWebCoreaccessibilityAccessibilityObjecth">releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityObject.h</a></li>
<li><a href="#releasesWebKitGTKwebkit212SourceWebCoreaccessibilityAccessibilityRenderObjectcpp">releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityRenderObject.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit212SourceWebCoreaccessibilityatkAXObjectCacheAtkcpp">releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/atk/AXObjectCacheAtk.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit212ToolsChangeLog">releases/WebKitGTK/webkit-2.12/Tools/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit212ToolsWebKitTestRunnerInjectedBundleatkAccessibilityNotificationHandlerAtkcpp">releases/WebKitGTK/webkit-2.12/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit212ToolsWebKitTestRunnerInjectedBundleatkAccessibilityUIElementAtkcpp">releases/WebKitGTK/webkit-2.12/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit212LayoutTestsplatformgtkaccessibilitycontenteditableastextareaexpectedtxt">releases/WebKitGTK/webkit-2.12/LayoutTests/platform/gtk/accessibility/content-editable-as-textarea-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit212LayoutTestsplatformgtkaccessibilitysetselectedtextrangecontenteditableexpectedtxt">releases/WebKitGTK/webkit-2.12/LayoutTests/platform/gtk/accessibility/set-selected-text-range-contenteditable-expected.txt</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 (201268 => 201269)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog        2016-05-23 10:45:53 UTC (rev 201268)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog        2016-05-23 11:02:42 UTC (rev 201269)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2016-05-03  Joanmarie Diggs  &lt;jdiggs@igalia.com&gt;
+
+        [ATK] accessibility/content-editable-as-textarea.html fails
+        https://bugs.webkit.org/show_bug.cgi?id=155353
+
+        Reviewed by Darin Adler.
+
+        Updated the test identified in the bug to listen for the appropriate
+        notification for ATK and created platform-specific expectations.
+
+        In addition, set-selected-text-range-contenteditable.html was timing out
+        due to the use of shouldBecomeEqual() with an assertion that is wrong for
+        ATK. Modifying the test so that it verifies the result appropriate for
+        each platform eliminates the timeout.
+
+        * accessibility/content-editable-as-textarea.html: Updated.
+        * accessibility/set-selected-text-range-contenteditable.html: Updated.
+        * platform/gtk/TestExpectations: Unskipped the failing tests.
+        * platform/gtk/accessibility/content-editable-as-textarea-expected.txt: Added.
+        * platform/gtk/accessibility/set-selected-text-range-contenteditable-expected.txt: Added.
+
</ins><span class="cx"> 2016-05-10  Zalan Bujtas  &lt;zalan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r193610): Drop down menu doesn’t expand at allofbach.com
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit212LayoutTestsaccessibilitycontenteditableastextareahtml"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/content-editable-as-textarea.html (201268 => 201269)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/content-editable-as-textarea.html        2016-05-23 10:45:53 UTC (rev 201268)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/content-editable-as-textarea.html        2016-05-23 11:02:42 UTC (rev 201269)
</span><span class="lines">@@ -19,8 +19,9 @@
</span><span class="cx"> 
</span><span class="cx">     var notification = 0;
</span><span class="cx">     var textArea = 0;
</span><ins>+    var notificationType = &quot;AXValueChanged&quot;;
</ins><span class="cx">     function callback(notification) {
</span><del>-        if (notification == &quot;AXValueChanged&quot;) {
</del><ins>+        if (notification == notificationType) {
</ins><span class="cx">             textArea.removeNotificationListener();
</span><span class="cx">             debug(&quot;Updated value: &quot; + textArea.stringValue);
</span><span class="cx">             document.getElementById(&quot;content&quot;).style.visibility = &quot;hidden&quot;;
</span><span class="lines">@@ -31,6 +32,11 @@
</span><span class="cx">     if (window.accessibilityController) {
</span><span class="cx">         window.jsTestIsAsync = true;
</span><span class="cx"> 
</span><ins>+        // In ATK, value-changed notifications are made for widgets which implement
+        // the AtkValue interface (sliders, progress bars, etc.).
+        if (accessibilityController.platformName == &quot;atk&quot;)
+            notificationType = &quot;AXTextChanged&quot;;
+
</ins><span class="cx">         textArea = accessibilityController.accessibleElementById(&quot;content&quot;);
</span><span class="cx">         textArea.addNotificationListener(callback);
</span><span class="cx"> 
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit212LayoutTestsplatformgtkaccessibilitycontenteditableastextareaexpectedtxt"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.12/LayoutTests/platform/gtk/accessibility/content-editable-as-textarea-expected.txt (0 => 201269)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/LayoutTests/platform/gtk/accessibility/content-editable-as-textarea-expected.txt                                (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/platform/gtk/accessibility/content-editable-as-textarea-expected.txt        2016-05-23 11:02:42 UTC (rev 201269)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+
+This tests that a contenteditable region behaves as a proper AXTextArea.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Role: AXRole: AXTextField
+Value: AXValue: hello&lt;\n&gt;world
+Value (writable): true
+String with range: ello
+worl
+Attributed string with range: 
+        Default text attributes:
+                editable:true
+                invisible:false
+                strikethrough:false
+                style:normal
+                underline:none
+                weight:400
+                family-name:standard
+                indent:0
+                rise:0
+                fg-color:0,0,0
+                bg-color:0,0,0
+                size:16
+        Range attributes for 'hello':
+                
+        Range attributes for '&lt;\n&gt;worl':
+                weight:700
+Line for index(0): 0
+Line for index(7): 1
+Range for line(0): {0, 6}
+Range for line(1): {6, 5}
+Bounds for range: {8, 8, 31, 34}
+Selected text range: {0, 3}
+Selected text: hel
+Updated value: AXValue: qlo&lt;\n&gt;world
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit212LayoutTestsplatformgtkaccessibilitysetselectedtextrangecontenteditableexpectedtxt"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.12/LayoutTests/platform/gtk/accessibility/set-selected-text-range-contenteditable-expected.txt (0 => 201269)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/LayoutTests/platform/gtk/accessibility/set-selected-text-range-contenteditable-expected.txt                                (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/platform/gtk/accessibility/set-selected-text-range-contenteditable-expected.txt        2016-05-23 11:02:42 UTC (rev 201269)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+hello world test
+This tests that selected text ranges can be set on a contenteditable element.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Initial selected range: {1, 0}
+
+Set range: {3, 0}
+PASS content.selectedTextRange became '{3, 0}'
+
+Set range: {100, 0}
+PASS content.selectedTextRange became '{16, 0}'
+
+Set range: {0, 0}
+PASS content.selectedTextRange became '{0, 0}'
+
+Set range: {1, 12}
+PASS content.selectedTextRange became '{1, 12}'
+
+Set range: {-1, 0}
+PASS content.selectedTextRange became '{16, 0}'
+
+Set range: {7, 3}
+PASS content.selectedTextRange became '{7, 3}'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit212SourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog (201268 => 201269)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog        2016-05-23 10:45:53 UTC (rev 201268)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog        2016-05-23 11:02:42 UTC (rev 201269)
</span><span class="lines">@@ -1,3 +1,38 @@
</span><ins>+2016-05-03  Joanmarie Diggs  &lt;jdiggs@igalia.com&gt;
+
+        [ATK] accessibility/content-editable-as-textarea.html fails
+        https://bugs.webkit.org/show_bug.cgi?id=155353
+
+        Reviewed by Darin Adler.
+
+        The test was timing out because it expected an AXValueChanged notification.
+        In ATK, AXValueChanged notifications are made for widgets which implement
+        the AtkValue interface (sliders, progress bars, etc.). We should be listening
+        for AXTextChanged instead.
+
+        In addition, for contenteditable elements, we should emit the notification on
+        the element itself. Because we were handling the notification in the same way
+        as native text controls (where the notification we receive from WebCore is for
+        StaticTextRole children), we were attempting to emit the notification from
+        the parent of the contenteditable.
+
+        Lastly, ATK's AccessibilityUIElement support had a number of unimplemented
+        methods that are being used as part of the previously-failing test. Those
+        methods are now implemented so that the ATK results are much more similar
+        to those on the Mac.
+
+        No new tests needed. The previously-failing test now passes.
+
+        * accessibility/AccessibilityNodeObject.cpp:
+        (WebCore::AccessibilityNodeObject::childrenChanged):
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::isNonNativeTextControl):
+        * accessibility/AccessibilityObject.h:
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::textChanged):
+        * accessibility/atk/AXObjectCacheAtk.cpp:
+        (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
+
</ins><span class="cx"> 2016-05-10  Zalan Bujtas  &lt;zalan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r193610): Drop down menu doesn’t expand at allofbach.com
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit212SourceWebCoreaccessibilityAccessibilityNodeObjectcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityNodeObject.cpp (201268 => 201269)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityNodeObject.cpp        2016-05-23 10:45:53 UTC (rev 201268)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityNodeObject.cpp        2016-05-23 11:02:42 UTC (rev 201269)
</span><span class="lines">@@ -159,7 +159,7 @@
</span><span class="cx">             cache-&gt;postLiveRegionChangeNotification(parent);
</span><span class="cx">         
</span><span class="cx">         // If this element is an ARIA text control, notify the AT of changes.
</span><del>-        if ((parent-&gt;isARIATextControl() || parent-&gt;hasContentEditableAttributeSet()) &amp;&amp; !parent-&gt;isNativeTextControl())
</del><ins>+        if (parent-&gt;isNonNativeTextControl())
</ins><span class="cx">             cache-&gt;postNotification(parent, parent-&gt;document(), AXObjectCache::AXValueChanged);
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit212SourceWebCoreaccessibilityAccessibilityObjectcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityObject.cpp (201268 => 201269)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityObject.cpp        2016-05-23 10:45:53 UTC (rev 201268)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityObject.cpp        2016-05-23 11:02:42 UTC (rev 201269)
</span><span class="lines">@@ -392,6 +392,11 @@
</span><span class="cx">     return ariaRoleAttribute() == TextAreaRole || ariaRoleAttribute() == TextFieldRole || ariaRoleAttribute() == SearchFieldRole;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool AccessibilityObject::isNonNativeTextControl() const
+{
+    return (isARIATextControl() || hasContentEditableAttributeSet()) &amp;&amp; !isNativeTextControl();
+}
+
</ins><span class="cx"> bool AccessibilityObject::isLandmark() const
</span><span class="cx"> {
</span><span class="cx">     AccessibilityRole role = roleValue();
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit212SourceWebCoreaccessibilityAccessibilityObjecth"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityObject.h (201268 => 201269)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityObject.h        2016-05-23 10:45:53 UTC (rev 201268)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityObject.h        2016-05-23 11:02:42 UTC (rev 201269)
</span><span class="lines">@@ -520,6 +520,7 @@
</span><span class="cx">     bool isToggleButton() const { return roleValue() == ToggleButtonRole; }
</span><span class="cx">     bool isTextControl() const;
</span><span class="cx">     bool isARIATextControl() const;
</span><ins>+    bool isNonNativeTextControl() const;
</ins><span class="cx">     bool isTabList() const { return roleValue() == TabListRole; }
</span><span class="cx">     bool isTabItem() const { return roleValue() == TabRole; }
</span><span class="cx">     bool isRadioGroup() const { return roleValue() == RadioGroupRole; }
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit212SourceWebCoreaccessibilityAccessibilityRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (201268 => 201269)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2016-05-23 10:45:53 UTC (rev 201268)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2016-05-23 11:02:42 UTC (rev 201269)
</span><span class="lines">@@ -2905,7 +2905,7 @@
</span><span class="cx">         if (parent-&gt;supportsARIALiveRegion())
</span><span class="cx">             cache-&gt;postNotification(renderParent, AXObjectCache::AXLiveRegionChanged);
</span><span class="cx"> 
</span><del>-        if ((parent-&gt;isARIATextControl() || parent-&gt;hasContentEditableAttributeSet()) &amp;&amp; !parent-&gt;isNativeTextControl())
</del><ins>+        if (parent-&gt;isNonNativeTextControl())
</ins><span class="cx">             cache-&gt;postNotification(renderParent, AXObjectCache::AXValueChanged);
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit212SourceWebCoreaccessibilityatkAXObjectCacheAtkcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/atk/AXObjectCacheAtk.cpp (201268 => 201269)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/atk/AXObjectCacheAtk.cpp        2016-05-23 10:45:53 UTC (rev 201268)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/atk/AXObjectCacheAtk.cpp        2016-05-23 11:02:42 UTC (rev 201269)
</span><span class="lines">@@ -249,7 +249,7 @@
</span><span class="cx">     if (!object || text.isEmpty())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    AccessibilityObject* parentObject = object-&gt;parentObjectUnignored();
</del><ins>+    AccessibilityObject* parentObject = object-&gt;isNonNativeTextControl() ? object : object-&gt;parentObjectUnignored();
</ins><span class="cx">     if (!parentObject)
</span><span class="cx">         return;
</span><span class="cx"> 
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit212ToolsChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/Tools/ChangeLog (201268 => 201269)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/Tools/ChangeLog        2016-05-23 10:45:53 UTC (rev 201268)
+++ releases/WebKitGTK/webkit-2.12/Tools/ChangeLog        2016-05-23 11:02:42 UTC (rev 201269)
</span><span class="lines">@@ -1,3 +1,29 @@
</span><ins>+2016-05-03  Joanmarie Diggs  &lt;jdiggs@igalia.com&gt;
+
+        [ATK] accessibility/content-editable-as-textarea.html fails
+        https://bugs.webkit.org/show_bug.cgi?id=155353
+
+        Reviewed by Darin Adler.
+
+        The test was timing out because it expected an AXValueChanged notification.
+        In ATK, AXValueChanged notifications are made for widgets which implement
+        the AtkValue interface (sliders, progress bars, etc.). We should be listening
+        for AXTextChanged instead. AtkText's text-insert and text-remove have been
+        added to the AccessibilityNotificationHandler.
+
+        Also, ATK's AccessibilityUIElement support had a number of unimplemented
+        methods that are being used as part of the previously-failing test. Those
+        methods are now implemented so that the ATK results are much more similar
+        to those on the Mac.
+
+        * WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp:
+        (WTR::AccessibilityNotificationHandler::connectAccessibilityCallbacks):
+        * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
+        (WTR::AccessibilityUIElement::stringAttributeValue):
+        (WTR::AccessibilityUIElement::rangeForLine):
+        (WTR::AccessibilityUIElement::boundsForRange):
+        (WTR::AccessibilityUIElement::attributedStringForRange):
+
</ins><span class="cx"> 2016-04-18  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Pending API Request URL is wrong after reloading
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit212ToolsWebKitTestRunnerInjectedBundleatkAccessibilityNotificationHandlerAtkcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp (201268 => 201269)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp        2016-05-23 10:45:53 UTC (rev 201268)
+++ releases/WebKitGTK/webkit-2.12/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp        2016-05-23 11:02:42 UTC (rev 201269)
</span><span class="lines">@@ -91,7 +91,8 @@
</span><span class="cx">         GUniquePtr&lt;char&gt; signalValue(g_strdup_printf(&quot;%d&quot;, g_value_get_int(&amp;paramValues[1])));
</span><span class="cx">         JSRetainPtr&lt;JSStringRef&gt; jsSignalValue(Adopt, JSStringCreateWithUTF8CString(signalValue.get()));
</span><span class="cx">         extraArgs.append(JSValueMakeString(jsContext, jsSignalValue.get()));
</span><del>-    }
</del><ins>+    } else if (!g_strcmp0(signalQuery.signal_name, &quot;text-insert&quot;) || !g_strcmp0(signalQuery.signal_name, &quot;text-remove&quot;))
+        notificationName = &quot;AXTextChanged&quot;;
</ins><span class="cx"> 
</span><span class="cx">     if (!jsContext)
</span><span class="cx">         return true;
</span><span class="lines">@@ -218,6 +219,8 @@
</span><span class="cx">         &quot;ATK:AtkDocument:load-complete&quot;,
</span><span class="cx">         &quot;ATK:AtkSelection:selection-changed&quot;,
</span><span class="cx">         &quot;ATK:AtkText:text-caret-moved&quot;,
</span><ins>+        &quot;ATK:AtkText:text-insert&quot;,
+        &quot;ATK:AtkText:text-remove&quot;,
</ins><span class="cx">         0
</span><span class="cx">     };
</span><span class="cx"> 
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit212ToolsWebKitTestRunnerInjectedBundleatkAccessibilityUIElementAtkcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp (201268 => 201269)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp        2016-05-23 10:45:53 UTC (rev 201268)
+++ releases/WebKitGTK/webkit-2.12/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp        2016-05-23 11:02:42 UTC (rev 201269)
</span><span class="lines">@@ -186,9 +186,8 @@
</span><span class="cx">     return atkAttributeValueToCoreAttributeValue(type, id, attributeValue);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-String getAtkAttributeSetAsString(AtkObject* accessible, AtkAttributeType type)
</del><ins>+String attributeSetToString(AtkAttributeSet* attributeSet, String separator=&quot;, &quot;)
</ins><span class="cx"> {
</span><del>-    AtkAttributeSet* attributeSet = getAttributeSet(accessible, type);
</del><span class="cx">     if (!attributeSet)
</span><span class="cx">         return String();
</span><span class="cx"> 
</span><span class="lines">@@ -198,13 +197,18 @@
</span><span class="cx">         GUniquePtr&lt;gchar&gt; attributeData(g_strconcat(attribute-&gt;name, &quot;:&quot;, attribute-&gt;value, NULL));
</span><span class="cx">         builder.append(attributeData.get());
</span><span class="cx">         if (attributes-&gt;next)
</span><del>-            builder.append(&quot;, &quot;);
</del><ins>+            builder.append(separator);
</ins><span class="cx">     }
</span><span class="cx">     atk_attribute_set_free(attributeSet);
</span><span class="cx"> 
</span><span class="cx">     return builder.toString();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String getAtkAttributeSetAsString(AtkObject* accessible, AtkAttributeType type,  String separator=&quot;, &quot;)
+{
+    return attributeSetToString(getAttributeSet(accessible, type), separator);
+}
+
</ins><span class="cx"> bool checkElementState(PlatformUIElement element, AtkStateType stateType)
</span><span class="cx"> {
</span><span class="cx">     if (!ATK_IS_OBJECT(element.get()))
</span><span class="lines">@@ -502,6 +506,19 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String selectedText(AtkObject* accessible)
+{
+    if (!ATK_IS_TEXT(accessible))
+        return String();
+
+    AtkText* text = ATK_TEXT(accessible);
+
+    gint start, end;
+    g_free(atk_text_get_selection(text, 0, &amp;start, &amp;end));
+
+    return atk_text_get_text(text, start, end);
+}
+
</ins><span class="cx"> String attributesOfElement(AccessibilityUIElement* element)
</span><span class="cx"> {
</span><span class="cx">     StringBuilder builder;
</span><span class="lines">@@ -914,7 +931,13 @@
</span><span class="cx"> 
</span><span class="cx">     String atkAttributeName = coreAttributeToAtkAttribute(attribute);
</span><span class="cx"> 
</span><del>-    // Try object attributes first.
</del><ins>+    // The value of AXSelectedText is not exposed through any AtkAttribute.
+    if (atkAttributeName == &quot;AXSelectedText&quot;) {
+        String string = selectedText(m_element.get());
+        return JSStringCreateWithUTF8CString(string.utf8().data());
+    }
+
+    // Try object attributes before text attributes.
</ins><span class="cx">     String attributeValue = getAttributeSetValueForId(ATK_OBJECT(m_element.get()), ObjectAttributeType, atkAttributeName);
</span><span class="cx"> 
</span><span class="cx">     // Try text attributes if the requested one was not found and we have an AtkText object.
</span><span class="lines">@@ -1450,8 +1473,16 @@
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr&lt;JSStringRef&gt; AccessibilityUIElement::rangeForLine(int line)
</span><span class="cx"> {
</span><del>-    // FIXME: implement
-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    if (!ATK_IS_TEXT(m_element.get()))
+        return JSStringCreateWithCharacters(0, 0);
+
+    AtkText* text = ATK_TEXT(m_element.get());
+    gint startOffset = 0, endOffset = 0;
+    for (int i = 0; i &lt;= line; ++i)
+        atk_text_get_string_at_offset(text, endOffset, ATK_TEXT_GRANULARITY_LINE, &amp;startOffset, &amp;endOffset);
+
+    GUniquePtr&lt;gchar&gt; range(g_strdup_printf(&quot;{%d, %d}&quot;, startOffset, endOffset - startOffset));
+    return JSStringCreateWithUTF8CString(range.get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr&lt;JSStringRef&gt; AccessibilityUIElement::rangeForPosition(int x, int y)
</span><span class="lines">@@ -1462,8 +1493,14 @@
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr&lt;JSStringRef&gt; AccessibilityUIElement::boundsForRange(unsigned location, unsigned length)
</span><span class="cx"> {
</span><del>-    // FIXME: implement
-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    if (!ATK_IS_TEXT(m_element.get()))
+        return JSStringCreateWithCharacters(0, 0);
+
+    AtkTextRectangle rect;
+    atk_text_get_range_extents(ATK_TEXT(m_element.get()), location, location + length, ATK_XY_WINDOW, &amp;rect);
+
+    GUniquePtr&lt;gchar&gt; bounds(g_strdup_printf(&quot;{%d, %d, %d, %d}&quot;, rect.x, rect.y, rect.width, rect.height));
+    return JSStringCreateWithUTF8CString(bounds.get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr&lt;JSStringRef&gt; AccessibilityUIElement::stringForRange(unsigned location, unsigned length)
</span><span class="lines">@@ -1477,8 +1514,29 @@
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr&lt;JSStringRef&gt; AccessibilityUIElement::attributedStringForRange(unsigned location, unsigned length)
</span><span class="cx"> {
</span><del>-    // FIXME: implement
-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    if (!ATK_IS_TEXT(m_element.get()))
+        return JSStringCreateWithCharacters(0, 0);
+
+    StringBuilder builder;
+
+    // The default text attributes apply to the entire element.
+    builder.append(&quot;\n\tDefault text attributes:\n\t\t&quot;);
+    builder.append(attributeSetToString(getAttributeSet(m_element.get(), TextAttributeType), &quot;\n\t\t&quot;));
+
+    // The attribute run provides attributes specific to the range of text at the specified offset.
+    AtkAttributeSet* attributeSet;
+    AtkText* text = ATK_TEXT(m_element.get());
+    gint start = 0, end = 0;
+    for (int i = location; i &lt; location + length; i = end) {
+        AtkAttributeSet* attributeSet = atk_text_get_run_attributes(text, i, &amp;start, &amp;end);
+        GUniquePtr&lt;gchar&gt; substring(replaceCharactersForResults(atk_text_get_text(text, start, end)));
+        builder.append(String::format(&quot;\n\tRange attributes for '%s':\n\t\t&quot;, substring.get()));
+        builder.append(attributeSetToString(attributeSet, &quot;\n\t\t&quot;));
+    }
+
+    atk_attribute_set_free(attributeSet);
+
+    return JSStringCreateWithUTF8CString(builder.toString().utf8().data());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool AccessibilityUIElement::attributedStringRangeIsMisspelled(unsigned location, unsigned length)
</span></span></pre>
</div>
</div>

</body>
</html>