<!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>[170791] releases/WebKitGTK/webkit-2.4</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/170791">170791</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2014-07-04 00:43:35 -0700 (Fri, 04 Jul 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/169483">r169483</a> - Tools: [ATK] Added new accessibility signal: text-caret-moved.
Make AccessibilityUIElement.setSelectedTextRange work
as atk_text_set_caret_offset when given offset == 0.
https://bugs.webkit.org/show_bug.cgi?id=132527
Patch by Jarek Czekalski <jarekczek@poczta.onet.pl> on 2014-05-30
Reviewed by Mario Sanchez Prada.
text-caret-moved signal in accessibilityController is needed to
implement tests from Tools/TestWebKitAPI/Tests/WebKitGtk/testatk.c
as LayoutTests. Add the signal to the controller.
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(setSelectedTextRange): Change return type to bool.
* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(setSelectedTextRange): Call atk_text_set_caret_offset and return bool.
* WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp:
(axObjectEventListener): Add notification name AXTextCaretMoved, allow
for extra arguments passed to handler and use it for text-caret-moved offset.
(WTR::AccessibilityNotificationHandler::connectAccessibilityCallbacks):
Connect callback to new listener for ATK:AtkText:text-caret-moved.
Refactor so that failures be reported.
Initialize atk interfaces before trying to connect to them, see
https://bugzilla.gnome.org/show_bug.cgi?id=729922
(WTR::AccessibilityNotificationHandler::disconnectAccessibilityCallbacks):
Simplify code by using a vector in place of dozen variables.
* DumpRenderTree/atk/AccessibilityCallbacksAtk.cpp:
Comment about not synchronizing with accessibilityController.
LayoutTests: [ATK] Convert caret offset tests from testatk.c.
https://bugs.webkit.org/show_bug.cgi?id=132527
Patch by Jarek Czekalski <jarekczek@poczta.onet.pl> on 2014-05-30
Reviewed by Mario Sanchez Prada.
The tests are replicated from testatk.c file, functions
testWebkitAtkCaretOffsets()
testWebkitAtkCaretOffsetsAndExtranousWhiteSpaces()
The file was present in webkit1. Removed from trunk in <a href="http://trac.webkit.org/projects/webkit/changeset/166977">r166977</a>, so
the last version was
https://trac.webkit.org/browser/trunk/Tools/TestWebKitAPI/Tests/WebKitGtk/testatk.c?rev=166976
What could not be verified in the same way:
1. Whether element implements ATK_TEXT. If setCaretOffset
succeeds, it confirms that element is text as well. But in cases
when setCaretOffset must fail I see no way to confirm it is text
element.
2. Whether position is correct through a call to
atk_text_get_caret_offset. text-caret-moved signal value is
tested instead.
Anyway these cases don't look crucial, so they are skipped.
* platform/gtk/resources/atk-helpers.js: Added.
(setCaretOffset): Added.
* platform/gtk/accessibility/caret-offsets-and-extraneous-white-spaces-expected.txt: Added.
* platform/gtk/accessibility/caret-offsets-and-extraneous-white-spaces.html: Added.
* platform/gtk/accessibility/caret-offsets-expected.txt: Added.
* platform/gtk/accessibility/caret-offsets.html: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit24LayoutTestsChangeLog">releases/WebKitGTK/webkit-2.4/LayoutTests/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit24ToolsChangeLog">releases/WebKitGTK/webkit-2.4/Tools/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit24ToolsDumpRenderTreeatkAccessibilityCallbacksAtkcpp">releases/WebKitGTK/webkit-2.4/Tools/DumpRenderTree/atk/AccessibilityCallbacksAtk.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit24ToolsWebKitTestRunnerInjectedBundleAccessibilityUIElementcpp">releases/WebKitGTK/webkit-2.4/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit24ToolsWebKitTestRunnerInjectedBundleAccessibilityUIElementh">releases/WebKitGTK/webkit-2.4/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h</a></li>
<li><a href="#releasesWebKitGTKwebkit24ToolsWebKitTestRunnerInjectedBundleBindingsAccessibilityUIElementidl">releases/WebKitGTK/webkit-2.4/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl</a></li>
<li><a href="#releasesWebKitGTKwebkit24ToolsWebKitTestRunnerInjectedBundleatkAccessibilityNotificationHandlerAtkcpp">releases/WebKitGTK/webkit-2.4/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit24ToolsWebKitTestRunnerInjectedBundleatkAccessibilityUIElementAtkcpp">releases/WebKitGTK/webkit-2.4/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit24ToolsWebKitTestRunnerInjectedBundleiosAccessibilityUIElementIOSmm">releases/WebKitGTK/webkit-2.4/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm</a></li>
<li><a href="#releasesWebKitGTKwebkit24ToolsWebKitTestRunnerInjectedBundlemacAccessibilityUIElementMacmm">releases/WebKitGTK/webkit-2.4/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit24LayoutTestsplatformgtkaccessibilitycaretoffsetsandextraneouswhitespacesexpectedtxt">releases/WebKitGTK/webkit-2.4/LayoutTests/platform/gtk/accessibility/caret-offsets-and-extraneous-white-spaces-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit24LayoutTestsplatformgtkaccessibilitycaretoffsetsandextraneouswhitespaceshtml">releases/WebKitGTK/webkit-2.4/LayoutTests/platform/gtk/accessibility/caret-offsets-and-extraneous-white-spaces.html</a></li>
<li><a href="#releasesWebKitGTKwebkit24LayoutTestsplatformgtkaccessibilitycaretoffsetsexpectedtxt">releases/WebKitGTK/webkit-2.4/LayoutTests/platform/gtk/accessibility/caret-offsets-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit24LayoutTestsplatformgtkaccessibilitycaretoffsetshtml">releases/WebKitGTK/webkit-2.4/LayoutTests/platform/gtk/accessibility/caret-offsets.html</a></li>
<li>releases/WebKitGTK/webkit-2.4/LayoutTests/platform/gtk/resources/</li>
<li><a href="#releasesWebKitGTKwebkit24LayoutTestsplatformgtkresourcesatkhelpersjs">releases/WebKitGTK/webkit-2.4/LayoutTests/platform/gtk/resources/atk-helpers.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit24LayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/LayoutTests/ChangeLog (170790 => 170791)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/LayoutTests/ChangeLog        2014-07-04 07:26:54 UTC (rev 170790)
+++ releases/WebKitGTK/webkit-2.4/LayoutTests/ChangeLog        2014-07-04 07:43:35 UTC (rev 170791)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2014-05-30 Jarek Czekalski <jarekczek@poczta.onet.pl>
+
+ [ATK] Convert caret offset tests from testatk.c.
+ https://bugs.webkit.org/show_bug.cgi?id=132527
+
+ Reviewed by Mario Sanchez Prada.
+
+ The tests are replicated from testatk.c file, functions
+ testWebkitAtkCaretOffsets()
+ testWebkitAtkCaretOffsetsAndExtranousWhiteSpaces()
+ The file was present in webkit1. Removed from trunk in r166977, so
+ the last version was
+ https://trac.webkit.org/browser/trunk/Tools/TestWebKitAPI/Tests/WebKitGtk/testatk.c?rev=166976
+ What could not be verified in the same way:
+
+ 1. Whether element implements ATK_TEXT. If setCaretOffset
+ succeeds, it confirms that element is text as well. But in cases
+ when setCaretOffset must fail I see no way to confirm it is text
+ element.
+
+ 2. Whether position is correct through a call to
+ atk_text_get_caret_offset. text-caret-moved signal value is
+ tested instead.
+
+ Anyway these cases don't look crucial, so they are skipped.
+
+ * platform/gtk/resources/atk-helpers.js: Added.
+ (setCaretOffset): Added.
+ * platform/gtk/accessibility/caret-offsets-and-extraneous-white-spaces-expected.txt: Added.
+ * platform/gtk/accessibility/caret-offsets-and-extraneous-white-spaces.html: Added.
+ * platform/gtk/accessibility/caret-offsets-expected.txt: Added.
+ * platform/gtk/accessibility/caret-offsets.html: Added.
+
</ins><span class="cx"> 2014-05-22 Piotr Grad <p.grad@samsung.com>
</span><span class="cx">
</span><span class="cx"> Video is resumed with old playback rate.
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24LayoutTestsplatformgtkaccessibilitycaretoffsetsandextraneouswhitespacesexpectedtxt"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.4/LayoutTests/platform/gtk/accessibility/caret-offsets-and-extraneous-white-spaces-expected.txt (0 => 170791)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/LayoutTests/platform/gtk/accessibility/caret-offsets-and-extraneous-white-spaces-expected.txt         (rev 0)
+++ releases/WebKitGTK/webkit-2.4/LayoutTests/platform/gtk/accessibility/caret-offsets-and-extraneous-white-spaces-expected.txt        2014-07-04 07:43:35 UTC (rev 170791)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+This paragraph is borked!
+
+This test is replicated from old file testatk.c and tests text length, setting caret offset and receiving text-caret-moved signal on a paragraph with lots of whitespace.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS borkedTextLength is 25
+PASS caretMovedData is "Paragraph|24"
+PASS caretMovedData is "Paragraph|25"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit24LayoutTestsplatformgtkaccessibilitycaretoffsetsandextraneouswhitespaceshtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.4/LayoutTests/platform/gtk/accessibility/caret-offsets-and-extraneous-white-spaces.html (0 => 170791)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/LayoutTests/platform/gtk/accessibility/caret-offsets-and-extraneous-white-spaces.html         (rev 0)
+++ releases/WebKitGTK/webkit-2.4/LayoutTests/platform/gtk/accessibility/caret-offsets-and-extraneous-white-spaces.html        2014-07-04 07:43:35 UTC (rev 170791)
</span><span class="lines">@@ -0,0 +1,56 @@
</span><ins>+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="../../../resources/js-test-pre.js"></script>
+<script src="../resources/atk-helpers.js"></script>
+</head>
+
+<body>
+<p id="borked">This
+ paragraph
+ is
+ borked!</p>
+
+<div id="console"></div>
+
+<script>
+var caretMovedData;
+
+function globalListener(object, name, offset)
+{
+ var role = object.role.replace('AXRole: AX', '');
+ if (name == 'AXTextCaretMoved') {
+ caretMovedData += role + '|' + offset;
+ }
+}
+
+function resetCaretOffsetForObject(object, offset)
+{
+ caretMovedData = '';
+ setCaretOffset(object, offset);
+}
+
+if (window.testRunner) {
+ testRunner.overridePreference("WebKitEnableCaretBrowsing", true);
+ testRunner.dumpAsText();
+}
+
+if (window.accessibilityController) {
+ accessibilityController.addNotificationListener(globalListener);
+ borked = accessibilityController.accessibleElementById('borked');
+ prefix = 'AXValue: '
+ shouldBeTrueQuiet('borked.stringValue.substring(0, 9) == "' + prefix + '"');
+ borkedTextLength = borked.stringValue.length - prefix.length
+ shouldBe('borkedTextLength', '25');
+ resetCaretOffsetForObject(borked, borkedTextLength - 1);
+ shouldBeEqualToString('caretMovedData', 'Paragraph|24');
+ resetCaretOffsetForObject(borked, borkedTextLength);
+ shouldBeEqualToString('caretMovedData', 'Paragraph|25');
+}
+
+description("This test is replicated from old file testatk.c and tests text length, setting caret offset and receiving text-caret-moved signal on a paragraph with lots of whitespace.");
+
+</script>
+<script src="../../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit24LayoutTestsplatformgtkaccessibilitycaretoffsetsexpectedtxt"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.4/LayoutTests/platform/gtk/accessibility/caret-offsets-expected.txt (0 => 170791)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/LayoutTests/platform/gtk/accessibility/caret-offsets-expected.txt         (rev 0)
+++ releases/WebKitGTK/webkit-2.4/LayoutTests/platform/gtk/accessibility/caret-offsets-expected.txt        2014-07-04 07:43:35 UTC (rev 170791)
</span><span class="lines">@@ -0,0 +1,47 @@
</span><ins>+A text header
+
+A paragraph with a link in the middle
+
+A list item
+Block span in a list item
+Inline span in a list item
+Block span in a link in a list item
+Inline span in a link in a list item
+
+a table cell                
+Block span in a link in a table cell
+Inline span in a link in a table cell        
+Block span in a table cell
+Inline span in a table cell
+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.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS root.childrenCount is 5
+PASS setCaretOffset(h1, 5) is true
+PASS caretMovedData is "Heading|5"
+PASS caretMovedData is "Paragraph|5"
+PASS caretMovedData is "Paragraph|20"
+PASS caretMovedData is "Paragraph|30"
+PASS setCaretOffset(link, 5) is true
+PASS caretMovedData is "Paragraph|17"
+PASS list.role is "AXRole: AXList"
+PASS list.childrenCount is 3
+PASS setCaretOffset(listItem, 1) is false
+PASS setCaretOffset(listItem, 5) is true
+PASS caretMovedData is "ListItem|2"
+PASS comboBox.role is "AXRole: AXComboBox"
+PASS menuPopup.role is "AXRole: AXMenu"
+PASS comboBoxOption.role is "AXRole: AXMenuItem"
+PASS setCaretOffset(comboBoxOption, 1) is false
+PASS textEntry.role is "AXRole: AXTextField"
+PASS caretMovedData is "TextField|5"
+PASS table.role is "AXRole: AXTable"
+PASS table.childrenCount is 4
+PASS tableCell.role is "AXRole: AXCell"
+PASS caretMovedData is "Cell|2"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit24LayoutTestsplatformgtkaccessibilitycaretoffsetshtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.4/LayoutTests/platform/gtk/accessibility/caret-offsets.html (0 => 170791)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/LayoutTests/platform/gtk/accessibility/caret-offsets.html         (rev 0)
+++ releases/WebKitGTK/webkit-2.4/LayoutTests/platform/gtk/accessibility/caret-offsets.html        2014-07-04 07:43:35 UTC (rev 170791)
</span><span class="lines">@@ -0,0 +1,120 @@
</span><ins>+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="../../../resources/js-test-pre.js"></script>
+<script src="../resources/atk-helpers.js"></script>
+</head>
+
+<body id="body">
+<h1 id='firstChild'>A text header</h1>
+
+<p>A paragraph <a href='http://foo.bar.baz/'>with a link</a> in the middle</p>
+
+<ol>
+ <li>A list item</li>
+ <li><span style='display:block;'>Block span in a list item</span><span>Inline span in a list item</span></li>
+ <li><a href='foo'><span style='display:block;'>Block span in a link in a list item</span><span>Inline span in a link in a list item</span></a></li>
+</ol>
+
+<select><option selected value='foo'>An option in a combo box</option></select>
+
+<input type='text' name='foo' value='foo bar baz' />
+
+<table>
+ <tr>
+ <td>a table cell</td>
+ <td></td>
+ <td><a href='foo'><span style='display:block;'>Block span in a link in a table cell</span><span>Inline span in a link in a table cell</span></a></td>
+ <td><span style='display:block;'>Block span in a table cell</span><span>Inline span in a table cell</span></td>
+ </tr>
+</table>
+
+<div id="console"></div>
+
+<script>
+var caretMovedData;
+
+function globalListener(object, name, offset)
+{
+ var role = object.role.replace('AXRole: AX', '');
+ if (name == 'AXTextCaretMoved') {
+ caretMovedData += role + '|' + offset;
+ }
+}
+
+function resetCaretOffsetForObject(object, offset)
+{
+ caretMovedData = '';
+ setCaretOffset(object, offset);
+}
+
+if (window.testRunner) {
+ testRunner.overridePreference("WebKitEnableCaretBrowsing", true);
+ testRunner.dumpAsText();
+}
+
+if (window.accessibilityController) {
+ accessibilityController.addNotificationListener(globalListener);
+ root = accessibilityController.accessibleElementById('firstChild').parentElement();
+ shouldBe('root.childrenCount', '5');
+
+ /* It should be possible to place the caret inside a header. */
+ h1 = root.childAtIndex(0);
+ caretMovedData = '';
+ shouldBeTrue('setCaretOffset(h1, 5)');
+ shouldBeEqualToString('caretMovedData', 'Heading|5');
+
+ /* It should be possible to place the caret inside a paragraph and a link. */
+ p1 = root.childAtIndex(1);
+ resetCaretOffsetForObject(p1, 5);
+ shouldBeEqualToString('caretMovedData', 'Paragraph|5');
+ resetCaretOffsetForObject(p1, 20);
+ shouldBeEqualToString('caretMovedData', 'Paragraph|20');
+ resetCaretOffsetForObject(p1, 30);
+ 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');
+
+ 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');
+
+ 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');
+
+ table = root.childAtIndex(4);
+ shouldBeEqualToString('table.role', 'AXRole: AXTable');
+ shouldBe('table.childrenCount', '4');
+ tableCell = table.childAtIndex(0);
+ shouldBeEqualToString('tableCell.role', 'AXRole: AXCell');
+ resetCaretOffsetForObject(tableCell, 2);
+ shouldBeEqualToString('caretMovedData', 'Cell|2');
+}
+
+description("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.");
+
+</script>
+<script src="../../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit24LayoutTestsplatformgtkresourcesatkhelpersjs"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.4/LayoutTests/platform/gtk/resources/atk-helpers.js (0 => 170791)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/LayoutTests/platform/gtk/resources/atk-helpers.js         (rev 0)
+++ releases/WebKitGTK/webkit-2.4/LayoutTests/platform/gtk/resources/atk-helpers.js        2014-07-04 07:43:35 UTC (rev 170791)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+function setCaretOffset(accessibleText, offset)
+{
+ return accessibleText.setSelectedTextRange(offset, 0);
+}
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit24ToolsChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Tools/ChangeLog (170790 => 170791)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Tools/ChangeLog        2014-07-04 07:26:54 UTC (rev 170790)
+++ releases/WebKitGTK/webkit-2.4/Tools/ChangeLog        2014-07-04 07:43:35 UTC (rev 170791)
</span><span class="lines">@@ -1,3 +1,52 @@
</span><ins>+2014-05-30 Mario Sanchez Prada <mario.prada@samsung.com>
+
+ [ATK] Deprecate usage of logAccessibilityEvents() in layout tests
+ https://bugs.webkit.org/show_bug.cgi?id=132280
+
+ Rubber stamped by Carlos Garcia Campos.
+
+ Fix two small issues with previous patch (r169483), that caused some tests to break.
+
+ * WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp:
+ (WTR::AccessibilityNotificationHandler::connectAccessibilityCallbacks): Removed
+ duplicated entry.
+ * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
+ (WTR::AccessibilityUIElement::setSelectedTextRange): Fix boolean condition.
+
+2014-05-30 Jarek Czekalski <jarekczek@poczta.onet.pl>
+
+ [ATK] Added new accessibility signal: text-caret-moved.
+ Make AccessibilityUIElement.setSelectedTextRange work
+ as atk_text_set_caret_offset when given offset == 0.
+ https://bugs.webkit.org/show_bug.cgi?id=132527
+
+ Reviewed by Mario Sanchez Prada.
+
+ text-caret-moved signal in accessibilityController is needed to
+ implement tests from Tools/TestWebKitAPI/Tests/WebKitGtk/testatk.c
+ as LayoutTests. Add the signal to the controller.
+
+ * WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
+ * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:
+ * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
+ * WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
+ * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
+ (setSelectedTextRange): Change return type to bool.
+ * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
+ (setSelectedTextRange): Call atk_text_set_caret_offset and return bool.
+ * WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp:
+ (axObjectEventListener): Add notification name AXTextCaretMoved, allow
+ for extra arguments passed to handler and use it for text-caret-moved offset.
+ (WTR::AccessibilityNotificationHandler::connectAccessibilityCallbacks):
+ Connect callback to new listener for ATK:AtkText:text-caret-moved.
+ Refactor so that failures be reported.
+ Initialize atk interfaces before trying to connect to them, see
+ https://bugzilla.gnome.org/show_bug.cgi?id=729922
+ (WTR::AccessibilityNotificationHandler::disconnectAccessibilityCallbacks):
+ Simplify code by using a vector in place of dozen variables.
+ * DumpRenderTree/atk/AccessibilityCallbacksAtk.cpp:
+ Comment about not synchronizing with accessibilityController.
+
</ins><span class="cx"> 2014-06-11 Carlos Garcia Campos <cgarcia@igalia.com>
</span><span class="cx">
</span><span class="cx"> [GTK] Use a different user agent string depending on the site
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24ToolsDumpRenderTreeatkAccessibilityCallbacksAtkcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Tools/DumpRenderTree/atk/AccessibilityCallbacksAtk.cpp (170790 => 170791)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Tools/DumpRenderTree/atk/AccessibilityCallbacksAtk.cpp        2014-07-04 07:26:54 UTC (rev 170790)
+++ releases/WebKitGTK/webkit-2.4/Tools/DumpRenderTree/atk/AccessibilityCallbacksAtk.cpp        2014-07-04 07:43:35 UTC (rev 170791)
</span><span class="lines">@@ -57,6 +57,9 @@
</span><span class="cx"> static guint propertyChangedListenerId = 0;
</span><span class="cx"> static guint visibleDataChangedListenerId = 0;
</span><span class="cx"> static guint loadCompleteListenerId = 0;
</span><ins>+// Up to 2014 it was obligatory to mirror the changes from
+// WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp,
+// but the habit has been dropped: https://bugs.webkit.org/show_bug.cgi?id=132527#c6
</ins><span class="cx"> static NotificationHandlersMap notificationHandlers;
</span><span class="cx"> static AccessibilityNotificationHandler* globalNotificationHandler = 0;
</span><span class="cx">
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24ToolsWebKitTestRunnerInjectedBundleAccessibilityUIElementcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp (170790 => 170791)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp        2014-07-04 07:26:54 UTC (rev 170790)
+++ releases/WebKitGTK/webkit-2.4/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp        2014-07-04 07:43:35 UTC (rev 170791)
</span><span class="lines">@@ -166,7 +166,7 @@
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::rangeForLine(int) { return 0; }
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::rangeForPosition(int, int) { return 0; }
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::boundsForRange(unsigned, unsigned) { return 0; }
</span><del>-void AccessibilityUIElement::setSelectedTextRange(unsigned, unsigned) { }
</del><ins>+bool AccessibilityUIElement::setSelectedTextRange(unsigned, unsigned) { return false; }
</ins><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::stringForRange(unsigned, unsigned) { return 0; }
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::attributedStringForRange(unsigned, unsigned) { return 0; }
</span><span class="cx"> bool AccessibilityUIElement::attributedStringRangeIsMisspelled(unsigned, unsigned) { return false; }
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24ToolsWebKitTestRunnerInjectedBundleAccessibilityUIElementh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h (170790 => 170791)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h        2014-07-04 07:26:54 UTC (rev 170790)
+++ releases/WebKitGTK/webkit-2.4/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h        2014-07-04 07:43:35 UTC (rev 170791)
</span><span class="lines">@@ -198,7 +198,7 @@
</span><span class="cx"> JSRetainPtr<JSStringRef> rangeForLine(int);
</span><span class="cx"> JSRetainPtr<JSStringRef> rangeForPosition(int x, int y);
</span><span class="cx"> JSRetainPtr<JSStringRef> boundsForRange(unsigned location, unsigned length);
</span><del>- void setSelectedTextRange(unsigned location, unsigned length);
</del><ins>+ bool setSelectedTextRange(unsigned location, unsigned length);
</ins><span class="cx"> JSRetainPtr<JSStringRef> stringForRange(unsigned location, unsigned length);
</span><span class="cx"> JSRetainPtr<JSStringRef> attributedStringForRange(unsigned location, unsigned length);
</span><span class="cx"> bool attributedStringRangeIsMisspelled(unsigned location, unsigned length);
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24ToolsWebKitTestRunnerInjectedBundleBindingsAccessibilityUIElementidl"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl (170790 => 170791)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl        2014-07-04 07:26:54 UTC (rev 170790)
+++ releases/WebKitGTK/webkit-2.4/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl        2014-07-04 07:43:35 UTC (rev 170791)
</span><span class="lines">@@ -156,7 +156,7 @@
</span><span class="cx"> boolean attributedStringRangeIsMisspelled(unsigned long location, unsigned long length);
</span><span class="cx"> [PassContext] unsigned int uiElementCountForSearchPredicate(AccessibilityUIElement startElement, boolean isDirectionNext, object searchKey, DOMString searchText, boolean visibleOnly);
</span><span class="cx"> [PassContext] AccessibilityUIElement uiElementForSearchPredicate(AccessibilityUIElement startElement, boolean isDirectionNext, object searchKey, DOMString searchText, boolean visibleOnly);
</span><del>- void setSelectedTextRange(unsigned long location, unsigned long length);
</del><ins>+ boolean setSelectedTextRange(unsigned long location, unsigned long length);
</ins><span class="cx">
</span><span class="cx"> // Scroll area attributes.
</span><span class="cx"> readonly attribute AccessibilityUIElement horizontalScrollbar;
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24ToolsWebKitTestRunnerInjectedBundleatkAccessibilityNotificationHandlerAtkcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp (170790 => 170791)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp        2014-07-04 07:26:54 UTC (rev 170790)
+++ releases/WebKitGTK/webkit-2.4/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp        2014-07-04 07:43:35 UTC (rev 170791)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #include <WebKit2/WKBundlePage.h>
</span><span class="cx"> #include <WebKit2/WKBundlePagePrivate.h>
</span><span class="cx"> #include <wtf/HashMap.h>
</span><ins>+#include <wtf/Vector.h>
</ins><span class="cx"> #include <wtf/gobject/GUniquePtr.h>
</span><span class="cx"> #include <wtf/text/CString.h>
</span><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="lines">@@ -39,13 +40,7 @@
</span><span class="cx">
</span><span class="cx"> typedef HashMap<AtkObject*, AccessibilityNotificationHandler*> NotificationHandlersMap;
</span><span class="cx">
</span><del>-unsigned stateChangeListenerId = 0;
-unsigned focusEventListenerId = 0;
-unsigned activeDescendantChangedListenerId = 0;
-unsigned childrenChangedListenerId = 0;
-unsigned propertyChangedListenerId = 0;
-unsigned visibleDataChangedListenerId = 0;
-unsigned loadCompleteListenerId = 0;
</del><ins>+WTF::Vector<unsigned> listenerIds;
</ins><span class="cx"> NotificationHandlersMap notificationHandlers;
</span><span class="cx"> AccessibilityNotificationHandler* globalNotificationHandler = nullptr;
</span><span class="cx"> bool loggingAccessibilityEvents = false;
</span><span class="lines">@@ -82,10 +77,19 @@
</span><span class="cx"> if (!accessible || !ATK_IS_OBJECT(accessible))
</span><span class="cx"> return true;
</span><span class="cx">
</span><ins>+#if PLATFORM(GTK) || PLATFORM(EFL)
+ WKBundlePageRef page = InjectedBundle::shared().page()->page();
+ WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(page);
+ JSContextRef jsContext = WKBundleFrameGetJavaScriptContext(mainFrame);
+#else
+ JSContextRef jsContext = nullptr;
+#endif
+
</ins><span class="cx"> GSignalQuery signalQuery;
</span><span class="cx"> GUniquePtr<char> signalName;
</span><span class="cx"> GUniquePtr<char> signalValue;
</span><span class="cx"> const char* notificationName = nullptr;
</span><ins>+ Vector<JSValueRef> extraArgs;
</ins><span class="cx">
</span><span class="cx"> g_signal_query(signalHint->signal_id, &signalQuery);
</span><span class="cx">
</span><span class="lines">@@ -112,19 +116,18 @@
</span><span class="cx"> notificationName = "AXValueChanged";
</span><span class="cx"> } else if (!g_strcmp0(signalQuery.signal_name, "load-complete"))
</span><span class="cx"> notificationName = "AXLoadComplete";
</span><del>- else
</del><ins>+ else if (!g_strcmp0(signalQuery.signal_name, "text-caret-moved")) {
+ notificationName = "AXTextCaretMoved";
</ins><span class="cx"> signalName.reset(g_strdup(signalQuery.signal_name));
</span><ins>+ signalValue.reset(g_strdup_printf("%d", g_value_get_int(&paramValues[1])));
+ JSRetainPtr<JSStringRef> jsSignalValue(Adopt, JSStringCreateWithUTF8CString(signalValue.get()));
+ extraArgs.append(JSValueMakeString(jsContext, jsSignalValue.get()));
+ } else
+ signalName.reset(g_strdup(signalQuery.signal_name));
</ins><span class="cx">
</span><span class="cx"> if (loggingAccessibilityEvents)
</span><span class="cx"> printAccessibilityEvent(accessible, signalName.get(), signalValue.get());
</span><span class="cx">
</span><del>-#if PLATFORM(GTK) || PLATFORM(EFL)
- WKBundlePageRef page = InjectedBundle::shared().page()->page();
- WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(page);
- JSContextRef jsContext = WKBundleFrameGetJavaScriptContext(mainFrame);
-#else
- JSContextRef jsContext = nullptr;
-#endif
</del><span class="cx"> if (!jsContext)
</span><span class="cx"> return true;
</span><span class="cx">
</span><span class="lines">@@ -132,17 +135,25 @@
</span><span class="cx"> JSRetainPtr<JSStringRef> jsNotificationEventName(Adopt, JSStringCreateWithUTF8CString(notificationName));
</span><span class="cx"> JSValueRef notificationNameArgument = JSValueMakeString(jsContext, jsNotificationEventName.get());
</span><span class="cx"> NotificationHandlersMap::iterator elementNotificationHandler = notificationHandlers.find(accessible);
</span><ins>+ JSValueRef arguments[5]; // this dimension must be >= 2 + max(extraArgs.size())
+ arguments[0] = toJS(jsContext, WTF::getPtr(WTR::AccessibilityUIElement::create(accessible)));
+ arguments[1] = notificationNameArgument;
+ size_t numOfExtraArgs = extraArgs.size();
+ for (int i = 0; i < numOfExtraArgs; i++)
+ arguments[i + 2] = extraArgs[i];
</ins><span class="cx"> if (elementNotificationHandler != notificationHandlers.end()) {
</span><del>- // Listener for one element just gets one argument, the notification name.
- JSObjectCallAsFunction(jsContext, const_cast<JSObjectRef>(elementNotificationHandler->value->notificationFunctionCallback()), 0, 1, &notificationNameArgument, 0);
</del><ins>+ // Listener for one element. As arguments, it gets the notification name
+ // and sometimes extra arguments.
+ JSObjectCallAsFunction(jsContext,
+ const_cast<JSObjectRef>(elementNotificationHandler->value->notificationFunctionCallback()),
+ 0, numOfExtraArgs + 1, arguments + 1, 0);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (globalNotificationHandler) {
</span><del>- // A global listener gets the element and the notification name as arguments.
- JSValueRef arguments[2];
- arguments[0] = toJS(jsContext, WTF::getPtr(WTR::AccessibilityUIElement::create(accessible)));
- arguments[1] = notificationNameArgument;
- JSObjectCallAsFunction(jsContext, const_cast<JSObjectRef>(globalNotificationHandler->notificationFunctionCallback()), 0, 2, arguments, 0);
</del><ins>+ // A global listener gets additionally the element as the first argument.
+ JSObjectCallAsFunction(jsContext,
+ const_cast<JSObjectRef>(globalNotificationHandler->notificationFunctionCallback()),
+ 0, numOfExtraArgs + 2, arguments, 0);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -238,14 +249,34 @@
</span><span class="cx"> if (!disconnectAccessibilityCallbacks())
</span><span class="cx"> return;
</span><span class="cx">
</span><ins>+ const char* signalNames[] = {
+ "ATK:AtkObject:state-change",
+ "ATK:AtkObject:focus-event",
+ "ATK:AtkObject:active-descendant-changed",
+ "ATK:AtkObject:children-changed",
+ "ATK:AtkObject:property-change",
+ "ATK:AtkObject:visible-data-changed",
+ "ATK:AtkDocument:load-complete",
+ "ATK:AtkText:text-caret-moved",
+ 0
+ };
+
+ // Register atk interfaces, otherwise add_global may fail.
+ GObject* dummyObject = (GObject*)g_object_new(G_TYPE_OBJECT, NULL, NULL);
+ g_object_unref(atk_no_op_object_new(dummyObject));
+ g_object_unref(dummyObject);
+
</ins><span class="cx"> // Add global listeners for AtkObject's signals.
</span><del>- stateChangeListenerId = atk_add_global_event_listener(axObjectEventListener, "ATK:AtkObject:state-change");
- focusEventListenerId = atk_add_global_event_listener(axObjectEventListener, "ATK:AtkObject:focus-event");
- activeDescendantChangedListenerId = atk_add_global_event_listener(axObjectEventListener, "ATK:AtkObject:active-descendant-changed");
- childrenChangedListenerId = atk_add_global_event_listener(axObjectEventListener, "ATK:AtkObject:children-changed");
- propertyChangedListenerId = atk_add_global_event_listener(axObjectEventListener, "ATK:AtkObject:property-change");
- visibleDataChangedListenerId = atk_add_global_event_listener(axObjectEventListener, "ATK:AtkObject:visible-data-changed");
- loadCompleteListenerId = atk_add_global_event_listener(axObjectEventListener, "ATK:AtkDocument:load-complete");
</del><ins>+ for (const char** signalName = signalNames; *signalName; signalName++) {
+ unsigned id = atk_add_global_event_listener(axObjectEventListener, *signalName);
+ if (!id) {
+ String message = String::format("atk_add_global_event_listener failed for signal %s\n", *signalName);
+ InjectedBundle::shared().outputText(message);
+ continue;
+ }
+
+ listenerIds.append(id);
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool AccessibilityNotificationHandler::disconnectAccessibilityCallbacks()
</span><span class="lines">@@ -255,34 +286,11 @@
</span><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> // AtkObject signals.
</span><del>- if (stateChangeListenerId) {
- atk_remove_global_event_listener(stateChangeListenerId);
- stateChangeListenerId = 0;
</del><ins>+ for (int i = 0; i < listenerIds.size(); i++) {
+ ASSERT(listenerIds[i]);
+ atk_remove_global_event_listener(listenerIds[i]);
</ins><span class="cx"> }
</span><del>- if (focusEventListenerId) {
- atk_remove_global_event_listener(focusEventListenerId);
- focusEventListenerId = 0;
- }
- if (activeDescendantChangedListenerId) {
- atk_remove_global_event_listener(activeDescendantChangedListenerId);
- activeDescendantChangedListenerId = 0;
- }
- if (childrenChangedListenerId) {
- atk_remove_global_event_listener(childrenChangedListenerId);
- childrenChangedListenerId = 0;
- }
- if (propertyChangedListenerId) {
- atk_remove_global_event_listener(propertyChangedListenerId);
- propertyChangedListenerId = 0;
- }
- if (visibleDataChangedListenerId) {
- atk_remove_global_event_listener(visibleDataChangedListenerId);
- visibleDataChangedListenerId = 0;
- }
- if (loadCompleteListenerId) {
- atk_remove_global_event_listener(loadCompleteListenerId);
- loadCompleteListenerId = 0;
- }
</del><ins>+ listenerIds.clear();
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24ToolsWebKitTestRunnerInjectedBundleatkAccessibilityUIElementAtkcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp (170790 => 170791)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp        2014-07-04 07:26:54 UTC (rev 170790)
+++ releases/WebKitGTK/webkit-2.4/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp        2014-07-04 07:43:35 UTC (rev 170791)
</span><span class="lines">@@ -1406,12 +1406,15 @@
</span><span class="cx"> return JSStringCreateWithUTF8CString(selection.get());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void AccessibilityUIElement::setSelectedTextRange(unsigned location, unsigned length)
</del><ins>+bool AccessibilityUIElement::setSelectedTextRange(unsigned location, unsigned length)
</ins><span class="cx"> {
</span><span class="cx"> if (!ATK_IS_TEXT(m_element.get()))
</span><del>- return;
</del><ins>+ return false;
</ins><span class="cx">
</span><del>- atk_text_set_selection(ATK_TEXT(m_element.get()), 0, location, location + length);
</del><ins>+ if (!length)
+ return atk_text_set_caret_offset(ATK_TEXT(m_element.get()), location);
+
+ return atk_text_set_selection(ATK_TEXT(m_element.get()), 0, location, location + length);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void AccessibilityUIElement::increment()
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24ToolsWebKitTestRunnerInjectedBundleiosAccessibilityUIElementIOSmm"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm (170790 => 170791)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm        2014-07-04 07:26:54 UTC (rev 170790)
+++ releases/WebKitGTK/webkit-2.4/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm        2014-07-04 07:43:35 UTC (rev 170791)
</span><span class="lines">@@ -541,8 +541,9 @@
</span><span class="cx"> return JSStringCreateWithCharacters(0, 0);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void AccessibilityUIElement::setSelectedTextRange(unsigned location, unsigned length)
</del><ins>+bool AccessibilityUIElement::setSelectedTextRange(unsigned location, unsigned length)
</ins><span class="cx"> {
</span><ins>+ return false;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void AccessibilityUIElement::increment()
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24ToolsWebKitTestRunnerInjectedBundlemacAccessibilityUIElementMacmm"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm (170790 => 170791)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm        2014-07-04 07:26:54 UTC (rev 170790)
+++ releases/WebKitGTK/webkit-2.4/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm        2014-07-04 07:43:35 UTC (rev 170791)
</span><span class="lines">@@ -1289,13 +1289,15 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void AccessibilityUIElement::setSelectedTextRange(unsigned location, unsigned length)
</del><ins>+bool AccessibilityUIElement::setSelectedTextRange(unsigned location, unsigned length)
</ins><span class="cx"> {
</span><span class="cx"> NSRange textRange = NSMakeRange(location, length);
</span><span class="cx"> NSValue *textRangeValue = [NSValue valueWithRange:textRange];
</span><span class="cx"> BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="cx"> [m_element accessibilitySetValue:textRangeValue forAttribute:NSAccessibilitySelectedTextRangeAttribute];
</span><span class="cx"> END_AX_OBJC_EXCEPTIONS
</span><ins>+
+ return true;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void AccessibilityUIElement::increment()
</span></span></pre>
</div>
</div>
</body>
</html>