Active Accessibility: nsHTMLButtonAccessible::accDoAction does not work

VERIFIED FIXED in mozilla1.0

Status

defect
P2
blocker
VERIFIED FIXED
18 years ago
2 months ago

People

(Reporter: dsirnapalli, Assigned: aaronlev)

Tracking

({access, topembed+})

Trunk
mozilla1.0
x86
Windows NT
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Reporter

Description

18 years ago
Below is the simple test case.
------------------------------------
<html>
<head>

<script type="text/javascript">

function getAccessibleNode(startNode)
{
  var accessibleService = null;
  var accessibleNode = null;
  try{
   netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");

   accessibleService = Components.classes
["@mozilla.org/accessibilityService;1"].createInstance();
   accessibleService = accessibleService.QueryInterface
(Components.interfaces.nsIAccessibilityService);
  }
  catch(e){
   alert("Error getting accessibility service");
  }

  try{
   netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");

   accessibleNode = accessibleService.getAccessibleFor(startNode);

   return accessibleNode;
  }
  catch(e){
   return "Exception";
  }
}

function executeTestCase()
{
 try{
  netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");

  var node = document.getElementsByTagName("button").item(0);
  accNode = getAccessibleNode(node);

  alert("accNumActions: " + accNode.accNumActions);
  alert("getAccActionName: " + accNode.getAccActionName(0));
  action = doAction();
  alert("accDoAction:" + action);
 }
 catch(e){
  alert("Exception: " + e);
 }
}

function doAction()
{
  try{
   accNode.accDoAction(0);
  }
  catch(e){
   return e;
  }
}

function clicked()
{
 alert("Submit button pressed");
}

</script>
</head>
<body>
<script type="text/javascript">
<!-- Test Button -->
document.write('<br>');
document.write('<b>Testing Button for Accessibility..</b><br><br>');
document.write('<button value="submit" onClick="clicked();"> Submit </button>');
setTimeout("executeTestCase();", 2000);
</script>
</body>
</html>
------------------------------------------
-- When you run the above test case. the first alert you get will show how many 
numactions are there. here it is 1. next alert will show the actionname for 
numaction zero. The next alert will show the exception returned when 
accDoAction is called. if the function was successful alert "Submit button 
pressed" would have been displayed.

The error displayed is.
accDoAction:[Exception... "Component returned failure code: 0x80004005 (NS_ERROR
_FAILURE) [nsIAccessible.accDoAction]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)
"  location: "JS frame :: file:///C:/Netscape/Accessibility/testcase.html :: doA
ction :: line 56"  data: no]
Assignee

Updated

18 years ago
Status: NEW → ASSIGNED
Keywords: access, fcc508, nsbeta1
Priority: -- → P2
Target Milestone: --- → mozilla1.0
Assignee

Comment 1

18 years ago
-> John
Assignee: aaronl → jgaunt
Status: ASSIGNED → NEW

Updated

18 years ago
Status: NEW → ASSIGNED
changing summary so it fits better in the list ( we should come up with
somehting shorter than Active Accessibility for the lead on the summary )
Summary: Active Accessibility: nsIAccessible's accDoAction does not work for Html Button Node → Active Accessibility: nsHTMLButtonAccessible::accDoAction does not work
Assignee

Updated

18 years ago
Keywords: topembed
Assignee

Updated

18 years ago
Blocks: 75785

Updated

18 years ago
Keywords: topembedtopembed+

Comment 3

18 years ago
nsbeta1+ per ADT triage team, adding dep on XBL Form Controls bug 57209
Depends on: 57209
Keywords: nsbeta1nsbeta1+
Assignee

Updated

18 years ago
Severity: major → blocker
Reporter

Updated

18 years ago
QA Contact: doronr → dsirnapalli
Assignee

Updated

18 years ago
Blocks: 135206
Assignee

Comment 4

18 years ago
Fix in hand.

We were trying to QI an HTML 4 <button> to nsIDOMHTMLInputElement, and we got null.

The fix adds a Click() method to nsIDOMNSHTMLButtonElement(), and uses that
interface instead.
Assignee

Comment 5

18 years ago
ready to attach patch
Assignee: jgaunt → aaronl
Status: ASSIGNED → NEW
Assignee

Comment 6

18 years ago
Comment on attachment 77510 [details] [diff] [review]
Uses nsIDOMNSHTMLButtonElement::Click() now

You'll need to add re-entrancy protection to nsHTMLButtonElement::Click(), see
nsHTMLInputElement::Click().
Attachment #77510 - Flags: needs-work+
Assignee

Comment 8

18 years ago
Attachment #77510 - Attachment is obsolete: true
Comment on attachment 77531 [details] [diff] [review]
Protects against reentrency using PRBool mHandlingClick

- In nsHTMLButtonElement::Click():

+  GetDocument(*getter_AddRefs(doc));
+
+  if (doc) {
...
+  }
+  return NS_ERROR_FAILURE;

Make this return NS_OK, calling click() on a button that's not in the tree
should not throw an exception.

sr=jst with that change.
Attachment #77531 - Flags: superreview+
Assignee

Comment 10

18 years ago
Change made to return NS_OK.
Won't attach new patch unless requested.
Comment on attachment 77531 [details] [diff] [review]
Protects against reentrency using PRBool mHandlingClick

r=jkeiser, but could you indulge my thread paranoia and put the mHandlingClick
= PR_TRUE; mHandlingClick = PR_FALSE; pair at the beginning and end of the
function?
Attachment #77531 - Flags: review+
Assignee

Updated

18 years ago
Keywords: adt1.0.0
What bug does the user see?  There's a dependency on XBL form controls but we
won't be turning them on for Mach V, so is this bug fix still needed?
Comment on attachment 77531 [details] [diff] [review]
Protects against reentrency using PRBool mHandlingClick

a=asa (on behalf of drivers) for checkin to the 1.0 trunk
Attachment #77531 - Flags: approval+
Assignee

Comment 14

18 years ago
The dependancy was bogus. This fix is necessary so that screen readers can work
with our software.
No longer depends on: 57209
adt1.0.0+ (on ADT's behalf) approval for checkin into 1.0.
Keywords: adt1.0.0adt1.0.0+
Assignee

Comment 16

18 years ago
fixed in trunk.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Reporter

Comment 17

18 years ago
-- Verified in current mozilla nightly build. The fix works fine. Marking the
bug as verified.
Status: RESOLVED → VERIFIED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.