Title: [155448] trunk/Tools
- Revision
- 155448
- Author
- [email protected]
- Date
- 2013-09-10 09:20:01 -0700 (Tue, 10 Sep 2013)
Log Message
[GTK] Missing DRT AccessibilityController::addNotificationListener implementation
https://bugs.webkit.org/show_bug.cgi?id=70606
Patch by Denis Nomiyama <[email protected]> on 2013-09-10
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.
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (155447 => 155448)
--- trunk/Tools/ChangeLog 2013-09-10 16:02:43 UTC (rev 155447)
+++ trunk/Tools/ChangeLog 2013-09-10 16:20:01 UTC (rev 155448)
@@ -1,3 +1,30 @@
+2013-09-10 Denis Nomiyama <[email protected]>
+
+ [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 <[email protected]>
[ATK] Incorrect type for holding float value
Modified: trunk/Tools/DumpRenderTree/AccessibilityController.h (155447 => 155448)
--- trunk/Tools/DumpRenderTree/AccessibilityController.h 2013-09-10 16:02:43 UTC (rev 155447)
+++ trunk/Tools/DumpRenderTree/AccessibilityController.h 2013-09-10 16:20:01 UTC (rev 155448)
@@ -35,6 +35,7 @@
#include <windows.h>
#endif
#if HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
+#include "AccessibilityNotificationHandlerAtk.h"
#include <atk/atk.h>
#endif
@@ -88,6 +89,10 @@
#if PLATFORM(MAC)
RetainPtr<NotificationHandler> m_globalNotificationHandler;
#endif
+
+#if PLATFORM(GTK) || PLATFORM(EFL)
+ RefPtr<AccessibilityNotificationHandler> m_globalNotificationHandler;
+#endif
};
#endif // AccessibilityController_h
Modified: trunk/Tools/DumpRenderTree/atk/AccessibilityControllerAtk.cpp (155447 => 155448)
--- trunk/Tools/DumpRenderTree/atk/AccessibilityControllerAtk.cpp 2013-09-10 16:02:43 UTC (rev 155447)
+++ trunk/Tools/DumpRenderTree/atk/AccessibilityControllerAtk.cpp 2013-09-10 16:20:01 UTC (rev 155448)
@@ -38,6 +38,7 @@
bool loggingAccessibilityEvents = false;
AccessibilityController::AccessibilityController()
+ : m_globalNotificationHandler(0)
{
}
@@ -79,13 +80,27 @@
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)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes