Closed Bug 147756 Opened 22 years ago Closed 22 years ago

nsIAccessible's accValue returns NS_ERROR_FAILURE

Categories

(Core :: Disability Access APIs, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: dsirnapalli, Assigned: aaronlev)

Details

Attachments

(2 files, 1 obsolete file)

-- Test case attached.
If accValue is not implemented for listbox then it should return
NS_ERROR_NOT_IMPLEMENTED. It should not return NS_ERROR_FAILURE.
take it for me...
Assignee: aaronl → kyle.yuan
Summary: nsIAccessible's accValue returns NS_ERROR_FAILURE → nsIAccessible's accValue returns NS_ERROR_FAILURE
aaron, I found that, we can call
nsCOMPtr<nsIDOMXULMultiSelectControlElement> select(do_QueryInterface
(mDOMNode)); to get a  nsIDOMXULMultiSelectControlElement*, but
nsCOMPtr<nsIDOMXULSelectControlElement> select(do_QueryInterface(mDOMNode)); 
will failed, although nsIDOMXULMultiSelectControlElement inherits from 
nsIDOMXULSelectControlElement.

I'm not sure whether this is a bug of XUL or it should like this.
Kyle, how's this?

That returns a value if something in the listbox is selected.
It still returns an error if nothing is selected.
Kyle, seeking r= on this as well.
1) we should check selectedItem != nsnull, before use it 
http://lxr.mozilla.org/seamonkey/source/accessible/src/xul/nsXULSelectAccessible
.cpp#196

2) there is a similar bug for nsXULComboboxAccessible
http://lxr.mozilla.org/seamonkey/source/xpfe/global/resources/content/bindings/m
enulist.xml#42

3) should we add _retval = NS_LITERAL_STRING(""); at the beginning of 
GetAccValue?
Assignee: kyle.yuan → aaronl
Attachment #85686 - Attachment is obsolete: true
Comment on attachment 85788 [details] [diff] [review]
Adds Kyle's suggestions

r=kyle
Attachment #85788 - Flags: review+
Comment on attachment 85788 [details] [diff] [review]
Adds Kyle's suggestions

@@ -190,11 +190,13 @@
   */
 NS_IMETHODIMP nsXULListboxAccessible::GetAccValue(nsAString& _retval)
 {
+  _retval.Assign(NS_LITERAL_STRING(""));

This is just wrong, if you want to empty out the string, then just truncate it,
no need to construct a string wrapper for an empty string just to assign it
into another string. _retval.Truncate(0)!

sr=jst with that change.
Attachment #85788 - Flags: superreview+
fixed
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
-- Hi aaron, did you check in the fix.
Yep, that's why I marked it "fixed". Is that crazy or what? :)
-- no, you usually mention "checked in" after "fixed". I see that for almost all
the bugs you fixed.
-- I still get NS_ERROR_FAILURE when i run the attached test case. I verified it
on todays trunk build.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
-- hi aaron, it works fine. In Inspect tool it shows right value. Works as
described.

Returns a value if something in the listbox is selected.
It still returns an error if nothing is selected.

Marking the bug back as Fixed.
Status: REOPENED → RESOLVED
Closed: 22 years ago22 years ago
Resolution: --- → FIXED
-- Verified in todays trunk build. works fine. marking bug as verified.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: