Closed Bug 125295 Opened 22 years ago Closed 22 years ago

Active Accessibility: Html <button> Element should not have any children.

Categories

(SeaMonkey :: General, defect, P1)

x86
Windows NT
defect

Tracking

(Not tracked)

VERIFIED FIXED
mozilla1.0

People

(Reporter: dsirnapalli, Assigned: aaronlev)

References

Details

(Keywords: access, topembed, Whiteboard: seeking r=, sr=)

Attachments

(1 file)

Below it the 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 getValue()
{
  try{
   return accNode.accValue;
  }
  catch(e){
    return(e);
  }
}

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

  var node = document.getElementsByTagName("button").item(0);
  node = node.firstChild;
  accNode = getAccessibleNode(node);
  var value = getValue();
  var newvalue = value.toString();
alert("Value: " + newvalue);

 }
 catch(e){
  alert("Exception: " + e);
 }
}

</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">Submit</button>');

setTimeout("executeTestCase();", 2000);

</script>
</body>
</html>
------------------------------------------------------------
When you execute the test case in Mozilla or MfcEmbed the alert shows 

Value: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAIL
URE) [nsIAccessible.accValue]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  locat
ion: "JS frame :: file:///C:/Netscape/Accessibility/bug.html :: getValue :: line
 36"  data: no]
Actually it should show NS_ERROR_NOT_IMPLEMENTED if the functionality is not 
implemented.
Status: NEW → ASSIGNED
Keywords: access, fcc508, nsbeta1
-- The same problem exists for HTML Table Cell Text Node also. accValue returns
NS_ERROR_FAILURE instead of NS_ERROR_NOT_IMPLEMENTED.
That button shouldn't have any children!

That's what the bug should be.
ya, after verifying with IE even i taught same thing. This button shouldn't have
any children.

So now there are actually two bugs in this case.
1. This button shouldn't have any children.
2. nsIAccessible's accValue returns NS_ERROR_FAILURE instead of
NS_ERROR_NOT_IMPLEMENTED for Html Table Cell Text Node and Html Caption Text Node.

-- Renaming the summary.
Summary: Active Accessibility: nsIAccessible's accValue returns NS_ERROR_FAILURE instead of NS_ERROR_NOT_IMPLEMENTED for Html Button Text Node → Active Accessibility: Html Button Element should not have any children.
This bug doesn't affect buttons like this: <input type="button" value="do it">
It only affects buttons like this: <button>hello</button>

This was originally a conscious choice between John Gaunt and myself, however,
firing up IE - it makes it clear we made the wrong choice. They always make the
button a leaf node, and just concatenate all of the text into the button name.
Summary: Active Accessibility: Html Button Element should not have any children. → Active Accessibility: Html <button> Element should not have any children.
Keywords: topembed
Priority: -- → P1
Whiteboard: seeking r=, sr=
Target Milestone: --- → mozilla1.0
Comment on attachment 71440 [details] [diff] [review]
Makes <button> accessibles leaf accessibles - no children

r=jgaunt
Attachment #71440 - Flags: review+
Comment on attachment 71440 [details] [diff] [review]
Makes <button> accessibles leaf accessibles - no children

sr=hewitt
Attachment #71440 - Flags: superreview+
Blocks: 75785
Comment on attachment 71440 [details] [diff] [review]
Makes <button> accessibles leaf accessibles - no children

a=shaver for 0.9.9.  (What the heck does the description of this patch mean?)
Attachment #71440 - Flags: approval+
checked in
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
-- verified in today's trunk build. Works fine. marking the bug as verified.
Status: RESOLVED → VERIFIED
QA Contact: doronr → dsirnapalli
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: