<!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>[200855] 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/200855">200855</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2016-05-13 06:41:00 -0700 (Fri, 13 May 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/200542">r200542</a> - REGRESSION(<a href="http://trac.webkit.org/projects/webkit/changeset/196222">r196222</a>): [AX][GTK] accessibility/gtk/caret-offsets.html failing
https://bugs.webkit.org/show_bug.cgi?id=153956

Reviewed by Chris Fleizach.

Source/WebCore:

The reason the test began failing is that it was checking the new caret offset
synchronously. For most of the test cases, this was not a problem. But when the
caret was moved out of a focused link, the focus change (and associated repainting)
delayed the caret-moved event long enough to cause the associated test case to fail.
The test now uses shouldBecomeEqualToString() instead of shouldBeEqualToString().

The test also had a supposedly-correct expectation which was wrong: When moving the
caret to a valid accessible offset, the caret-moved event should be for that offset.
This was not the case for the list item test case because emitTextSelectionChange()
was not adjusting the offset for the RenderListMarker, the text of which is exposed
as part of the ATK_ROLE_LIST_ITEM object. This bug was also fixed and the test case
updated accordingly.

No new tests are needed. The previously-failing test is now passing.

* editing/atk/FrameSelectionAtk.cpp:
(WebCore::emitTextSelectionChange):

LayoutTests:

Change the test to run asynchronously and update the expectations.

