ensure nsAccessibilityService::GetAccessible doesn't fail if there is no accessible for the given node

RESOLVED WORKSFORME

Status

()

Core
Disability Access APIs
RESOLVED WORKSFORME
11 years ago
8 years ago

People

(Reporter: surkov, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

11 years ago
 
(Reporter)

Comment 1

11 years ago
<aaronlev> surkov, i mean, if someone asks for an accessible object for a regular <span> object or something
<aaronlev> we will return null for the accessible and NS_ERROR_FAILURE
<aaronlev> but, an error should usually be for something not expected
<aaronlev> however, it's very expected that someone will ask for a given node if ther eis an accessible object for it
<aaronlev> technically we should only return an error for things that are unexpected
Summary: es → ensure nsAccessibilityService::GetAccessible doesn't fail if there is no accessible for the given node
(Reporter)

Comment 2

11 years ago
initial work was done in bug 347019.
(Reporter)

Comment 3

11 years ago
(In reply to comment #7 bug 347019)
> Surkov, didn't we need to return NS_OK here?
> http://lxr.mozilla.org/seamonkey/source/accessible/src/base/nsAccessibilityService.cpp#1131
> 
> 1130   if (!aAccessibleIn) {
> 1131     return NS_ERROR_FAILURE; // No accessible to init
> 1132   }
> 

Either we should use NS_ENSURE_ARG() or return NS_OK. Now we do not check whether aAccessibleIn is null when we call InitAccessible(), probably we should because it doesn't make sense to call it with nsnull.

Comment 4

11 years ago
> it doesn't make sense to call it with nsnull.
Okay.

I think we used to have more places where we called it, and it made the code a little easier to read at that time. But I agree with you.
Mass un-assigning bugs assigned to Aaron.
Assignee: aaronleventhal → nobody
(Reporter)

Comment 6

8 years ago
It doesn't fail anymore, was fixed at some point. Closing as worksforme.
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.