Closed
Bug 337656
Opened 18 years ago
Closed 17 years ago
navigate methods of nsIAccessNode throws exception
Categories
(Core :: Disability Access APIs, defect)
Core
Disability Access APIs
Tracking
()
RESOLVED
FIXED
People
(Reporter: surkov, Assigned: surkov)
References
Details
(Keywords: access)
Attachments
(2 files)
757 bytes,
application/xhtml+xml
|
Details | |
3.34 KB,
patch
|
aaronlev
:
review+
|
Details | Diff | Splinter Review |
When DOM node of nsIAccessNode object hans't children/siblings/parent then corresponding method of nsIAccessNode throws exception. F.x. For <input type="text"/> accInput.firstChildNode throws exception since <input/> hasn't any child. Probably the behavious is used somewhere but on the first sight it confuse. I guess more appropriate behaviour is navigate methods will return null instead exception throwing.
Assignee | ||
Comment 1•18 years ago
|
||
Comment 2•17 years ago
|
||
Similar to bug 347019. The a11y module uses error codes wrong. Alexander, would you like to take these?
Assignee: aaronleventhal → surkov.alexander
Assignee | ||
Comment 3•17 years ago
|
||
Attachment #253609 -
Flags: review?(aaronleventhal)
Assignee | ||
Updated•17 years ago
|
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Comment 4•17 years ago
|
||
Comment on attachment 253609 [details] [diff] [review] patch r+ if you add the line: *aAccessNode = nsnull; at the top of each of these methods. Need to clear it out, otherwise this code will crash: nsIAccessNode *myNode; if (NS_SUCCEEDED(origNode->GetFirstChildNode(&myNode))) { myNode->Foo(); }
Attachment #253609 -
Flags: review?(aaronleventhal) → review+
Assignee | ||
Comment 5•17 years ago
|
||
(In reply to comment #4) > (From update of attachment 253609 [details] [diff] [review]) > r+ if you add the line: > *aAccessNode = nsnull; at the top of each of these methods. > > Need to clear it out, otherwise this code will crash: > nsIAccessNode *myNode; > if (NS_SUCCEEDED(origNode->GetFirstChildNode(&myNode))) { > myNode->Foo(); > } > Is it better to do it inside MakeAccessNode method?
Assignee | ||
Comment 6•17 years ago
|
||
(In reply to comment #5) > Is it better to do it inside MakeAccessNode method? > Aaron, what about this?
Comment 7•17 years ago
|
||
That would be smaller code, but I like to null out out parameters before anything else happens. Habit taught by Brendan Eich. You can't go wrong that way.
Updated•17 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•