* accessibility/gtk/caret-offsets-expected.txt: Updated.
* accessibility/gtk/caret-offsets.html: Updated.
* platform/gtk/TestExpectations: Unskipped the previously-failing test.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit212LayoutTestsChangeLog">releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit212LayoutTestsaccessibilitygtkcaretoffsetsexpectedtxt">releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/caret-offsets-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit212LayoutTestsaccessibilitygtkcaretoffsetshtml">releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/caret-offsets.html</a></li>
<li><a href="#releasesWebKitGTKwebkit212SourceWebCoreChangeLog">releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit212SourceWebCoreeditingatkFrameSelectionAtkcpp">releases/WebKitGTK/webkit-2.12/Source/WebCore/editing/atk/FrameSelectionAtk.cpp</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 (200854 => 200855)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog        2016-05-13 13:35:08 UTC (rev 200854)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog        2016-05-13 13:41:00 UTC (rev 200855)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2016-05-07  Joanmarie Diggs  &lt;jdiggs@igalia.com&gt;
+
+        REGRESSION(r196222): [AX][GTK] accessibility/gtk/caret-offsets.html failing
+        https://bugs.webkit.org/show_bug.cgi?id=153956
+
+        Reviewed by Chris Fleizach.
+
+        Change the test to run asynchronously and update the expectations.
+
+        * accessibility/gtk/caret-offsets-expected.txt: Updated.
+        * accessibility/gtk/caret-offsets.html: Updated.
+        * platform/gtk/TestExpectations: Unskipped the previously-failing test.
+
</ins><span class="cx"> 2016-05-05  Zalan Bujtas  &lt;zalan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Do not attempt to compute min/max width.
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit212LayoutTestsaccessibilitygtkcaretoffsetsexpectedtxt"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/caret-offsets-expected.txt (200854 => 200855)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/caret-offsets-expected.txt        2016-05-13 13:35:08 UTC (rev 200854)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/caret-offsets-expected.txt        2016-05-13 13:41:00 UTC (rev 200855)
</span><span class="lines">@@ -23,14 +23,14 @@
</span><span class="cx"> PASS caretMovedData is &quot;Heading|5&quot;
</span><span class="cx"> PASS caretMovedData is &quot;Paragraph|5&quot;
</span><span class="cx"> PASS caretMovedData is &quot;Paragraph|20&quot;
</span><del>-PASS caretMovedData is &quot;Paragraph|30&quot;
</del><ins>+PASS caretMovedData became &quot;Paragraph|30&quot;
</ins><span class="cx"> PASS setCaretOffset(link, 5) is true
</span><span class="cx"> PASS caretMovedData is &quot;Paragraph|17&quot;
</span><span class="cx"> PASS list.role is &quot;AXRole: AXList&quot;
</span><span class="cx"> PASS list.childrenCount is 3
</span><span class="cx"> PASS setCaretOffset(listItem, 1) is false
</span><span class="cx"> PASS setCaretOffset(listItem, 5) is true
</span><del>-PASS caretMovedData is &quot;ListItem|2&quot;
</del><ins>+PASS caretMovedData is &quot;ListItem|5&quot;
</ins><span class="cx"> PASS comboBox.role is &quot;AXRole: AXComboBox&quot;
</span><span class="cx"> PASS menuPopup.role is &quot;AXRole: AXMenu&quot;
</span><span class="cx"> PASS comboBoxOption.role is &quot;AXRole: AXMenuItem&quot;
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx"> PASS table.childrenCount is 1
</span><span class="cx"> PASS row.role is &quot;AXRole: AXRow&quot;
</span><span class="cx"> PASS tableCell.role is &quot;AXRole: AXCell&quot;
</span><del>-PASS caretMovedData is &quot;Cell|2&quot;
</del><ins>+PASS caretMovedData became &quot;Cell|2&quot;
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit212LayoutTestsaccessibilitygtkcaretoffsetshtml"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/caret-offsets.html (200854 => 200855)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/caret-offsets.html        2016-05-13 13:35:08 UTC (rev 200854)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/caret-offsets.html        2016-05-13 13:41:00 UTC (rev 200855)
</span><span class="lines">@@ -54,6 +54,8 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> if (window.accessibilityController) {
</span><ins>+    window.jsTestIsAsync = true;
+
</ins><span class="cx">     accessibilityController.addNotificationListener(globalListener);
</span><span class="cx">     root = accessibilityController.accessibleElementById('firstChild').parentElement();
</span><span class="cx">     shouldBe('root.childrenCount', '5');
</span><span class="lines">@@ -71,47 +73,48 @@
</span><span class="cx">     resetCaretOffsetForObject(p1, 20);
</span><span class="cx">     shouldBeEqualToString('caretMovedData', 'Paragraph|20');
</span><span class="cx">     resetCaretOffsetForObject(p1, 30);
</span><del>-    shouldBeEqualToString('caretMovedData', 'Paragraph|30');
-    link = p1.childAtIndex(0);
-    caretMovedData = '';
-    shouldBeTrue('setCaretOffset(link, 5)');
-    /* Positions inside links are reported relative to the paragraph. */
-    shouldBeEqualToString('caretMovedData', 'Paragraph|17');
</del><ins>+    shouldBecomeEqualToString('caretMovedData', 'Paragraph|30', function () { 
+        caretMovedData = '';
+        link = p1.childAtIndex(0);
+        shouldBeTrue('setCaretOffset(link, 5)');
+        /* Positions inside links are reported relative to the paragraph. */
+        shouldBeEqualToString('caretMovedData', 'Paragraph|17');
</ins><span class="cx"> 
</span><del>-    list = root.childAtIndex(2);
-    shouldBeEqualToString('list.role', 'AXRole: AXList');
-    shouldBe('list.childrenCount', '3');
-    listItem = list.childAtIndex(2);
-    /* It's not possible to place the caret inside an item's marker. */
-    shouldBe('setCaretOffset(listItem, 1)', 'false');
-    /* It should be possible to place the caret inside an item's text. */
-    caretMovedData = '';
-    shouldBe('setCaretOffset(listItem, 5)', 'true');
-    shouldBeEqualToString('caretMovedData', 'ListItem|2');
</del><ins>+        list = root.childAtIndex(2);
+        shouldBeEqualToString('list.role', 'AXRole: AXList');
+        shouldBe('list.childrenCount', '3');
+        listItem = list.childAtIndex(2);
+        /* It's not possible to place the caret inside an item's marker. */
+        shouldBe('setCaretOffset(listItem, 1)', 'false');
+        /* It should be possible to place the caret inside an item's text. */
+        caretMovedData = '';
+        shouldBe('setCaretOffset(listItem, 5)', 'true');
+        shouldBeEqualToString('caretMovedData', 'ListItem|5');
</ins><span class="cx"> 
</span><del>-    panel = root.childAtIndex(3);
-    comboBox = panel.childAtIndex(0);
-    shouldBeEqualToString('comboBox.role', 'AXRole: AXComboBox');
-    menuPopup = comboBox.childAtIndex(0);
-    shouldBeEqualToString('menuPopup.role', 'AXRole: AXMenu');
-    comboBoxOption = menuPopup.childAtIndex(0);
-    shouldBeEqualToString('comboBoxOption.role', 'AXRole: AXMenuItem');
-    /* It's not possible to place the caret inside an option for a combobox. */
-    shouldBe('setCaretOffset(comboBoxOption, 1)', 'false');
-    textEntry = panel.childAtIndex(1);
-    shouldBeEqualToString('textEntry.role', 'AXRole: AXTextField');
-    resetCaretOffsetForObject(textEntry, 5);
-    shouldBeEqualToString('caretMovedData', 'TextField|5');
</del><ins>+        panel = root.childAtIndex(3);
+        comboBox = panel.childAtIndex(0);
+        shouldBeEqualToString('comboBox.role', 'AXRole: AXComboBox');
+        menuPopup = comboBox.childAtIndex(0);
+        shouldBeEqualToString('menuPopup.role', 'AXRole: AXMenu');
+        comboBoxOption = menuPopup.childAtIndex(0);
+        shouldBeEqualToString('comboBoxOption.role', 'AXRole: AXMenuItem');
+        /* It's not possible to place the caret inside an option for a combobox. */
+        shouldBe('setCaretOffset(comboBoxOption, 1)', 'false');
+        textEntry = panel.childAtIndex(1);
+        shouldBeEqualToString('textEntry.role', 'AXRole: AXTextField');
+        resetCaretOffsetForObject(textEntry, 5);
+        shouldBeEqualToString('caretMovedData', 'TextField|5');
</ins><span class="cx"> 
</span><del>-    table = root.childAtIndex(4);
-    shouldBeEqualToString('table.role', 'AXRole: AXTable');
-    shouldBe('table.childrenCount', '1');
-    row = table.childAtIndex(0);
-    shouldBeEqualToString('row.role', 'AXRole: AXRow');
-    tableCell = row.childAtIndex(0);
-    shouldBeEqualToString('tableCell.role', 'AXRole: AXCell');
-    resetCaretOffsetForObject(tableCell, 2);
-    shouldBeEqualToString('caretMovedData', 'Cell|2');
</del><ins>+        table = root.childAtIndex(4);
+        shouldBeEqualToString('table.role', 'AXRole: AXTable');
+        shouldBe('table.childrenCount', '1');
+        row = table.childAtIndex(0);
+        shouldBeEqualToString('row.role', 'AXRole: AXRow');
+        tableCell = row.childAtIndex(0);
+        shouldBeEqualToString('tableCell.role', 'AXRole: AXCell');
+        resetCaretOffsetForObject(tableCell, 2);
+        shouldBecomeEqualToString('caretMovedData', 'Cell|2', finishJSTest);
+    });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> description(&quot;This test is replicated from old file testatk.c and tests various scenarios of caret movement: setting caret offset and receiving text-caret-moved signal.&quot;);
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit212SourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog (200854 => 200855)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog        2016-05-13 13:35:08 UTC (rev 200854)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog        2016-05-13 13:41:00 UTC (rev 200855)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2016-05-07  Joanmarie Diggs  &lt;jdiggs@igalia.com&gt;
+
+        REGRESSION(r196222): [AX][GTK] accessibility/gtk/caret-offsets.html failing
+        https://bugs.webkit.org/show_bug.cgi?id=153956
+
+        Reviewed by Chris Fleizach.
+
+        The reason the test began failing is that it was checking the new caret offset
+        synchronously. For most of the test cases, this was not a problem. But when the
+        caret was moved out of a focused link, the focus change (and associated repainting)
+        delayed the caret-moved event long enough to cause the associated test case to fail.
+        The test now uses shouldBecomeEqualToString() instead of shouldBeEqualToString().
+
+        The test also had a supposedly-correct expectation which was wrong: When moving the
+        caret to a valid accessible offset, the caret-moved event should be for that offset.
+        This was not the case for the list item test case because emitTextSelectionChange()
+        was not adjusting the offset for the RenderListMarker, the text of which is exposed
+        as part of the ATK_ROLE_LIST_ITEM object. This bug was also fixed and the test case
+        updated accordingly.
+
+        No new tests are needed. The previously-failing test is now passing.
+
+        * editing/atk/FrameSelectionAtk.cpp:
+        (WebCore::emitTextSelectionChange):
+
</ins><span class="cx"> 2016-05-05  Zalan Bujtas  &lt;zalan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Do not attempt to compute min/max width.
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit212SourceWebCoreeditingatkFrameSelectionAtkcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/editing/atk/FrameSelectionAtk.cpp (200854 => 200855)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/Source/WebCore/editing/atk/FrameSelectionAtk.cpp        2016-05-13 13:35:08 UTC (rev 200854)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/editing/atk/FrameSelectionAtk.cpp        2016-05-13 13:41:00 UTC (rev 200855)
</span><span class="lines">@@ -25,6 +25,7 @@
</span><span class="cx"> #include &quot;AXObjectCache.h&quot;
</span><span class="cx"> #include &quot;Document.h&quot;
</span><span class="cx"> #include &quot;Frame.h&quot;
</span><ins>+#include &quot;RenderListItem.h&quot;
</ins><span class="cx"> #include &quot;WebKitAccessibleWrapperAtk.h&quot;
</span><span class="cx"> #include &lt;glib.h&gt;
</span><span class="cx"> #include &lt;wtf/NeverDestroyed.h&gt;
</span><span class="lines">@@ -38,6 +39,13 @@
</span><span class="cx">     if (!axObject || !ATK_IS_TEXT(axObject))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+    // We need to adjust the offset for the list item marker in Left-To-Right text because
+    // the list item marker is exposed through the text of the accessible list item rather
+    // than through a separate accessible object.
+    RenderObject* renderer = object-&gt;renderer();
+    if (is&lt;RenderListItem&gt;(renderer) &amp;&amp; renderer-&gt;style().direction() == LTR)
+        offset += downcast&lt;RenderListItem&gt;(*renderer).markerTextWithSuffix().length();
+
</ins><span class="cx">     g_signal_emit_by_name(axObject, &quot;text-caret-moved&quot;, offset);
</span><span class="cx">     if (selection.isRange())
</span><span class="cx">         g_signal_emit_by_name(axObject, &quot;text-selection-changed&quot;);
</span></span></pre>
</div>
</div>

</body>
</html>