Changeset 155192 in webkit
- Timestamp:
- Sep 6, 2013 9:32:30 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r155191 r155192 1 2013-09-06 Denis Nomiyama <d.nomiyama@samsung.com> 2 3 [GTK] AccessibilityUIElement::addNotificationListener() crashes on debug build 4 https://bugs.webkit.org/show_bug.cgi?id=120416 5 6 Reviewed by Mario Sanchez Prada. 7 8 Fixed crashes when running debug DRT on tests that require an a11y notification handler. 9 10 * platform/gtk/TestExpectations: Unskipped some a11y tests that were crashing before this fix. 11 Updated the expectation of accessibility/notification-listeners.html to expect failure on Debug build 12 since it is not crashing anymore. This other issue is tracked in a separate bug (bug 120669). 13 1 14 2013-09-06 Chris Fleizach <cfleizach@apple.com> 2 15 -
trunk/LayoutTests/platform/gtk/TestExpectations
r155184 r155192 497 497 498 498 webkit.org/b/120200 [ Debug ] http/tests/security/XFrameOptions/x-frame-options-allowall.html [ Crash Pass ] 499 500 webkit.org/b/120667 [ Debug ] accessibility/multiselect-list-reports-active-option.html [ Crash ]501 webkit.org/b/120667 [ Debug ] accessibility/notification-listeners.html [ Crash ]502 webkit.org/b/120667 [ Debug ] accessibility/menu-list-sends-change-notification.html [ Crash ]503 webkit.org/b/120667 [ Debug ] accessibility/aria-invalid.html [ Crash ]504 webkit.org/b/120667 [ Debug ] accessibility/aria-checkbox-sends-notification.html [ Crash ]505 499 506 500 #//////////////////////////////////////////////////////////////////////////////////////// … … 1460 1454 webkit.org/b/120203 http/tests/security/cross-frame-access-getOwnPropertyDescriptor.html [ Failure ] 1461 1455 1462 webkit.org/b/120669 [ Release ]accessibility/notification-listeners.html [ Failure ]1456 webkit.org/b/120669 accessibility/notification-listeners.html [ Failure ] 1463 1457 1464 1458 webkit.org/b/120670 accessibility/lists.html [ Failure ] -
trunk/Tools/ChangeLog
r155188 r155192 1 2013-09-06 Denis Nomiyama <d.nomiyama@samsung.com> 2 3 [GTK] AccessibilityUIElement::addNotificationListener() crashes on debug build 4 https://bugs.webkit.org/show_bug.cgi?id=120416 5 6 Reviewed by Mario Sanchez Prada. 7 8 Fixed crashes when running debug DRT. Simplified loops at AccessibilityCallbackAtk.cpp where the HashMap 9 iterator was removed inside a loop. Fixed AccessibilityUIElement::addNotificationListener() where 10 m_notificationHandler expected RefPtr. 11 12 The global notification handler was stored in the HashMap with key 0. And this caused an assertion when 13 HashMap::add() or find() are called. To fix it, moved the global handler to a separated pointer. 14 15 * DumpRenderTree/atk/AccessibilityCallbacks.h: Removed the global notification key. 16 * DumpRenderTree/atk/AccessibilityCallbacksAtk.cpp: 17 (axObjectEventListener): Simplified the code by using HashMap::find() and a separate pointer for the 18 global notification handler. 19 (addAccessibilityNotificationHandler): Simplified the code by using HashMap::find() and a separate pointer 20 for the global notification handler. 21 (removeAccessibilityNotificationHandler): Added the removal for the global notification handler. 22 * DumpRenderTree/atk/AccessibilityNotificationHandlerAtk.h: 23 (AccessibilityNotificationHandler::create): Added static function to create 24 AccessibilityNotificationHandler. 25 * DumpRenderTree/atk/AccessibilityUIElementAtk.cpp: 26 (AccessibilityUIElement::addNotificationListener): Assigned m_notificationHandler with 27 AccessibilityNotificationHandler::create(). 28 1 29 2013-09-06 Gabor Abraham <abrhm@inf.u-szeged.hu> 2 30 -
trunk/Tools/DumpRenderTree/atk/AccessibilityCallbacks.h
r154697 r155192 33 33 #include "AccessibilityUIElement.h" 34 34 35 const PlatformUIElement GlobalNotificationKey = 0;36 37 35 void connectAccessibilityCallbacks(); 38 36 void disconnectAccessibilityCallbacks(); -
trunk/Tools/DumpRenderTree/atk/AccessibilityCallbacksAtk.cpp
r154960 r155192 49 49 #endif 50 50 51 typedef HashMap<PlatformUIElement, AccessibilityNotificationHandler*> NotificationHandlersMap; 52 51 53 static guint stateChangeListenerId = 0; 52 54 static guint focusEventListenerId = 0; … … 55 57 static guint propertyChangedListenerId = 0; 56 58 static guint visibleDataChangedListenerId = 0; 57 static HashMap<PlatformUIElement, AccessibilityNotificationHandler*> notificationHandlers; 59 static NotificationHandlersMap notificationHandlers; 60 static AccessibilityNotificationHandler* globalNotificationHandler = 0; 58 61 59 62 extern bool loggingAccessibilityEvents; … … 128 131 129 132 if (notificationName.length()) { 130 for (HashMap<PlatformUIElement, AccessibilityNotificationHandler*>::iterator it = notificationHandlers.begin(); it != notificationHandlers.end(); ++it) { 131 if (it->key == accessible || it->key == GlobalNotificationKey) { 132 JSRetainPtr<JSStringRef> jsNotificationEventName(Adopt, JSStringCreateWithUTF8CString(reinterpret_cast<const char*>(notificationName.utf8().data()))); 133 JSValueRef notificationNameArgument = JSValueMakeString(jsContext, jsNotificationEventName.get()); 134 AccessibilityNotificationHandler* notificationHandler = it->value; 135 if (notificationHandler->platformElement()) { 136 JSValueRef argument = notificationNameArgument; 137 // Listener for one element just gets one argument, the notification name. 138 JSObjectCallAsFunction(jsContext, notificationHandler->notificationFunctionCallback(), 0, 1, &argument, 0); 139 } else { 140 // A global listener gets the element and the notification name as arguments. 141 JSValueRef arguments[2]; 142 arguments[0] = AccessibilityUIElement::makeJSAccessibilityUIElement(jsContext, AccessibilityUIElement(accessible)); 143 arguments[1] = notificationNameArgument; 144 JSObjectCallAsFunction(jsContext, notificationHandler->notificationFunctionCallback(), 0, 2, arguments, 0); 145 } 146 } 133 JSRetainPtr<JSStringRef> jsNotificationEventName(Adopt, JSStringCreateWithUTF8CString(notificationName.utf8().data())); 134 JSValueRef notificationNameArgument = JSValueMakeString(jsContext, jsNotificationEventName.get()); 135 NotificationHandlersMap::iterator elementNotificationHandler = notificationHandlers.find(accessible); 136 if (elementNotificationHandler != notificationHandlers.end()) { 137 // Listener for one element just gets one argument, the notification name. 138 JSObjectCallAsFunction(jsContext, elementNotificationHandler->value->notificationFunctionCallback(), 0, 1, ¬ificationNameArgument, 0); 139 } else if (globalNotificationHandler) { 140 // A global listener gets the element and the notification name as arguments. 141 JSValueRef arguments[2]; 142 arguments[0] = AccessibilityUIElement::makeJSAccessibilityUIElement(jsContext, AccessibilityUIElement(accessible)); 143 arguments[1] = notificationNameArgument; 144 JSObjectCallAsFunction(jsContext, globalNotificationHandler->notificationFunctionCallback(), 0, 2, arguments, 0); 147 145 } 148 146 } … … 229 227 // Check if this notification handler is related to a specific element. 230 228 if (notificationHandler->platformElement()) { 231 if (notificationHandlers.contains(notificationHandler->platformElement())) { 232 JSValueUnprotect(jsContext, notificationHandlers.find(notificationHandler->platformElement())->value->notificationFunctionCallback()); 233 notificationHandlers.remove(notificationHandler->platformElement()); 229 NotificationHandlersMap::iterator currentNotificationHandler = notificationHandlers.find(notificationHandler->platformElement()); 230 if (currentNotificationHandler != notificationHandlers.end()) { 231 ASSERT(currentNotificationHandler->value->platformElement()); 232 JSValueUnprotect(jsContext, currentNotificationHandler->value->notificationFunctionCallback()); 233 notificationHandlers.remove(currentNotificationHandler->value->platformElement()); 234 234 } 235 235 notificationHandlers.add(notificationHandler->platformElement(), notificationHandler); 236 236 } else { 237 if (notificationHandlers.contains(GlobalNotificationKey)) { 238 JSValueUnprotect(jsContext, notificationHandlers.find(GlobalNotificationKey)->value->notificationFunctionCallback()); 239 notificationHandlers.remove(GlobalNotificationKey); 240 } 241 notificationHandlers.add(GlobalNotificationKey, notificationHandler); 237 if (globalNotificationHandler) 238 JSValueUnprotect(jsContext, globalNotificationHandler->notificationFunctionCallback()); 239 globalNotificationHandler = notificationHandler; 242 240 } 243 241 … … 258 256 return; 259 257 260 for (HashMap<PlatformUIElement, AccessibilityNotificationHandler*>::iterator it = notificationHandlers.begin(); it != notificationHandlers.end(); ++it) { 261 if (it->value == notificationHandler) { 262 JSValueUnprotect(jsContext, notificationHandler->notificationFunctionCallback()); 263 notificationHandlers.remove(it); 258 if (globalNotificationHandler == notificationHandler) { 259 JSValueUnprotect(jsContext, globalNotificationHandler->notificationFunctionCallback()); 260 globalNotificationHandler = 0; 261 } else if (notificationHandler->platformElement()) { 262 NotificationHandlersMap::iterator removeNotificationHandler = notificationHandlers.find(notificationHandler->platformElement()); 263 if (removeNotificationHandler != notificationHandlers.end()) { 264 JSValueUnprotect(jsContext, removeNotificationHandler->value->notificationFunctionCallback()); 265 notificationHandlers.remove(removeNotificationHandler); 264 266 } 265 267 } -
trunk/Tools/DumpRenderTree/atk/AccessibilityNotificationHandlerAtk.cpp
r154697 r155192 24 24 25 25 AccessibilityNotificationHandler::AccessibilityNotificationHandler(void) 26 : m_platformElement( GlobalNotificationKey)26 : m_platformElement(0) 27 27 , m_notificationFunctionCallback(0) 28 28 { -
trunk/Tools/DumpRenderTree/atk/AccessibilityNotificationHandlerAtk.h
r154697 r155192 23 23 #include <JavaScriptCore/JSObjectRef.h> 24 24 #include <atk/atk.h> 25 #include <wtf/PassRefPtr.h> 25 26 #include <wtf/RefCounted.h> 26 27 27 28 class AccessibilityNotificationHandler : public RefCounted<AccessibilityNotificationHandler> { 28 29 public: 30 static PassRefPtr<AccessibilityNotificationHandler> create() 31 { 32 return adoptRef(new AccessibilityNotificationHandler()); 33 } 29 34 AccessibilityNotificationHandler(void); 30 35 ~AccessibilityNotificationHandler(); -
trunk/Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp
r155041 r155192 1051 1051 return false; 1052 1052 1053 m_notificationHandler = new AccessibilityNotificationHandler();1053 m_notificationHandler = AccessibilityNotificationHandler::create(); 1054 1054 m_notificationHandler->setPlatformElement(platformUIElement()); 1055 1055 m_notificationHandler->setNotificationFunctionCallback(functionCallback);
Note: See TracChangeset
for help on using the changeset viewer.