<!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>[170008] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/170008">170008</a></dd>
<dt>Author</dt> <dd>mario.prada@samsung.com</dd>
<dt>Date</dt> <dd>2014-06-16 08:01:06 -0700 (Mon, 16 Jun 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[ATK] Missing 'selection-changed' signal when navigating a combo box with keyboard
https://bugs.webkit.org/show_bug.cgi?id=133512

Reviewed by Chris Fleizach.

Source/WebCore:
Make sure that AccessibilityMenuList objects update their active
option when it changes, which will send a platform-dependent
accessibility-related notification when needed.

Test: accessibility/combo-box-collapsed-selection-changed.html

* rendering/RenderMenuList.cpp:
(RenderMenuList::didUpdateActiveOption): Keep the out-of-bounds
check for the index passed but don't avoid updating the option for
the associated AccessibilityMenuList object if the selected list
item does not have a renderer, because that could be the case for
cases where the popup (and its elements) would be rendered in the
UI Process (e.g. GTK+ port uses GtkMenu and GtkMenuItem for that).

* accessibility/AccessibilityMenuList.cpp:
(WebCore::AccessibilityMenuList::didUpdateActiveOption): Ensure
that the AccessibilityMenuListPopup object for a given menu list
has accessibility children before updating its active option.

Tools:
Added support for connecting to AtkSelection's 'selection-changed'
signal, and print it out as AXSelectedChildrenChanged in the tests.

Also removed some dead code, that became useless after <a href="http://trac.webkit.org/projects/webkit/changeset/169487">r169487</a>.

* WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp:
(WTR::AccessibilityNotificationHandler::connectAccessibilityCallbacks): Updated.

LayoutTests:
Re-implemented test for combo boxes in terms of addNotificationListener()
instead of using the (already deprecated) logAccessibilityEvents method,
and made the test cross platform (as the fix is not platform specific).

* accessibility/combo-box-collapsed-selection-changed.html:
Implemented based on the former gtk-only test, and made it cross-platform.
* accessibility/combo-box-collapsed-selection-changed-expected.txt: New.
* platform/gtk/accessibility/combo-box-collapsed-selection-changed.html: Removed.
* platform/gtk/accessibility/combo-box-collapsed-selection-changed-expected.txt: Removed.

Updated expectation for test that checks that a notification is
sent when navigating through a multiselection list box, now that
we are actually printing such a notification.

* accessibility/multiselect-list-reports-active-option-expected.txt: Updated.

Removed two expected failures from TestExpectations for tests that
are now passing, one for the combo box test mentioned above and
another one for a test that is passing as well now, after applying
this fix: accessibility/menu-list-sends-change-notification.html

* platform/gtk/TestExpectations: Removed two 'failure' expectations.

* platform/mac/TestExpectations: Skip accessiblity test timing out, probably because
those kind of notifications while navigating a combo box are not needed in the Mac.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsaccessibilitymultiselectlistreportsactiveoptionexpectedtxt">trunk/LayoutTests/accessibility/multiselect-list-reports-active-option-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformgtkTestExpectations">trunk/LayoutTests/platform/gtk/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformmacTestExpectations">trunk/LayoutTests/platform/mac/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityMenuListcpp">trunk/Source/WebCore/accessibility/AccessibilityMenuList.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderMenuListcpp">trunk/Source/WebCore/rendering/RenderMenuList.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleatkAccessibilityNotificationHandlerAtkcpp">trunk/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsaccessibilitycomboboxcollapsedselectionchangedexpectedtxt">trunk/LayoutTests/accessibility/combo-box-collapsed-selection-changed-expected.txt</a></li>
<li><a href="#trunkLayoutTestsaccessibilitycomboboxcollapsedselectionchangedhtml">trunk/LayoutTests/accessibility/combo-box-collapsed-selection-changed.html</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsplatformgtkaccessibilitycomboboxcollapsedselectionchangedexpectedtxt">trunk/LayoutTests/platform/gtk/accessibility/combo-box-collapsed-selection-changed-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformgtkaccessibilitycomboboxcollapsedselectionchangedhtml">trunk/LayoutTests/platform/gtk/accessibility/combo-box-collapsed-selection-changed.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (170007 => 170008)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-06-16 12:17:10 UTC (rev 170007)
+++ trunk/LayoutTests/ChangeLog        2014-06-16 15:01:06 UTC (rev 170008)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2014-06-16  Mario Sanchez Prada  &lt;mario.prada@samsung.com&gt;
+
+        [ATK] Missing 'selection-changed' signal when navigating a combo box with keyboard
+        https://bugs.webkit.org/show_bug.cgi?id=133512
+
+        Reviewed by Chris Fleizach.
+
+        Re-implemented test for combo boxes in terms of addNotificationListener()
+        instead of using the (already deprecated) logAccessibilityEvents method,
+        and made the test cross platform (as the fix is not platform specific).
+
+        * accessibility/combo-box-collapsed-selection-changed.html:
+        Implemented based on the former gtk-only test, and made it cross-platform.
+        * accessibility/combo-box-collapsed-selection-changed-expected.txt: New.
+        * platform/gtk/accessibility/combo-box-collapsed-selection-changed.html: Removed.
+        * platform/gtk/accessibility/combo-box-collapsed-selection-changed-expected.txt: Removed.
+
+        Updated expectation for test that checks that a notification is
+        sent when navigating through a multiselection list box, now that
+        we are actually printing such a notification.
+
+        * accessibility/multiselect-list-reports-active-option-expected.txt: Updated.
+
+        Removed two expected failures from TestExpectations for tests that
+        are now passing, one for the combo box test mentioned above and
+        another one for a test that is passing as well now, after applying
+        this fix: accessibility/menu-list-sends-change-notification.html
+
+        * platform/gtk/TestExpectations: Removed two 'failure' expectations.
+
+        * platform/mac/TestExpectations: Skip accessiblity test timing out, probably because
+        those kind of notifications while navigating a combo box are not needed in the Mac.
+
</ins><span class="cx"> 2014-06-16  Frédéric Wang  &lt;fred.wang@free.fr&gt;
</span><span class="cx"> 
</span><span class="cx">         Draw radicals with glyphs for better rendering
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilitycomboboxcollapsedselectionchangedexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/accessibility/combo-box-collapsed-selection-changed-expected.txt (0 => 170008)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/combo-box-collapsed-selection-changed-expected.txt                                (rev 0)
+++ trunk/LayoutTests/accessibility/combo-box-collapsed-selection-changed-expected.txt        2014-06-16 15:01:06 UTC (rev 170008)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+
+This tests that a combo box notifies when the selected child has changed while arrowing through the options of a combobox while collapsed.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS selectionChangedNotifications is 4
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsaccessibilitycomboboxcollapsedselectionchangedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/accessibility/combo-box-collapsed-selection-changed.html (0 => 170008)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/combo-box-collapsed-selection-changed.html                                (rev 0)
+++ trunk/LayoutTests/accessibility/combo-box-collapsed-selection-changed.html        2014-06-16 15:01:06 UTC (rev 170008)
</span><span class="lines">@@ -0,0 +1,57 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;form&gt;
+&lt;select id=&quot;combo&quot;&gt;
+&lt;option selected value='foo'&gt;foo&lt;/option&gt;
+&lt;option value='bar'&gt;bar&lt;/option&gt;
+&lt;option value='baz'&gt;baz&lt;/option&gt;
+&lt;/select&gt;
+&lt;/form&gt;
+
+&lt;p id=&quot;description&quot;&gt;&lt;/p&gt;
+&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+
+&lt;script&gt;
+window.jsTestIsAsync = true;
+
+description(&quot;This tests that a combo box notifies when the selected child has changed while arrowing through the options of a combobox while collapsed.&quot;);
+
+var selectionChangedNotifications = 0;
+
+if (window.testRunner &amp;&amp; window.accessibilityController) {
+    testRunner.dumpAsText();
+
+    // Focus in the combobox and move around the options. The signal
+    // 'state-change:selected' should be emitted with every change.
+    document.getElementById(&quot;combo&quot;).focus();
+
+    axCombo = accessibilityController.focusedElement;
+    axCombo.addNotificationListener(function (notification) {
+        if (notification == &quot;AXSelectedChildrenChanged&quot;)
+            selectionChangedNotifications++;
+    });
+
+    eventSender.keyDown(&quot;downArrow&quot;);
+    eventSender.keyDown(&quot;downArrow&quot;);
+    eventSender.keyDown(&quot;upArrow&quot;);
+    eventSender.keyDown(&quot;upArrow&quot;);
+
+    window.setTimeout(function() {
+        if (window.accessibilityController)
+            axCombo.removeNotificationListener();
+
+        shouldBe(&quot;selectionChangedNotifications&quot;, &quot;4&quot;);
+        finishJSTest();
+    }, 0);
+}
+&lt;/script&gt;
+&lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsaccessibilitymultiselectlistreportsactiveoptionexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/accessibility/multiselect-list-reports-active-option-expected.txt (170007 => 170008)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/multiselect-list-reports-active-option-expected.txt        2014-06-16 12:17:10 UTC (rev 170007)
+++ trunk/LayoutTests/accessibility/multiselect-list-reports-active-option-expected.txt        2014-06-16 15:01:06 UTC (rev 170008)
</span><span class="lines">@@ -22,6 +22,8 @@
</span><span class="cx"> PASS accessibleTwo.isSelectedOptionActive is false
</span><span class="cx"> PASS accessibleThree.isSelected is true
</span><span class="cx"> PASS accessibleThree.isSelectedOptionActive is true
</span><ins>+List notification: AXSelectedChildrenChanged
+List notification: AXSelectedChildrenChanged
</ins><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtkTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/TestExpectations (170007 => 170008)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/TestExpectations        2014-06-16 12:17:10 UTC (rev 170007)
+++ trunk/LayoutTests/platform/gtk/TestExpectations        2014-06-16 15:01:06 UTC (rev 170008)
</span><span class="lines">@@ -1681,8 +1681,6 @@
</span><span class="cx"> webkit.org/b/113772 http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_iframe_self_navigation.html [ Failure ]
</span><span class="cx"> webkit.org/b/113772 http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_cached.html [ Failure ]
</span><span class="cx"> 
</span><del>-webkit.org/b/114259 platform/gtk/accessibility/combo-box-collapsed-selection-changed.html [ Failure ]
-
</del><span class="cx"> webkit.org/b/115025 fast/events/constructors/mouse-event-constructor.html [ Failure ]
</span><span class="cx"> webkit.org/b/115025 fast/events/constructors/wheel-event-constructor.html [ Failure ]
</span><span class="cx"> 
</span><span class="lines">@@ -1786,8 +1784,6 @@
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/125406 fast/regions/relative-in-absolute-borders-overflow.html [ ImageOnlyFailure ]
</span><span class="cx"> 
</span><del>-webkit.org/b/126521 accessibility/menu-list-sends-change-notification.html [ Failure ]
-
</del><span class="cx"> webkit.org/b/126619 http/tests/media/video-auth.html [ Failure ]
</span><span class="cx"> 
</span><span class="cx"> # Subpixel rendering: borders are reporting float values.
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtkaccessibilitycomboboxcollapsedselectionchangedexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/platform/gtk/accessibility/combo-box-collapsed-selection-changed-expected.txt (170007 => 170008)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/accessibility/combo-box-collapsed-selection-changed-expected.txt        2014-06-16 12:17:10 UTC (rev 170007)
+++ trunk/LayoutTests/platform/gtk/accessibility/combo-box-collapsed-selection-changed-expected.txt        2014-06-16 15:01:06 UTC (rev 170008)
</span><span class="lines">@@ -1,36 +0,0 @@
</span><del>-Accessibility object emitted &quot;focus-event = 1&quot; / Name: &quot;bar&quot; / Role: 11
-Accessibility object emitted &quot;state-change:focused = 1&quot; / Name: &quot;bar&quot; / Role: 11
-Accessibility object emitted &quot;state-change:selected = 1&quot; / Name: &quot;bar&quot; / Role: 34
-Accessibility object emitted &quot;focus-event = 1&quot; / Name: &quot;bar&quot; / Role: 34
-Accessibility object emitted &quot;state-change:focused = 1&quot; / Name: &quot;bar&quot; / Role: 34
-Accessibility object emitted &quot;focus-event = 1&quot; / Name: &quot;baz&quot; / Role: 11
-Accessibility object emitted &quot;state-change:focused = 1&quot; / Name: &quot;baz&quot; / Role: 11
-Accessibility object emitted &quot;focus-event = 0&quot; / Name: &quot;bar&quot; / Role: 34
-Accessibility object emitted &quot;state-change:focused = 0&quot; / Name: &quot;bar&quot; / Role: 34
-Accessibility object emitted &quot;state-change:selected = 1&quot; / Name: &quot;baz&quot; / Role: 34
-Accessibility object emitted &quot;focus-event = 1&quot; / Name: &quot;baz&quot; / Role: 34
-Accessibility object emitted &quot;state-change:focused = 1&quot; / Name: &quot;baz&quot; / Role: 34
-Accessibility object emitted &quot;focus-event = 1&quot; / Name: &quot;bar&quot; / Role: 11
-Accessibility object emitted &quot;state-change:focused = 1&quot; / Name: &quot;bar&quot; / Role: 11
-Accessibility object emitted &quot;focus-event = 0&quot; / Name: &quot;baz&quot; / Role: 34
-Accessibility object emitted &quot;state-change:focused = 0&quot; / Name: &quot;baz&quot; / Role: 34
-Accessibility object emitted &quot;state-change:selected = 1&quot; / Name: &quot;bar&quot; / Role: 34
-Accessibility object emitted &quot;focus-event = 1&quot; / Name: &quot;bar&quot; / Role: 34
-Accessibility object emitted &quot;state-change:focused = 1&quot; / Name: &quot;bar&quot; / Role: 34
-Accessibility object emitted &quot;focus-event = 1&quot; / Name: &quot;foo&quot; / Role: 11
-Accessibility object emitted &quot;state-change:focused = 1&quot; / Name: &quot;foo&quot; / Role: 11
-Accessibility object emitted &quot;focus-event = 0&quot; / Name: &quot;bar&quot; / Role: 34
-Accessibility object emitted &quot;state-change:focused = 0&quot; / Name: &quot;bar&quot; / Role: 34
-Accessibility object emitted &quot;state-change:selected = 1&quot; / Name: &quot;foo&quot; / Role: 34
-Accessibility object emitted &quot;focus-event = 1&quot; / Name: &quot;foo&quot; / Role: 34
-Accessibility object emitted &quot;state-change:focused = 1&quot; / Name: &quot;foo&quot; / Role: 34
-
-This tests that the 'state-changed:selected' signal is emitted when arrowing through the options of a combobox while collapsed.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestsplatformgtkaccessibilitycomboboxcollapsedselectionchangedhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/platform/gtk/accessibility/combo-box-collapsed-selection-changed.html (170007 => 170008)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/accessibility/combo-box-collapsed-selection-changed.html        2014-06-16 12:17:10 UTC (rev 170007)
+++ trunk/LayoutTests/platform/gtk/accessibility/combo-box-collapsed-selection-changed.html        2014-06-16 15:01:06 UTC (rev 170008)
</span><span class="lines">@@ -1,42 +0,0 @@
</span><del>-&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
-&lt;html&gt;
-&lt;head&gt;
-&lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
-&lt;script&gt;
-
-function runTest() {
-  description(&quot;This tests that the 'state-changed:selected' signal is emitted when arrowing through the options of a combobox while collapsed.&quot;);
-
-  if (window.testRunner) {
-    testRunner.dumpAsText();
-  }
-
-  if (window.accessibilityController) {
-    accessibilityController.logAccessibilityEvents();
-  }
-
-  // Focus in the combobox and move around the options. The signal
-  // 'state-change:selected' should be emitted with every change.
-  document.getElementById(&quot;combo&quot;).focus();
-  eventSender.keyDown(&quot;downArrow&quot;);
-  eventSender.keyDown(&quot;downArrow&quot;);
-  eventSender.keyDown(&quot;upArrow&quot;);
-  eventSender.keyDown(&quot;upArrow&quot;);
-}
-&lt;/script&gt;
-&lt;/head&gt;
-&lt;body onload=&quot;runTest();&quot;&gt;
-&lt;form&gt;
-&lt;select id=&quot;combo&quot;&gt;
-&lt;option selected value='foo'&gt;foo&lt;/option&gt;
-&lt;option value='bar'&gt;bar&lt;/option&gt;
-&lt;option value='baz'&gt;baz&lt;/option&gt;
-&lt;/select&gt;
-&lt;/form&gt;
-&lt;p id=&quot;description&quot;&gt;&lt;/p&gt;
-&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
-&lt;script&gt;
-&lt;/script&gt;
-&lt;script src=&quot;../../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkLayoutTestsplatformmacTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/TestExpectations (170007 => 170008)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/TestExpectations        2014-06-16 12:17:10 UTC (rev 170007)
+++ trunk/LayoutTests/platform/mac/TestExpectations        2014-06-16 15:01:06 UTC (rev 170008)
</span><span class="lines">@@ -41,6 +41,7 @@
</span><span class="cx"> 
</span><span class="cx"> # Accessibility tests for notifications that don't exist or aren't needed on Mac OS X.
</span><span class="cx"> accessibility/aria-checkbox-sends-notification.html
</span><ins>+accessibility/combo-box-collapsed-selection-changed.html
</ins><span class="cx"> accessibility/children-changed-sends-notification.html
</span><span class="cx"> accessibility/menu-list-sends-change-notification.html
</span><span class="cx"> accessibility/multiselect-list-reports-active-option.html
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (170007 => 170008)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-06-16 12:17:10 UTC (rev 170007)
+++ trunk/Source/WebCore/ChangeLog        2014-06-16 15:01:06 UTC (rev 170008)
</span><span class="lines">@@ -1,3 +1,29 @@
</span><ins>+2014-06-16  Mario Sanchez Prada  &lt;mario.prada@samsung.com&gt;
+
+        [ATK] Missing 'selection-changed' signal when navigating a combo box with keyboard
+        https://bugs.webkit.org/show_bug.cgi?id=133512
+
+        Reviewed by Chris Fleizach.
+
+        Make sure that AccessibilityMenuList objects update their active
+        option when it changes, which will send a platform-dependent
+        accessibility-related notification when needed.
+
+        Test: accessibility/combo-box-collapsed-selection-changed.html
+
+        * rendering/RenderMenuList.cpp:
+        (RenderMenuList::didUpdateActiveOption): Keep the out-of-bounds
+        check for the index passed but don't avoid updating the option for
+        the associated AccessibilityMenuList object if the selected list
+        item does not have a renderer, because that could be the case for
+        cases where the popup (and its elements) would be rendered in the
+        UI Process (e.g. GTK+ port uses GtkMenu and GtkMenuItem for that).
+
+        * accessibility/AccessibilityMenuList.cpp:
+        (WebCore::AccessibilityMenuList::didUpdateActiveOption): Ensure
+        that the AccessibilityMenuListPopup object for a given menu list
+        has accessibility children before updating its active option.
+
</ins><span class="cx"> 2014-06-16  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r170003.
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityMenuListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityMenuList.cpp (170007 => 170008)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityMenuList.cpp        2014-06-16 12:17:10 UTC (rev 170007)
+++ trunk/Source/WebCore/accessibility/AccessibilityMenuList.cpp        2014-06-16 15:01:06 UTC (rev 170008)
</span><span class="lines">@@ -113,7 +113,14 @@
</span><span class="cx">         ASSERT(childObjects.size() == 1);
</span><span class="cx">         ASSERT(childObjects[0]-&gt;isMenuListPopup());
</span><span class="cx"> 
</span><del>-        if (childObjects[0]-&gt;isMenuListPopup()) {
</del><ins>+        // We might be calling this method in situations where the renderers for list items
+        // associated to the menu list have not been created (e.g. they might be rendered
+        // in the UI process, as it's the case in the GTK+ port, which uses GtkMenuItem).
+        // So, we need to make sure that the accessibility popup object has some children
+        // before asking it to update its active option, or it will read invalid memory.
+        // You can reproduce the issue in the GTK+ port by removing this check and running
+        // accessibility/insert-selected-option-into-select-causes-crash.html (will crash).
+        if (childObjects[0]-&gt;isMenuListPopup() &amp;&amp; childObjects[0]-&gt;children().size()) {
</ins><span class="cx">             if (AccessibilityMenuListPopup* popup = toAccessibilityMenuListPopup(childObjects[0].get()))
</span><span class="cx">                 popup-&gt;didUpdateActiveOption(optionIndex);
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderMenuListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderMenuList.cpp (170007 => 170008)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderMenuList.cpp        2014-06-16 12:17:10 UTC (rev 170007)
+++ trunk/Source/WebCore/rendering/RenderMenuList.cpp        2014-06-16 15:01:06 UTC (rev 170008)
</span><span class="lines">@@ -436,10 +436,8 @@
</span><span class="cx">     if (listIndex &lt; 0 || listIndex &gt;= static_cast&lt;int&gt;(selectElement().listItems().size()))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    HTMLElement* listItem = selectElement().listItems()[listIndex];
-    ASSERT(listItem);
-    if (listItem-&gt;renderer()) {
-        if (AccessibilityMenuList* menuList = toAccessibilityMenuList(document().axObjectCache()-&gt;get(this)))
</del><ins>+    if (AXObjectCache* cache = document().existingAXObjectCache()) {
+        if (AccessibilityMenuList* menuList = toAccessibilityMenuList(cache-&gt;get(this)))
</ins><span class="cx">             menuList-&gt;didUpdateActiveOption(optionIndex);
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (170007 => 170008)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2014-06-16 12:17:10 UTC (rev 170007)
+++ trunk/Tools/ChangeLog        2014-06-16 15:01:06 UTC (rev 170008)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2014-06-16  Mario Sanchez Prada  &lt;mario.prada@samsung.com&gt;
+
+        [ATK] Missing 'selection-changed' signal when navigating a combo box with keyboard
+        https://bugs.webkit.org/show_bug.cgi?id=133512
+
+        Reviewed by Chris Fleizach.
+
+        Added support for connecting to AtkSelection's 'selection-changed'
+        signal, and print it out as AXSelectedChildrenChanged in the tests.
+
+        Also removed some dead code, that became useless after r169487.
+
+        * WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp:
+        (WTR::AccessibilityNotificationHandler::connectAccessibilityCallbacks): Updated.
+
</ins><span class="cx"> 2014-06-15  Ryuan Choi  &lt;ryuan.choi@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [EFL][WK2] Change ewk_view_settings_get to ewk_page_group_settings_get
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleatkAccessibilityNotificationHandlerAtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp (170007 => 170008)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp        2014-06-16 12:17:10 UTC (rev 170007)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp        2014-06-16 15:01:06 UTC (rev 170008)
</span><span class="lines">@@ -63,44 +63,35 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     GSignalQuery signalQuery;
</span><del>-    GUniquePtr&lt;char&gt; signalName;
-    GUniquePtr&lt;char&gt; signalValue;
</del><span class="cx">     const char* notificationName = nullptr;
</span><span class="cx">     Vector&lt;JSValueRef&gt; extraArgs;
</span><span class="cx"> 
</span><span class="cx">     g_signal_query(signalHint-&gt;signal_id, &amp;signalQuery);
</span><span class="cx"> 
</span><span class="cx">     if (!g_strcmp0(signalQuery.signal_name, &quot;state-change&quot;)) {
</span><del>-        signalName.reset(g_strdup_printf(&quot;state-change:%s&quot;, g_value_get_string(&amp;paramValues[1])));
-        signalValue.reset(g_strdup_printf(&quot;%d&quot;, g_value_get_boolean(&amp;paramValues[2])));
</del><span class="cx">         if (!g_strcmp0(g_value_get_string(&amp;paramValues[1]), &quot;checked&quot;))
</span><span class="cx">             notificationName = &quot;CheckedStateChanged&quot;;
</span><span class="cx">         else if (!g_strcmp0(g_value_get_string(&amp;paramValues[1]), &quot;invalid-entry&quot;))
</span><span class="cx">             notificationName = &quot;AXInvalidStatusChanged&quot;;
</span><span class="cx">     } else if (!g_strcmp0(signalQuery.signal_name, &quot;focus-event&quot;)) {
</span><del>-        signalName.reset(g_strdup(&quot;focus-event&quot;));
-        signalValue.reset(g_strdup_printf(&quot;%d&quot;, g_value_get_boolean(&amp;paramValues[1])));
</del><span class="cx">         if (g_value_get_boolean(&amp;paramValues[1]))
</span><span class="cx">             notificationName = &quot;AXFocusedUIElementChanged&quot;;
</span><ins>+    } else if (!g_strcmp0(signalQuery.signal_name, &quot;selection-changed&quot;)) {
+        notificationName = &quot;AXSelectedChildrenChanged&quot;;
</ins><span class="cx">     } else if (!g_strcmp0(signalQuery.signal_name, &quot;children-changed&quot;)) {
</span><span class="cx">         const gchar* childrenChangedDetail = g_quark_to_string(signalHint-&gt;detail);
</span><del>-        signalName.reset(g_strdup_printf(&quot;children-changed:%s&quot;, childrenChangedDetail));
-        signalValue.reset(g_strdup_printf(&quot;%d&quot;, g_value_get_uint(&amp;paramValues[1])));
</del><span class="cx">         notificationName = !g_strcmp0(childrenChangedDetail, &quot;add&quot;) ? &quot;AXChildrenAdded&quot; : &quot;AXChildrenRemoved&quot;;
</span><span class="cx">     } else if (!g_strcmp0(signalQuery.signal_name, &quot;property-change&quot;)) {
</span><del>-        signalName.reset(g_strdup_printf(&quot;property-change:%s&quot;, g_quark_to_string(signalHint-&gt;detail)));
</del><span class="cx">         if (!g_strcmp0(g_quark_to_string(signalHint-&gt;detail), &quot;accessible-value&quot;))
</span><span class="cx">             notificationName = &quot;AXValueChanged&quot;;
</span><span class="cx">     } else if (!g_strcmp0(signalQuery.signal_name, &quot;load-complete&quot;))
</span><span class="cx">         notificationName = &quot;AXLoadComplete&quot;;
</span><span class="cx">     else if (!g_strcmp0(signalQuery.signal_name, &quot;text-caret-moved&quot;)) {
</span><span class="cx">         notificationName = &quot;AXTextCaretMoved&quot;;
</span><del>-        signalName.reset(g_strdup(signalQuery.signal_name));
-        signalValue.reset(g_strdup_printf(&quot;%d&quot;, g_value_get_int(&amp;paramValues[1])));
</del><ins>+        GUniquePtr&lt;char&gt; signalValue(g_strdup_printf(&quot;%d&quot;, g_value_get_int(&amp;paramValues[1])));
</ins><span class="cx">         JSRetainPtr&lt;JSStringRef&gt; jsSignalValue(Adopt, JSStringCreateWithUTF8CString(signalValue.get()));
</span><span class="cx">         extraArgs.append(JSValueMakeString(jsContext, jsSignalValue.get()));
</span><del>-    } else
-        signalName.reset(g_strdup(signalQuery.signal_name));
</del><ins>+    }
</ins><span class="cx"> 
</span><span class="cx">     if (!jsContext)
</span><span class="cx">         return true;
</span><span class="lines">@@ -225,6 +216,7 @@
</span><span class="cx">         &quot;ATK:AtkObject:property-change&quot;,
</span><span class="cx">         &quot;ATK:AtkObject:visible-data-changed&quot;,
</span><span class="cx">         &quot;ATK:AtkDocument:load-complete&quot;,
</span><ins>+        &quot;ATK:AtkSelection:selection-changed&quot;,
</ins><span class="cx">         &quot;ATK:AtkText:text-caret-moved&quot;,
</span><span class="cx">         0
</span><span class="cx">     };
</span></span></pre>
</div>
</div>

</body>
</html>