[ATK] Missing WTR AccessibilityController::addNotificationListener implementation
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Sep 2013 14:24:07 +0000 (14:24 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Sep 2013 14:24:07 +0000 (14:24 +0000)
https://bugs.webkit.org/show_bug.cgi?id=121674

Patch by Denis Nomiyama <d.nomiyama@samsung.com> on 2013-09-24
Reviewed by Mario Sanchez Prada.

Tools:

Implemented the global notification listener for
AccessibilityController. The signal is generated by
AXObjectCache::postPlatformNotification() and received by
axObjectEventListener(). axObjectEventListener will then invoke
JSObjectCallAsFunction() with the respective callback function.

There is no additional test for this patch since its implementation will
be tested by an accessibility layout test that is currently failing
(accessibility/loading-iframe-sends-notification.html).

* WebKitTestRunner/InjectedBundle/AccessibilityController.cpp: Removed
stub implementations of addNotificationListener and
removeNotificationListener for the GTK port.
* WebKitTestRunner/InjectedBundle/atk/AccessibilityControllerAtk.cpp:
(WTR::AccessibilityController::addNotificationListener): Creates the
notification handler and sets the notification function callback.
(WTR::AccessibilityController::removeNotificationListener): Removes the
global handler.

LayoutTests:

Updated the expectation of loading-iframe-sends-notification.html test,
which was failing before this fix.

* platform/gtk-wk2/TestExpectations: Removed
loading-iframe-sends-notification.html because it now passes with this
fix.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156332 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/gtk-wk2/TestExpectations
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.cpp
Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityControllerAtk.cpp

index d5e0ae95a36c9daed3ca0b4a786abdf2f4c294ae..0263785c5b2937a3e5cc603e3ca291fd0591c5f9 100644 (file)
@@ -1,3 +1,17 @@
+2013-09-24  Denis Nomiyama  <d.nomiyama@samsung.com>
+
+        [ATK] Missing WTR AccessibilityController::addNotificationListener implementation
+        https://bugs.webkit.org/show_bug.cgi?id=121674
+
+        Reviewed by Mario Sanchez Prada.
+
+        Updated the expectation of loading-iframe-sends-notification.html test,
+        which was failing before this fix.
+
+        * platform/gtk-wk2/TestExpectations: Removed
+        loading-iframe-sends-notification.html because it now passes with this
+        fix.
+
 2013-09-24  Anton Obzhirov  <a.obzhirov@samsung.com>
 
         [GTK] fast/images/exif-orientation-composited.html is failing
index 1127bb954b49cf38432f84fe45ef2cdcbf1fd31b..7cb8eb98eeafcb61f89555d5422f530090206e71 100644 (file)
@@ -336,7 +336,6 @@ webkit.org/b/106334 accessibility/accessibility-node-memory-management.html [ Fa
 webkit.org/b/106335 accessibility/accessibility-node-reparent.html [ Failure ]
 webkit.org/b/106338 accessibility/aria-hidden-updates-alldescendants.html [ Failure ]
 webkit.org/b/106340 accessibility/img-fallsback-to-title.html [ Failure ]
-webkit.org/b/106343 accessibility/loading-iframe-sends-notification.html [ Failure ]
 webkit.org/b/106345 platform/gtk/accessibility/input-slider.html [ Failure ]
 webkit.org/b/116970 accessibility/multiselect-list-reports-active-option.html [ Failure ]
 webkit.org/b/116971 accessibility/poorly-formed-aria-table.html [ Failure ]
index 98b8dbf5d5b3fb928b191962442d02daff4cb30d..16b671c41ef5cd8a426e6117f9c00c1ea239f4eb 100644 (file)
@@ -1,3 +1,29 @@
+2013-09-24  Denis Nomiyama  <d.nomiyama@samsung.com>
+
+        [ATK] Missing WTR AccessibilityController::addNotificationListener implementation
+        https://bugs.webkit.org/show_bug.cgi?id=121674
+
+        Reviewed by Mario Sanchez Prada.
+
+        Implemented the global notification listener for
+        AccessibilityController. The signal is generated by
+        AXObjectCache::postPlatformNotification() and received by
+        axObjectEventListener(). axObjectEventListener will then invoke
+        JSObjectCallAsFunction() with the respective callback function.
+
+        There is no additional test for this patch since its implementation will
+        be tested by an accessibility layout test that is currently failing
+        (accessibility/loading-iframe-sends-notification.html).
+
+        * WebKitTestRunner/InjectedBundle/AccessibilityController.cpp: Removed
+        stub implementations of addNotificationListener and
+        removeNotificationListener for the GTK port.
+        * WebKitTestRunner/InjectedBundle/atk/AccessibilityControllerAtk.cpp:
+        (WTR::AccessibilityController::addNotificationListener): Creates the
+        notification handler and sets the notification function callback.
+        (WTR::AccessibilityController::removeNotificationListener): Removes the
+        global handler.
+
 2013-09-24  Anton Obzhirov  <a.obzhirov@samsung.com>
 
         [GTK] fast/images/exif-orientation-composited.html is failing
index db8aac21906626603c09aa2b204f6267cd3dfffe..40259b6ccf30cf1801bdf529b3765b7af2256782 100644 (file)
@@ -97,7 +97,7 @@ PassRefPtr<AccessibilityUIElement> AccessibilityController::elementAtPoint(int x
 
 // Unsupported methods on various platforms.
 // As they're implemented on other platforms this list should be modified.
-#if !PLATFORM(MAC)
+#if !PLATFORM(GTK) && !PLATFORM(MAC)
 bool AccessibilityController::addNotificationListener(JSValueRef) { return false; }
 bool AccessibilityController::removeNotificationListener() { return false; }
 #endif
index c1875154edc2a6178f461217080fa35b18d30807..ef7d055ca41dcb2b04bd2c9a544444c996fc03c5 100644 (file)
@@ -128,4 +128,28 @@ PassRefPtr<AccessibilityUIElement> AccessibilityController::focusedElement()
     return AccessibilityUIElement::create(static_cast<AtkObject*>(root));
 }
 
+#if PLATFORM(GTK)
+bool AccessibilityController::addNotificationListener(JSValueRef functionCallback)
+{
+    if (!functionCallback)
+        return false;
+
+    // Only one global notification listener.
+    if (!m_globalNotificationHandler)
+        m_globalNotificationHandler = AccessibilityNotificationHandler::create();
+    m_globalNotificationHandler->setNotificationFunctionCallback(functionCallback);
+
+    return true;
+}
+
+bool AccessibilityController::removeNotificationListener()
+{
+    // Programmers should not be trying to remove a listener that's already removed.
+    ASSERT(m_globalNotificationHandler);
+
+    m_globalNotificationHandler = 0;
+    return false;
+}
+#endif
+
 } // namespace WTR