Bug 461767 - don't create nslinkableaccessible if 'click' event handler is registered, r=aaronlev, marcoz
authorAlexander Surkov <surkov.alexander@gmail.com>
Wed, 29 Oct 2008 16:55:28 +0800
changeset 21047 5bd6876be7f2468543ff3fef07bb2a5183cf4f36
parent 21046 13b5c75e370925d2d59920bd8367653304c96add
child 21048 98a09198ccc834fa990e1a1bf4adda30ac3a4172
push idunknown
push userunknown
push dateunknown
reviewersaaronlev, marcoz
bugs461767
milestone1.9.1b2pre
Bug 461767 - don't create nslinkableaccessible if 'click' event handler is registered, r=aaronlev, marcoz
accessible/src/base/nsAccessibilityService.cpp
--- a/accessible/src/base/nsAccessibilityService.cpp
+++ b/accessible/src/base/nsAccessibilityService.cpp
@@ -587,26 +587,18 @@ nsAccessibilityService::CreateHyperTextA
   nsCOMPtr<nsIWeakReference> weakShell;
   nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node));
   if (NS_FAILED(rv))
     return rv;
 
   nsCOMPtr<nsIContent> content(do_QueryInterface(node));
   NS_ENSURE_TRUE(content, NS_ERROR_FAILURE);
   
-  if (nsCoreUtils::HasListener(content, NS_LITERAL_STRING("click"))) {
-    // nsLinkableAccessible inherits from nsHyperTextAccessible, but
-    // it also includes code for dealing with the onclick
-    *aAccessible = new nsLinkableAccessible(node, weakShell);
-  }
-  else {
-    *aAccessible = new nsHyperTextAccessibleWrap(node, weakShell);
-  }
-  if (nsnull == *aAccessible)
-    return NS_ERROR_OUT_OF_MEMORY;
+  *aAccessible = new nsHyperTextAccessibleWrap(node, weakShell);
+  NS_ENSURE_TRUE(*aAccessible, NS_ERROR_OUT_OF_MEMORY);
 
   NS_ADDREF(*aAccessible);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsAccessibilityService::CreateHTMLCheckboxAccessible(nsISupports *aFrame, nsIAccessible **_retval)
 {