bug 659620 - Hang when trying to edit a page on WikiMo with NVDA running r=surkov
authorTrevor Saunders <trev.saunders@gmail.com>
Wed, 25 May 2011 07:52:01 -0700
changeset 70223 3b17ef9c3cd8e8a91dc7f5bd6657189a9233eb12
parent 70222 2b53d3079c78a7d79f39476cf1e3539b80a9691e
child 70224 bbceb00866f050dfbf982869f5aec00afb2e8805
push id20245
push usertrev.saunders@gmail.com
push dateFri, 27 May 2011 03:02:33 +0000
treeherdermozilla-central@3b17ef9c3cd8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssurkov
bugs659620
milestone7.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 659620 - Hang when trying to edit a page on WikiMo with NVDA running r=surkov From e0a6515b9f894ab39bcd6db51d43e24a677667b3 Mon Sep 17 00:00:00 2001 --- accessible/src/base/nsBaseWidgetAccessible.cpp | 3 +- .../tests/mochitest/actions/test_general.html | 21 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-)
accessible/src/base/nsBaseWidgetAccessible.cpp
accessible/tests/mochitest/actions/test_general.html
--- a/accessible/src/base/nsBaseWidgetAccessible.cpp
+++ b/accessible/src/base/nsBaseWidgetAccessible.cpp
@@ -136,17 +136,17 @@ nsLinkableAccessible::GetValue(nsAString
 }
 
 
 NS_IMETHODIMP
 nsLinkableAccessible::GetNumActions(PRUint8 *aNumActions)
 {
   NS_ENSURE_ARG_POINTER(aNumActions);
 
-  *aNumActions = mActionAcc ? 1 : 0;
+  *aNumActions = (mIsOnclick || mIsLink) ? 1 : 0;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsLinkableAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
 {
   aName.Truncate();
 
@@ -223,17 +223,16 @@ nsLinkableAccessible::BindToParent(nsAcc
   nsAccessibleWrap::BindToParent(aParent, aIndexInParent);
 
   // Cache action content.
   mActionAcc = nsnull;
   mIsLink = PR_FALSE;
   mIsOnclick = PR_FALSE;
 
   if (nsCoreUtils::HasClickListener(mContent)) {
-    mActionAcc = this;
     mIsOnclick = PR_TRUE;
     return;
   }
 
   // XXX: The logic looks broken since the click listener may be registered
   // on non accessible node in parent chain but this node is skipped when tree
   // is traversed.
   nsAccessible* walkUpAcc = this;
--- a/accessible/tests/mochitest/actions/test_general.html
+++ b/accessible/tests/mochitest/actions/test_general.html
@@ -31,19 +31,29 @@
           ID: "li_clickable2",
           actionName: "click",
           events: CLICK_EVENTS
         },
         {
           ID: "li_clickable3",
           actionName: "click",
           events: CLICK_EVENTS
+        },
+        {
+          ID: "onclick_img",
+          actionName: "click",
+          events: CLICK_EVENTS
         }
       ];
+
       testActions(actionsArray);
+
+      getAccessible("onclick_img").takeFocus();
+is(getAccessible("link1").numActions, 1, "links should have one action");
+is(getAccessible("link2").numActions, 1, "link with onclick handler should have 1 action");
     }
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTest);
   </script>
 </head>
 
 <body>
@@ -53,20 +63,31 @@
      title="nsHTMLLiAccessible shouldn't be inherited from linkable accessible">
     Mozilla Bug 523789
   </a><br>
   <a target="_blank"
      href="https://bugzilla.mozilla.org/show_bug.cgi?id=423409"
      title="Expose click action if mouseup and mousedown are registered">
     Mozilla Bug 423409
   </a>
+  <a target="_blank"
+     href="https://bugzilla.mozilla.org/show_bug.cgi?id=659620"
+     title="hang when trying to edit a page on wikimo with NVDA running">
+    Mozilla Bug 659620
+  </a>
   <p id="display"></p>
   <div id="content" style="display: none"></div>
   <pre id="test">
   </pre>
 
   <ul>
     <li id="li_clickable1" onclick="">Clickable list item</li>
     <li id="li_clickable2" onmousedown="">Clickable list item</li>
     <li id="li_clickable3" onmouseup="">Clickable list item</li>
   </ul>
+
+  <!-- linkable accessibles -->
+  <img id="onclick_img" onclick="" src="../moz.png">
+
+  <a id="link1" href="www">linkable textleaf accessible</a>
+  <div id="link2" onclick="">linkable textleaf accessible</div>
 </body>
 </html>