+2013-09-10 Denis Nomiyama <d.nomiyama@samsung.com>
+
+ [GTK] Missing DRT AccessibilityController::addNotificationListener implementation
+ https://bugs.webkit.org/show_bug.cgi?id=70606
+
+ 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 a11y layout tests that are currently skipped (e.g. bug
+ 98370).
+
+ * DumpRenderTree/AccessibilityController.h: Added a global notification
+ handler for GTK+.
+ * DumpRenderTree/atk/AccessibilityControllerAtk.cpp:
+ (AccessibilityController::AccessibilityController): Initializes the
+ global handler with 0.
+ (AccessibilityController::addNotificationListener): Creates the
+ notification handler and sets the notification function callback.
+ (AccessibilityController::removeNotificationListener): Removes the
+ global handler.
+
2013-09-10 Krzysztof Czech <k.czech@samsung.com>
[ATK] Incorrect type for holding float value
#include <windows.h>
#endif
#if HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
+#include "AccessibilityNotificationHandlerAtk.h"
#include <atk/atk.h>
#endif
#if PLATFORM(MAC)
RetainPtr<NotificationHandler> m_globalNotificationHandler;
#endif
+
+#if PLATFORM(GTK) || PLATFORM(EFL)
+ RefPtr<AccessibilityNotificationHandler> m_globalNotificationHandler;
+#endif
};
#endif // AccessibilityController_h
bool loggingAccessibilityEvents = false;
AccessibilityController::AccessibilityController()
+ : m_globalNotificationHandler(0)
{
}
loggingAccessibilityEvents = true;
}
-bool AccessibilityController::addNotificationListener(JSObjectRef)
+bool AccessibilityController::addNotificationListener(JSObjectRef functionCallback)
{
- return false;
+ if (!functionCallback)
+ return false;
+
+ // Only one global notification listener.
+ if (m_globalNotificationHandler)
+ return false;
+
+ m_globalNotificationHandler = AccessibilityNotificationHandler::create();
+ m_globalNotificationHandler->setNotificationFunctionCallback(functionCallback);
+
+ return true;
}
void AccessibilityController::removeNotificationListener()
{
+ // Programmers should not be trying to remove a listener that's already removed.
+ ASSERT(m_globalNotificationHandler);
+
+ m_globalNotificationHandler = 0;
}
AtkObject* AccessibilityController::childElementById(AtkObject* parent, const char* id)