Bug 740758 - dexpcom nsAccessible::GetValue, r=tbsaunde, f=surkov
authorMark Capella <markcapella@twcny.rr.com>
Mon, 09 Apr 2012 18:48:41 +0900
changeset 91241 807a41c7113228ef3ed55bdb096f1a8f4d3ef73b
parent 91240 c785549b6eb21c8bd69640a0baf74094b68d2ea8
child 91242 4bcba0e0eecaebfa314d050ff947b1a5987560e8
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewerstbsaunde
bugs740758
milestone14.0a1
Bug 740758 - dexpcom nsAccessible::GetValue, r=tbsaunde, f=surkov
accessible/src/base/nsAccessible.cpp
accessible/src/base/nsAccessible.h
accessible/src/base/nsApplicationAccessible.cpp
accessible/src/base/nsApplicationAccessible.h
accessible/src/base/nsBaseWidgetAccessible.cpp
accessible/src/base/nsBaseWidgetAccessible.h
accessible/src/base/nsFormControlAccessible.cpp
accessible/src/base/nsFormControlAccessible.h
accessible/src/base/nsTextEquivUtils.cpp
accessible/src/html/nsHTMLFormControlAccessible.cpp
accessible/src/html/nsHTMLFormControlAccessible.h
accessible/src/html/nsHTMLLinkAccessible.cpp
accessible/src/html/nsHTMLLinkAccessible.h
accessible/src/html/nsHTMLSelectAccessible.cpp
accessible/src/html/nsHTMLSelectAccessible.h
accessible/src/mac/mozHTMLAccessible.mm
accessible/src/msaa/nsAccessibleWrap.cpp
accessible/src/xforms/nsXFormsAccessible.cpp
accessible/src/xforms/nsXFormsAccessible.h
accessible/src/xforms/nsXFormsFormControlsAccessible.cpp
accessible/src/xforms/nsXFormsFormControlsAccessible.h
accessible/src/xforms/nsXFormsWidgetsAccessible.cpp
accessible/src/xforms/nsXFormsWidgetsAccessible.h
accessible/src/xul/nsXULColorPickerAccessible.cpp
accessible/src/xul/nsXULColorPickerAccessible.h
accessible/src/xul/nsXULComboboxAccessible.cpp
accessible/src/xul/nsXULComboboxAccessible.h
accessible/src/xul/nsXULFormControlAccessible.cpp
accessible/src/xul/nsXULFormControlAccessible.h
accessible/src/xul/nsXULListboxAccessible.cpp
accessible/src/xul/nsXULListboxAccessible.h
accessible/src/xul/nsXULSliderAccessible.cpp
accessible/src/xul/nsXULSliderAccessible.h
accessible/src/xul/nsXULTabAccessible.cpp
accessible/src/xul/nsXULTabAccessible.h
accessible/src/xul/nsXULTextAccessible.cpp
accessible/src/xul/nsXULTextAccessible.h
accessible/src/xul/nsXULTreeAccessible.cpp
accessible/src/xul/nsXULTreeAccessible.h
accessible/tests/mochitest/testTextboxes.js
--- a/accessible/src/base/nsAccessible.cpp
+++ b/accessible/src/base/nsAccessible.cpp
@@ -1656,50 +1656,56 @@ nsAccessible::ApplyARIAState(PRUint64* a
 
   *aState |= mRoleMapEntry->state;
 
   if (aria::MapToState(mRoleMapEntry->attributeMap1, element, aState) &&
       aria::MapToState(mRoleMapEntry->attributeMap2, element, aState))
     aria::MapToState(mRoleMapEntry->attributeMap3, element, aState);
 }
 
-/* DOMString getValue (); */
 NS_IMETHODIMP
 nsAccessible::GetValue(nsAString& aValue)
 {
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
+  nsAutoString value;
+  Value(value);
+  aValue.Assign(value);
+
+  return NS_OK;
+}
+
+void
+nsAccessible::Value(nsString& aValue)
+{
   if (mRoleMapEntry) {
-    if (mRoleMapEntry->valueRule == eNoValue) {
-      return NS_OK;
-    }
+    if (mRoleMapEntry->valueRule == eNoValue)
+      return;
 
     // aria-valuenow is a number, and aria-valuetext is the optional text equivalent
     // For the string value, we will try the optional text equivalent first
     if (!mContent->GetAttr(kNameSpaceID_None,
                            nsGkAtoms::aria_valuetext, aValue)) {
       mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::aria_valuenow,
                         aValue);
     }
   }
 
   if (!aValue.IsEmpty())
-    return NS_OK;
+    return;
 
   // Check if it's a simple xlink.
   if (nsCoreUtils::IsXLink(mContent)) {
     nsIPresShell* presShell = mDoc->PresShell();
     if (presShell) {
       nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
-      return presShell->GetLinkLocation(DOMNode, aValue);
+      presShell->GetLinkLocation(DOMNode, aValue);
     }
   }
-
-  return NS_OK;
 }
 
 // nsIAccessibleValue
 NS_IMETHODIMP
 nsAccessible::GetMaximumValue(double *aMaximumValue)
 {
   return GetAttrValue(nsGkAtoms::aria_valuemax, aMaximumValue);
 }
--- a/accessible/src/base/nsAccessible.h
+++ b/accessible/src/base/nsAccessible.h
@@ -126,21 +126,26 @@ public:
   // nsAccessNode
 
   virtual void Shutdown();
 
   //////////////////////////////////////////////////////////////////////////////
   // Public methods
 
   /**
-   * get the description of this accessible
+   * Get the description of this accessible.
    */
   virtual void Description(nsString& aDescription);
 
   /**
+   * Get the value of this accessible.
+   */
+  virtual void Value(nsString& aValue);
+
+  /**
    * Return DOM node associated with this accessible.
    */
   inline already_AddRefed<nsIDOMNode> DOMNode() const
   {
     nsIDOMNode *DOMNode = nsnull;
     if (GetNode())
       CallQueryInterface(GetNode(), &DOMNode);
     return DOMNode;
--- a/accessible/src/base/nsApplicationAccessible.cpp
+++ b/accessible/src/base/nsApplicationAccessible.cpp
@@ -119,29 +119,28 @@ nsApplicationAccessible::GetName(nsAStri
     NS_WARNING("brandShortName not found, using default app name");
     appName.AssignLiteral("Gecko based application");
   }
 
   aName.Assign(appName);
   return NS_OK;
 }
 
-NS_IMETHODIMP
-nsApplicationAccessible::GetValue(nsAString &aValue)
-{
-  aValue.Truncate();
-  return NS_OK;
-}
-
 void
 nsApplicationAccessible::Description(nsString &aDescription)
 {
   aDescription.Truncate();
 }
 
+void
+nsApplicationAccessible::Value(nsString& aValue)
+{
+  aValue.Truncate();
+}
+
 PRUint64
 nsApplicationAccessible::State()
 {
   return IsDefunct() ? states::DEFUNCT : 0;
 }
 
 NS_IMETHODIMP
 nsApplicationAccessible::GetAttributes(nsIPersistentProperties **aAttributes)
--- a/accessible/src/base/nsApplicationAccessible.h
+++ b/accessible/src/base/nsApplicationAccessible.h
@@ -75,17 +75,16 @@ public:
   NS_SCRIPTABLE NS_IMETHOD GetRootDocument(nsIAccessibleDocument** aRootDocument);
   NS_SCRIPTABLE NS_IMETHOD ScrollTo(PRUint32 aScrollType);
   NS_SCRIPTABLE NS_IMETHOD ScrollToPoint(PRUint32 aCoordinateType, PRInt32 aX, PRInt32 aY);
   NS_SCRIPTABLE NS_IMETHOD GetLanguage(nsAString& aLanguage);
   NS_IMETHOD GetParent(nsIAccessible **aParent);
   NS_IMETHOD GetNextSibling(nsIAccessible **aNextSibling);
   NS_IMETHOD GetPreviousSibling(nsIAccessible **aPreviousSibling);
   NS_IMETHOD GetName(nsAString &aName);
-  NS_IMETHOD GetValue(nsAString &aValue);
   NS_IMETHOD GetAttributes(nsIPersistentProperties **aAttributes);
   NS_IMETHOD GroupPosition(PRInt32 *aGroupLevel, PRInt32 *aSimilarItemsInGroup,
                            PRInt32 *aPositionInGroup);
   NS_IMETHOD GetBounds(PRInt32 *aX, PRInt32 *aY,
                        PRInt32 *aWidth, PRInt32 *aHeight);
   NS_IMETHOD SetSelected(bool aIsSelected);
   NS_IMETHOD TakeSelection();
   NS_IMETHOD TakeFocus();
@@ -99,16 +98,17 @@ public:
   // nsAccessNode
   virtual bool Init();
   virtual void Shutdown();
   virtual bool IsPrimaryForNode() const;
 
   // nsAccessible
   virtual void ApplyARIAState(PRUint64* aState);
   virtual void Description(nsString& aDescription);
+  virtual void Value(nsString& aValue);
   virtual mozilla::a11y::role NativeRole();
   virtual PRUint64 State();
   virtual PRUint64 NativeState();
   virtual Relation RelationByType(PRUint32 aRelType);
 
   virtual nsAccessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
                                      EWhichChildAtPoint aWhichChild);
   virtual nsAccessible* FocusedChild();
--- a/accessible/src/base/nsBaseWidgetAccessible.cpp
+++ b/accessible/src/base/nsBaseWidgetAccessible.cpp
@@ -119,26 +119,27 @@ nsLinkableAccessible::NativeState()
     states |= states::LINKED;
     if (mActionAcc->State() & states::TRAVERSED)
       states |= states::TRAVERSED;
   }
 
   return states;
 }
 
-NS_IMETHODIMP
-nsLinkableAccessible::GetValue(nsAString& aValue)
+void
+nsLinkableAccessible::Value(nsString& aValue)
 {
   aValue.Truncate();
 
-  nsAccessible::GetValue(aValue);
+  nsAccessible::Value(aValue);
   if (!aValue.IsEmpty())
-    return NS_OK;
+    return;
 
-  return mIsLink ? mActionAcc->GetValue(aValue) : NS_ERROR_NOT_IMPLEMENTED;
+  if (aValue.IsEmpty() && mIsLink)
+    mActionAcc->Value(aValue);
 }
 
 
 PRUint8
 nsLinkableAccessible::ActionCount()
 {
   return (mIsOnclick || mIsLink) ? 1 : 0;
 }
--- a/accessible/src/base/nsBaseWidgetAccessible.h
+++ b/accessible/src/base/nsBaseWidgetAccessible.h
@@ -84,23 +84,23 @@ public:
 
   nsLinkableAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIAccessible
   NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
   NS_IMETHOD DoAction(PRUint8 index);
-  NS_IMETHOD GetValue(nsAString& _retval);
   NS_IMETHOD TakeFocus();
 
   // nsAccessNode
   virtual void Shutdown();
 
   // nsAccessible
+  virtual void Value(nsString& aValue);
   virtual PRUint64 NativeState();
 
   // ActionAccessible
   virtual PRUint8 ActionCount();
   virtual KeyBinding AccessKey() const;
 
   // HyperLinkAccessible
   virtual already_AddRefed<nsIURI> AnchorURIAt(PRUint32 aAnchorIndex);
--- a/accessible/src/base/nsFormControlAccessible.cpp
+++ b/accessible/src/base/nsFormControlAccessible.cpp
@@ -105,42 +105,39 @@ ProgressMeterAccessible<Max>::IsWidget()
 {
   return true;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsIAccessibleValue
 
 template<int Max>
-NS_IMETHODIMP
-ProgressMeterAccessible<Max>::GetValue(nsAString& aValue)
+void
+ProgressMeterAccessible<Max>::Value(nsString& aValue)
 {
-  nsresult rv = nsFormControlAccessible::GetValue(aValue);
-  NS_ENSURE_SUCCESS(rv, rv);
-
+  nsFormControlAccessible::Value(aValue);
   if (!aValue.IsEmpty())
-    return NS_OK;
+    return;
 
   double maxValue = 0;
-  rv = GetMaximumValue(&maxValue);
-  NS_ENSURE_SUCCESS(rv, rv);
+  nsresult rv = GetMaximumValue(&maxValue);
+  NS_ENSURE_SUCCESS(rv, );
+  if (maxValue == 0)
+    return;
 
   double curValue = 0;
-  rv = GetCurrentValue(&curValue);
-  NS_ENSURE_SUCCESS(rv, rv);
+  GetCurrentValue(&curValue);
+  NS_ENSURE_SUCCESS(rv, );
 
   // Treat the current value bigger than maximum as 100%.
   double percentValue = (curValue < maxValue) ?
     (curValue / maxValue) * 100 : 100;
 
-  nsAutoString value;
-  value.AppendFloat(percentValue); // AppendFloat isn't available on nsAString
-  value.AppendLiteral("%");
-  aValue = value;
-  return NS_OK;
+  aValue.AppendFloat(percentValue);
+  aValue.AppendLiteral("%");
 }
 
 template<int Max>
 NS_IMETHODIMP
 ProgressMeterAccessible<Max>::GetMaximumValue(double* aMaximumValue)
 {
   nsresult rv = nsFormControlAccessible::GetMaximumValue(aMaximumValue);
   if (rv != NS_OK_NO_ARIA_VALUE)
--- a/accessible/src/base/nsFormControlAccessible.h
+++ b/accessible/src/base/nsFormControlAccessible.h
@@ -53,20 +53,18 @@ public:
   ProgressMeterAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
     nsFormControlAccessible(aContent, aDoc)
   {
   }
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIACCESSIBLEVALUE
 
-  // nsIAccessible
-  NS_IMETHOD GetValue(nsAString &aValue);
-
   // nsAccessible
+  virtual void Value(nsString& aValue);
   virtual mozilla::a11y::role NativeRole();
   virtual PRUint64 NativeState();
 
   // Widgets
   virtual bool IsWidget() const;
 };
 
 /**
--- a/accessible/src/base/nsTextEquivUtils.cpp
+++ b/accessible/src/base/nsTextEquivUtils.cpp
@@ -278,18 +278,17 @@ nsTextEquivUtils::AppendFromValue(nsAcce
 
   // Implementation of step f. of text equivalent computation. If the given
   // accessible is not root accessible (the accessible the text equivalent is
   // computed for in the end) then append accessible value. Otherwise append
   // value if and only if the given accessible is in the middle of its parent.
 
   nsAutoString text;
   if (aAccessible != gInitiatorAcc) {
-    nsresult rv = aAccessible->GetValue(text);
-    NS_ENSURE_SUCCESS(rv, rv);
+    aAccessible->Value(text);
 
     return AppendString(aString, text) ?
       NS_OK : NS_OK_NO_NAME_CLAUSE_HANDLED;
   }
 
   //XXX: is it necessary to care the accessible is not a document?
   if (aAccessible->IsDocumentNode())
     return NS_ERROR_UNEXPECTED;
@@ -299,18 +298,17 @@ nsTextEquivUtils::AppendFromValue(nsAcce
   for (nsIContent* childContent = content->GetPreviousSibling(); childContent;
        childContent = childContent->GetPreviousSibling()) {
     // check for preceding text...
     if (!childContent->TextIsOnlyWhitespace()) {
       for (nsIContent* siblingContent = content->GetNextSibling(); siblingContent;
            siblingContent = siblingContent->GetNextSibling()) {
         // .. and subsequent text
         if (!siblingContent->TextIsOnlyWhitespace()) {
-          nsresult rv = aAccessible->GetValue(text);
-          NS_ENSURE_SUCCESS(rv, rv);
+          aAccessible->Value(text);
 
           return AppendString(aString, text) ?
             NS_OK : NS_OK_NO_NAME_CLAUSE_HANDLED;
           break;
         }
       }
       break;
     }
--- a/accessible/src/html/nsHTMLFormControlAccessible.cpp
+++ b/accessible/src/html/nsHTMLFormControlAccessible.cpp
@@ -401,35 +401,33 @@ nsHTMLTextFieldAccessible::GetNameIntern
     return NS_OK;
 
   // text inputs and textareas might have useful placeholder text
   mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::placeholder, aName);
 
   return NS_OK;
 }
 
-NS_IMETHODIMP nsHTMLTextFieldAccessible::GetValue(nsAString& _retval)
+void
+nsHTMLTextFieldAccessible::Value(nsString& aValue)
 {
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
+  aValue.Truncate();
   if (NativeState() & states::PROTECTED)    // Don't return password text!
-    return NS_ERROR_FAILURE;
+    return;
 
   nsCOMPtr<nsIDOMHTMLTextAreaElement> textArea(do_QueryInterface(mContent));
   if (textArea) {
-    return textArea->GetValue(_retval);
+    textArea->GetValue(aValue);
+    return;
   }
   
   nsCOMPtr<nsIDOMHTMLInputElement> inputElement(do_QueryInterface(mContent));
   if (inputElement) {
-    return inputElement->GetValue(_retval);
+    inputElement->GetValue(aValue);
   }
-
-  return NS_ERROR_FAILURE;
 }
 
 void
 nsHTMLTextFieldAccessible::ApplyARIAState(PRUint64* aState)
 {
   nsHyperTextAccessibleWrap::ApplyARIAState(aState);
 
   aria::MapToState(aria::eARIAAutoComplete, mContent->AsElement(), aState);
--- a/accessible/src/html/nsHTMLFormControlAccessible.h
+++ b/accessible/src/html/nsHTMLFormControlAccessible.h
@@ -129,24 +129,24 @@ class nsHTMLTextFieldAccessible : public
 public:
   enum { eAction_Click = 0 };
 
   nsHTMLTextFieldAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIAccessible
-  NS_IMETHOD GetValue(nsAString& _retval); 
   NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
   NS_IMETHOD DoAction(PRUint8 index);
 
   // nsHyperTextAccessible
   virtual already_AddRefed<nsIEditor> GetEditor() const;
 
   // nsAccessible
+  virtual void Value(nsString& aValue);
   virtual void ApplyARIAState(PRUint64* aState);
   virtual nsresult GetNameInternal(nsAString& aName);
   virtual mozilla::a11y::role NativeRole();
   virtual PRUint64 State();
   virtual PRUint64 NativeState();
 
   // ActionAccessible
   virtual PRUint8 ActionCount();
--- a/accessible/src/html/nsHTMLLinkAccessible.cpp
+++ b/accessible/src/html/nsHTMLLinkAccessible.cpp
@@ -101,30 +101,28 @@ nsHTMLLinkAccessible::NativeState()
   // it doesn't have any attributes. Check if 'click' event handler is
   // registered, otherwise bail out.
   if (nsCoreUtils::HasClickListener(mContent))
     states |= states::LINKED;
 
   return states;
 }
 
-NS_IMETHODIMP
-nsHTMLLinkAccessible::GetValue(nsAString& aValue)
+void
+nsHTMLLinkAccessible::Value(nsString& aValue)
 {
   aValue.Truncate();
 
-  nsresult rv = nsHyperTextAccessible::GetValue(aValue);
-  NS_ENSURE_SUCCESS(rv, rv);
-
+  nsHyperTextAccessible::Value(aValue);
   if (!aValue.IsEmpty())
-    return NS_OK;
+    return;
   
   nsIPresShell* presShell(mDoc->PresShell());
   nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
-  return presShell->GetLinkLocation(DOMNode, aValue);
+  presShell->GetLinkLocation(DOMNode, aValue);
 }
 
 PRUint8
 nsHTMLLinkAccessible::ActionCount()
 {
   return IsLinked() ? 1 : nsHyperTextAccessible::ActionCount();
 }
 
--- a/accessible/src/html/nsHTMLLinkAccessible.h
+++ b/accessible/src/html/nsHTMLLinkAccessible.h
@@ -45,22 +45,21 @@
 class nsHTMLLinkAccessible : public nsHyperTextAccessibleWrap
 {
 public:
   nsHTMLLinkAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
  
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIAccessible
-  NS_IMETHOD GetValue(nsAString& aValue);
-
   NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
   NS_IMETHOD DoAction(PRUint8 aIndex);
 
   // nsAccessible
+  virtual void Value(nsString& aValue);
   virtual mozilla::a11y::role NativeRole();
   virtual PRUint64 NativeState();
 
   // ActionAccessible
   virtual PRUint8 ActionCount();
 
   // HyperLinkAccessible
   virtual bool IsLink();
--- a/accessible/src/html/nsHTMLSelectAccessible.cpp
+++ b/accessible/src/html/nsHTMLSelectAccessible.cpp
@@ -582,21 +582,23 @@ nsHTMLComboboxAccessible::Description(ns
     return;
 
   // Otherwise use description of selected option.
   nsAccessible* option = SelectedOption();
   if (option)
     option->Description(aDescription);
 }
 
-NS_IMETHODIMP nsHTMLComboboxAccessible::GetValue(nsAString& aValue)
+void
+nsHTMLComboboxAccessible::Value(nsString& aValue)
 {
   // Use accessible name of selected option.
   nsAccessible* option = SelectedOption();
-  return option ? option->GetName(aValue) : NS_OK;
+  if (option)
+    option->GetName(aValue);
 }
 
 PRUint8
 nsHTMLComboboxAccessible::ActionCount()
 {
   return 1;
 }
 
--- a/accessible/src/html/nsHTMLSelectAccessible.h
+++ b/accessible/src/html/nsHTMLSelectAccessible.h
@@ -182,25 +182,25 @@ class nsHTMLComboboxAccessible : public 
 {
 public:
   enum { eAction_Click = 0 };
 
   nsHTMLComboboxAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
   virtual ~nsHTMLComboboxAccessible() {}
 
   // nsIAccessible
-  NS_IMETHOD GetValue(nsAString& _retval);
   NS_IMETHOD DoAction(PRUint8 index);
   NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
 
   // nsAccessNode
   virtual void Shutdown();
 
   // nsAccessible
   virtual void Description(nsString& aDescription);
+  virtual void Value(nsString& aValue);
   virtual mozilla::a11y::role NativeRole();
   virtual PRUint64 NativeState();
   virtual void InvalidateChildren();
 
   // ActionAccessible
   virtual PRUint8 ActionCount();
 
   // Widgets
--- a/accessible/src/mac/mozHTMLAccessible.mm
+++ b/accessible/src/mac/mozHTMLAccessible.mm
@@ -111,22 +111,21 @@
   if ([action isEqualToString:NSAccessibilityPressAction])
     mGeckoAccessible->DoAction(0);
   else
     [super accessibilityPerformAction:action];
 }
 
 - (NSURL*)url
 {
-  if (!mGeckoAccessible)
+  if (!mGeckoAccessible || mGeckoAccessible->IsDefunct())
     return nil;
 
   nsAutoString value;
-  nsresult rv = mGeckoAccessible->GetValue(value);
-  NS_ENSURE_SUCCESS(rv, nil);
+  mGeckoAccessible->Value(value);
 
   NSString* urlString = value.IsEmpty() ? nil : nsCocoaUtils::ToNSString(value);
   if (!urlString)
     return nil;
 
   return [NSURL URLWithString:urlString];
 }
 
--- a/accessible/src/msaa/nsAccessibleWrap.cpp
+++ b/accessible/src/msaa/nsAccessibleWrap.cpp
@@ -280,19 +280,21 @@ STDMETHODIMP nsAccessibleWrap::get_accVa
 {
 __try {
   *pszValue = NULL;
 
   nsAccessible* xpAccessible = GetXPAccessibleFor(varChild);
   if (!xpAccessible || xpAccessible->IsDefunct())
     return E_FAIL;
 
+  if (xpAccessible->NativeRole() == roles::PASSWORD_TEXT)
+    return E_ACCESSDENIED;
+
   nsAutoString value;
-  if (NS_FAILED(xpAccessible->GetValue(value)))
-    return E_FAIL;
+  xpAccessible->Value(value);
 
   // See bug 438784: need to expose URL on doc's value attribute. For this,
   // reverting part of fix for bug 425693 to make this MSAA method behave
   // IAccessible2-style.
   if (value.IsEmpty())
     return S_FALSE;
 
   *pszValue = ::SysAllocStringLen(value.get(), value.Length());
--- a/accessible/src/xforms/nsXFormsAccessible.cpp
+++ b/accessible/src/xforms/nsXFormsAccessible.cpp
@@ -140,26 +140,16 @@ nsXFormsAccessible::CacheSelectChildren(
       GetAccService()->GetOrCreateAccessible(child, mDoc);
     if (!accessible)
       continue;
 
     AppendChild(accessible);
   }
 }
 
-// nsIAccessible
-
-NS_IMETHODIMP
-nsXFormsAccessible::GetValue(nsAString& aValue)
-{
-  NS_ENSURE_TRUE(sXFormsService, NS_ERROR_FAILURE);
-  nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
-  return sXFormsService->GetValue(DOMNode, aValue);
-}
-
 PRUint64
 nsXFormsAccessible::NativeState()
 {
   NS_ENSURE_TRUE(sXFormsService, 0);
 
   nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
 
   bool isRelevant = false;
@@ -208,16 +198,23 @@ nsXFormsAccessible::Description(nsString
   nsTextEquivUtils::
     GetTextEquivFromIDRefs(this, nsGkAtoms::aria_describedby,
                            aDescription);
 
   if (aDescription.IsEmpty())
     GetBoundChildElementValue(NS_LITERAL_STRING("hint"), aDescription);
 }
 
+void
+nsXFormsAccessible::Value(nsString& aValue)
+{
+  nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
+  sXFormsService->GetValue(DOMNode, aValue);
+}
+
 bool
 nsXFormsAccessible::CanHaveAnonChildren()
 {
   return false;
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -540,21 +537,21 @@ nsXFormsSelectableAccessible::GetItemByI
 
 nsXFormsSelectableItemAccessible::
   nsXFormsSelectableItemAccessible(nsIContent* aContent,
                                    nsDocAccessible* aDoc) :
   nsXFormsAccessible(aContent, aDoc)
 {
 }
 
-NS_IMETHODIMP
-nsXFormsSelectableItemAccessible::GetValue(nsAString& aValue)
+void
+nsXFormsSelectableItemAccessible::Value(nsString& aValue)
 {
   nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
-  return sXFormsService->GetValue(DOMNode, aValue);
+  sXFormsService->GetValue(DOMNode, aValue);
 }
 
 PRUint8
 nsXFormsSelectableItemAccessible::ActionCount()
 {
   return 1;
 }
 
--- a/accessible/src/xforms/nsXFormsAccessible.h
+++ b/accessible/src/xforms/nsXFormsAccessible.h
@@ -67,25 +67,23 @@ protected:
  * class is base class for accessible objects for these XForms elements.
  */
 class nsXFormsAccessible : public nsHyperTextAccessibleWrap,
                            public nsXFormsAccessibleBase
 {
 public:
   nsXFormsAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
 
-  // nsIAccessible
-
-  // Returns value of instance node that xforms element is bound to.
-  NS_IMETHOD GetValue(nsAString& aValue);
-
   // nsAccessible
   // Returns value of child xforms 'hint' element.
   virtual void Description(nsString& aDescription);
 
+  // Returns value of instance node that xforms element is bound to.
+  virtual void Value(nsString& aValue);
+
   // Returns value of child xforms 'label' element.
   virtual nsresult GetNameInternal(nsAString& aName);
 
   // Returns state of xforms element taking into account state of instance node
   // that it is bound to.
   virtual PRUint64 NativeState();
 
   // Denies accessible nodes in anonymous content of xforms element by
@@ -184,19 +182,21 @@ protected:
  * The class is base for accessible objects for XForms item elements.
  */
 class nsXFormsSelectableItemAccessible : public nsXFormsAccessible
 {
 public:
   nsXFormsSelectableItemAccessible(nsIContent* aContent,
                                    nsDocAccessible* aDoc);
 
-  NS_IMETHOD GetValue(nsAString& aValue);
   NS_IMETHOD DoAction(PRUint8 aIndex);
 
+  // nsAccessible
+  virtual void Value(nsString& aValue);
+
   // ActionAccessible
   virtual PRUint8 ActionCount();
 
 protected:
   bool IsSelected();
 };
 
 #endif
--- a/accessible/src/xforms/nsXFormsFormControlsAccessible.cpp
+++ b/accessible/src/xforms/nsXFormsFormControlsAccessible.cpp
@@ -104,21 +104,20 @@ nsXFormsTriggerAccessible::
 }
 
 role
 nsXFormsTriggerAccessible::NativeRole()
 {
   return roles::PUSHBUTTON;
 }
 
-NS_IMETHODIMP
-nsXFormsTriggerAccessible::GetValue(nsAString& aValue)
+void
+nsXFormsTriggerAccessible::Value(nsString& aValue)
 {
   aValue.Truncate();
-  return NS_OK;
 }
 
 PRUint8
 nsXFormsTriggerAccessible::ActionCount()
 {
   return 1;
 }
 
@@ -290,20 +289,20 @@ nsXFormsSecretAccessible::NativeRole()
 }
 
 PRUint64
 nsXFormsSecretAccessible::NativeState()
 {
   return nsXFormsInputAccessible::NativeState() | states::PROTECTED;
 }
 
-NS_IMETHODIMP
-nsXFormsSecretAccessible::GetValue(nsAString& aValue)
+void
+nsXFormsSecretAccessible::Value(nsString& aValue)
 {
-  return NS_ERROR_FAILURE;
+  aValue.Truncate();
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXFormsRangeAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 nsXFormsRangeAccessible::
@@ -433,21 +432,20 @@ nsXFormsChoicesAccessible::
 }
 
 role
 nsXFormsChoicesAccessible::NativeRole()
 {
   return roles::GROUPING;
 }
 
-NS_IMETHODIMP
-nsXFormsChoicesAccessible::GetValue(nsAString& aValue)
+void
+nsXFormsChoicesAccessible::Value(nsString& aValue)
 {
   aValue.Truncate();
-  return NS_OK;
 }
 
 void
 nsXFormsChoicesAccessible::CacheChildren()
 {
   CacheSelectChildren();
 }
 
--- a/accessible/src/xforms/nsXFormsFormControlsAccessible.h
+++ b/accessible/src/xforms/nsXFormsFormControlsAccessible.h
@@ -74,22 +74,21 @@ public:
  */
 
 class nsXFormsTriggerAccessible : public nsXFormsAccessible
 {
 public:
   nsXFormsTriggerAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
 
   // nsIAccessible
-  NS_IMETHOD GetValue(nsAString& aValue);
-
   NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
   NS_IMETHOD DoAction(PRUint8 aIndex);
 
   // nsAccessible
+  virtual void Value(nsString& aValue);
   virtual mozilla::a11y::role NativeRole();
 
   // ActionAccessible
   virtual PRUint8 ActionCount();
 };
 
 /**
  * Accessible object for xforms:input and xforms:textarea.
@@ -151,20 +150,18 @@ public:
  * Accessible object for xforms:secret.
  */
 
 class nsXFormsSecretAccessible : public nsXFormsInputAccessible
 {
 public:
   nsXFormsSecretAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
 
-  // nsIAccessible
-  NS_IMETHOD GetValue(nsAString& aValue);
-
   // nsAccessible
+  virtual void Value(nsString& aValue);
   virtual mozilla::a11y::role NativeRole();
   virtual PRUint64 NativeState();
 };
 
 
 /**
  * Accessible object for xforms:range.
  */
@@ -206,19 +203,19 @@ public:
  */
 
 class nsXFormsChoicesAccessible : public nsXFormsAccessible
 {
 public:
   nsXFormsChoicesAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
 
   // nsIAccessible
-  NS_IMETHOD GetValue(nsAString& aValue);
 
   // nsAccessible
+  virtual void Value(nsString& aValue);
   virtual mozilla::a11y::role NativeRole();
 
 protected:
   // nsAccessible
   virtual void CacheChildren();
 };
 
 
--- a/accessible/src/xforms/nsXFormsWidgetsAccessible.cpp
+++ b/accessible/src/xforms/nsXFormsWidgetsAccessible.cpp
@@ -157,37 +157,36 @@ nsXFormsComboboxPopupWidgetAccessible::N
   if (isOpen)
     state = states::FLOATING;
   else
     state = states::INVISIBLE;
 
   return state;
 }
 
-NS_IMETHODIMP
-nsXFormsComboboxPopupWidgetAccessible::GetValue(nsAString& aValue)
-{
-  aValue.Truncate();
-  return NS_OK;
-}
-
 nsresult
 nsXFormsComboboxPopupWidgetAccessible::GetNameInternal(nsAString& aName)
 {
   // Override nsXFormsAccessible::GetName() to prevent name calculation by
   // XForms rules.
   return NS_OK;
 }
 
 void
 nsXFormsComboboxPopupWidgetAccessible::Description(nsString& aDescription)
 {
   aDescription.Truncate();
 }
 
 void
+nsXFormsComboboxPopupWidgetAccessible::Value(nsString& aValue)
+{
+  aValue.Truncate();
+}
+
+void
 nsXFormsComboboxPopupWidgetAccessible::CacheChildren()
 {
   nsCOMPtr<nsIDOMNode> parent = do_QueryInterface(mContent->GetNodeParent());
   // Parent node must be an xforms:select1 element.
   CacheSelectChildren(parent);
 }
 
--- a/accessible/src/xforms/nsXFormsWidgetsAccessible.h
+++ b/accessible/src/xforms/nsXFormsWidgetsAccessible.h
@@ -86,21 +86,19 @@ public:
  * represented by combobox.
  */
 class nsXFormsComboboxPopupWidgetAccessible : public nsXFormsAccessible
 {
 public:
   nsXFormsComboboxPopupWidgetAccessible(nsIContent* aContent,
                                         nsDocAccessible* aDoc);
 
-  // nsIAccessible
-  NS_IMETHOD GetValue(nsAString& aValue);
-
   // nsAccessible
   virtual void Description(nsString& aDescription);
+  virtual void Value(nsString& aValue);
   virtual nsresult GetNameInternal(nsAString& aName);
   virtual mozilla::a11y::role NativeRole();
   virtual PRUint64 NativeState();
 
 protected:
   // nsAccessible
   virtual void CacheChildren();
 };
--- a/accessible/src/xul/nsXULColorPickerAccessible.cpp
+++ b/accessible/src/xul/nsXULColorPickerAccessible.cpp
@@ -58,26 +58,22 @@ nsXULColorPickerTileAccessible::
   nsXULColorPickerTileAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
   nsAccessibleWrap(aContent, aDoc)
 {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULColorPickerTileAccessible: nsIAccessible
 
-NS_IMETHODIMP
-nsXULColorPickerTileAccessible::GetValue(nsAString& aValue)
+void
+nsXULColorPickerTileAccessible::Value(nsString& aValue)
 {
   aValue.Truncate();
 
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
   mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::color, aValue);
-  return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULColorPickerTileAccessible: nsAccessible
 
 role
 nsXULColorPickerTileAccessible::NativeRole()
 {
--- a/accessible/src/xul/nsXULColorPickerAccessible.h
+++ b/accessible/src/xul/nsXULColorPickerAccessible.h
@@ -45,20 +45,18 @@
  * Used for color button in colorpicker palette.
  */
 class nsXULColorPickerTileAccessible : public nsAccessibleWrap
 {
 public:
   nsXULColorPickerTileAccessible(nsIContent* aContent,
                                  nsDocAccessible* aDoc);
 
-  // nsIAccessible
-  NS_IMETHOD GetValue(nsAString& _retval);
-
   // nsAccessible
+  virtual void Value(nsString& aValue);
   virtual mozilla::a11y::role NativeRole();
   virtual PRUint64 NativeState();
 
   // Widgets
   virtual nsAccessible* ContainerWidget() const;
 };
 
 
--- a/accessible/src/xul/nsXULComboboxAccessible.cpp
+++ b/accessible/src/xul/nsXULComboboxAccessible.cpp
@@ -98,32 +98,16 @@ nsXULComboboxAccessible::NativeState()
     }
   }
 
   states |= states::HASPOPUP | states::FOCUSABLE;
 
   return states;
 }
 
-NS_IMETHODIMP
-nsXULComboboxAccessible::GetValue(nsAString& aValue)
-{
-  aValue.Truncate();
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  // The value is the option or text shown entered in the combobox.
-  nsCOMPtr<nsIDOMXULMenuListElement> menuList(do_QueryInterface(mContent));
-  if (menuList)
-    return menuList->GetLabel(aValue);
-
-  return NS_ERROR_FAILURE;
-}
-
 void
 nsXULComboboxAccessible::Description(nsString& aDescription)
 {
   aDescription.Truncate();
   // Use description of currently focused option
   nsCOMPtr<nsIDOMXULMenuListElement> menuListElm(do_QueryInterface(mContent));
   if (!menuListElm)
     return;
@@ -134,16 +118,27 @@ nsXULComboboxAccessible::Description(nsS
     do_QueryInterface(focusedOptionItem);
   if (focusedOptionContent && mDoc) {
     nsAccessible* focusedOptionAcc = mDoc->GetAccessible(focusedOptionContent);
     if (focusedOptionAcc)
       focusedOptionAcc->Description(aDescription);
   }
 }
 
+void
+nsXULComboboxAccessible::Value(nsString& aValue)
+{
+  aValue.Truncate();
+
+  // The value is the option or text shown entered in the combobox.
+  nsCOMPtr<nsIDOMXULMenuListElement> menuList(do_QueryInterface(mContent));
+  if (menuList)
+    menuList->GetLabel(aValue);
+}
+
 bool
 nsXULComboboxAccessible::CanHaveAnonChildren()
 {
   if (mContent->NodeInfo()->Equals(nsGkAtoms::textbox, kNameSpaceID_XUL) ||
       mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::editable,
                             nsGkAtoms::_true, eIgnoreCase)) {
     // Both the XUL <textbox type="autocomplete"> and <menulist editable="true"> widgets
     // use nsXULComboboxAccessible. We need to walk the anonymous children for these
--- a/accessible/src/xul/nsXULComboboxAccessible.h
+++ b/accessible/src/xul/nsXULComboboxAccessible.h
@@ -48,22 +48,22 @@
 class nsXULComboboxAccessible : public nsAccessibleWrap
 {
 public:
   enum { eAction_Click = 0 };
 
   nsXULComboboxAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
 
   // nsIAccessible
-  NS_IMETHOD GetValue(nsAString& aValue);
   NS_IMETHOD DoAction(PRUint8 aIndex);
   NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
 
   // nsAccessible
   virtual void Description(nsString& aDescription);
+  virtual void Value(nsString& aValue);
   virtual mozilla::a11y::role NativeRole();
   virtual PRUint64 NativeState();
   virtual bool CanHaveAnonChildren();
 
   // ActionAccessible
   virtual PRUint8 ActionCount();
 
   // Widgets
--- a/accessible/src/xul/nsXULFormControlAccessible.cpp
+++ b/accessible/src/xul/nsXULFormControlAccessible.cpp
@@ -723,35 +723,32 @@ nsXULTextFieldAccessible::
 {
 }
 
 NS_IMPL_ISUPPORTS_INHERITED3(nsXULTextFieldAccessible, nsAccessible, nsHyperTextAccessible, nsIAccessibleText, nsIAccessibleEditableText)
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULTextFieldAccessible: nsIAccessible
 
-NS_IMETHODIMP nsXULTextFieldAccessible::GetValue(nsAString& aValue)
+void
+nsXULTextFieldAccessible::Value(nsString& aValue)
 {
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  PRUint64 state = NativeState();
-
-  if (state & states::PROTECTED)    // Don't return password text!
-    return NS_ERROR_FAILURE;
+  aValue.Truncate();
+  if (NativeRole() == roles::PASSWORD_TEXT) // Don't return password text!
+    return;
 
   nsCOMPtr<nsIDOMXULTextBoxElement> textBox(do_QueryInterface(mContent));
   if (textBox) {
-    return textBox->GetValue(aValue);
+    textBox->GetValue(aValue);
+    return;
   }
+
   nsCOMPtr<nsIDOMXULMenuListElement> menuList(do_QueryInterface(mContent));
-  if (menuList) {
-    return menuList->GetLabel(aValue);
-  }
-  return NS_ERROR_FAILURE;
+  if (menuList)
+    menuList->GetLabel(aValue);
 }
 
 void
 nsXULTextFieldAccessible::ApplyARIAState(PRUint64* aState)
 {
   nsHyperTextAccessibleWrap::ApplyARIAState(aState);
 
   aria::MapToState(aria::eARIAAutoComplete, mContent->AsElement(), aState);
--- a/accessible/src/xul/nsXULFormControlAccessible.h
+++ b/accessible/src/xul/nsXULFormControlAccessible.h
@@ -249,24 +249,24 @@ class nsXULTextFieldAccessible : public 
 public:
   enum { eAction_Click = 0 };
 
   nsXULTextFieldAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIAccessible
-  NS_IMETHOD GetValue(nsAString& aValue);
   NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
   NS_IMETHOD DoAction(PRUint8 index);
 
   // nsHyperTextAccessible
   virtual already_AddRefed<nsIEditor> GetEditor() const;
 
   // nsAccessible
+  virtual void Value(nsString& aValue);
   virtual void ApplyARIAState(PRUint64* aState);
   virtual mozilla::a11y::role NativeRole();
   virtual PRUint64 NativeState();
   virtual bool CanHaveAnonChildren();
 
   // ActionAccessible
   virtual PRUint8 ActionCount();
 
--- a/accessible/src/xul/nsXULListboxAccessible.cpp
+++ b/accessible/src/xul/nsXULListboxAccessible.cpp
@@ -205,27 +205,28 @@ nsXULListboxAccessible::NativeState()
   }
 
   return states;
 }
 
 /**
   * Our value is the label of our ( first ) selected child.
   */
-NS_IMETHODIMP nsXULListboxAccessible::GetValue(nsAString& _retval)
+void
+nsXULListboxAccessible::Value(nsString& aValue)
 {
-  _retval.Truncate();
+  aValue.Truncate();
+
   nsCOMPtr<nsIDOMXULSelectControlElement> select(do_QueryInterface(mContent));
   if (select) {
     nsCOMPtr<nsIDOMXULSelectControlItemElement> selectedItem;
     select->GetSelectedItem(getter_AddRefs(selectedItem));
     if (selectedItem)
-      return selectedItem->GetLabel(_retval);
+      selectedItem->GetLabel(aValue);
   }
-  return NS_ERROR_FAILURE;
 }
 
 role
 nsXULListboxAccessible::NativeRole()
 {
   // A richlistbox is used with the new autocomplete URL bar, and has a parent
   // popup <panel>.
   nsCOMPtr<nsIDOMXULPopupElement> xulPopup =
--- a/accessible/src/xul/nsXULListboxAccessible.h
+++ b/accessible/src/xul/nsXULListboxAccessible.h
@@ -99,23 +99,21 @@ public:
   nsXULListboxAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
   virtual ~nsXULListboxAccessible() {}
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIAccessibleTable
   NS_DECL_OR_FORWARD_NSIACCESSIBLETABLE_WITH_XPCACCESSIBLETABLE
 
-  // nsIAccessible
-  NS_IMETHOD GetValue(nsAString& aValue);
-
   // nsAccessNode
   virtual void Shutdown();
 
   // nsAccessible
+  virtual void Value(nsString& aValue);
   virtual mozilla::a11y::TableAccessible* AsTable() { return this; }
   virtual mozilla::a11y::role NativeRole();
   virtual PRUint64 NativeState();
 
   // Widgets
   virtual bool IsWidget() const;
   virtual bool IsActiveWidget() const;
   virtual bool AreItemsOperable() const;
--- a/accessible/src/xul/nsXULSliderAccessible.cpp
+++ b/accessible/src/xul/nsXULSliderAccessible.cpp
@@ -87,20 +87,20 @@ nsXULSliderAccessible::NativeState()
   if (FocusMgr()->IsFocused(this))
     states |= states::FOCUSED;
 
   return states;
 }
 
 // nsIAccessible
 
-NS_IMETHODIMP
-nsXULSliderAccessible::GetValue(nsAString& aValue)
+void
+nsXULSliderAccessible::Value(nsString& aValue)
 {
-  return GetSliderAttr(nsGkAtoms::curpos, aValue);
+  GetSliderAttr(nsGkAtoms::curpos, aValue);
 }
 
 PRUint8
 nsXULSliderAccessible::ActionCount()
 {
   return 1;
 }
 
--- a/accessible/src/xul/nsXULSliderAccessible.h
+++ b/accessible/src/xul/nsXULSliderAccessible.h
@@ -50,24 +50,24 @@ class nsXULSliderAccessible : public nsA
 {
 public:
   nsXULSliderAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIAccessible
-  NS_IMETHOD GetValue(nsAString& aValue);
   NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
   NS_IMETHOD DoAction(PRUint8 aIndex);
 
   // nsIAccessibleValue
   NS_DECL_NSIACCESSIBLEVALUE
 
   // nsAccessible
+  virtual void Value(nsString& aValue);
   virtual mozilla::a11y::role NativeRole();
   virtual PRUint64 NativeState();
   virtual bool CanHaveAnonChildren();
 
   // ActionAccessible
   virtual PRUint8 ActionCount();
 
 protected:
--- a/accessible/src/xul/nsXULTabAccessible.cpp
+++ b/accessible/src/xul/nsXULTabAccessible.cpp
@@ -182,20 +182,20 @@ nsXULTabsAccessible::NativeRole()
 }
 
 PRUint8
 nsXULTabsAccessible::ActionCount()
 {
   return 0;
 }
 
-/** no value */
-NS_IMETHODIMP nsXULTabsAccessible::GetValue(nsAString& _retval)
+void
+nsXULTabsAccessible::Value(nsString& aValue)
 {
-  return NS_OK;
+  aValue.Truncate();
 }
 
 nsresult
 nsXULTabsAccessible::GetNameInternal(nsAString& aName)
 {
   // no name
   return NS_OK;
 }
--- a/accessible/src/xul/nsXULTabAccessible.h
+++ b/accessible/src/xul/nsXULTabAccessible.h
@@ -71,20 +71,18 @@ public:
 /**
  * A container of tab objects, xul:tabs element.
  */
 class nsXULTabsAccessible : public XULSelectControlAccessible
 {
 public:
   nsXULTabsAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
 
-  // nsIAccessible
-  NS_IMETHOD GetValue(nsAString& _retval);
-
   // nsAccessible
+  virtual void Value(nsString& aValue);
   virtual nsresult GetNameInternal(nsAString& aName);
   virtual mozilla::a11y::role NativeRole();
 
   // ActionAccessible
   virtual PRUint8 ActionCount();
 };
 
 
--- a/accessible/src/xul/nsXULTextAccessible.cpp
+++ b/accessible/src/xul/nsXULTextAccessible.cpp
@@ -146,26 +146,22 @@ nsXULLinkAccessible::
 
 // Expose nsIAccessibleHyperLink unconditionally
 NS_IMPL_ISUPPORTS_INHERITED1(nsXULLinkAccessible, nsHyperTextAccessibleWrap,
                              nsIAccessibleHyperLink)
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULLinkAccessible. nsIAccessible
 
-NS_IMETHODIMP
-nsXULLinkAccessible::GetValue(nsAString& aValue)
+void
+nsXULLinkAccessible::Value(nsString& aValue)
 {
   aValue.Truncate();
 
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
   mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::href, aValue);
-  return NS_OK;
 }
 
 nsresult
 nsXULLinkAccessible::GetNameInternal(nsAString& aName)
 {
   mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::value, aName);
   if (!aName.IsEmpty())
     return NS_OK;
--- a/accessible/src/xul/nsXULTextAccessible.h
+++ b/accessible/src/xul/nsXULTextAccessible.h
@@ -76,22 +76,21 @@ class nsXULLinkAccessible : public nsHyp
 {
 
 public:
   nsXULLinkAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIAccessible
-  NS_IMETHOD GetValue(nsAString& aValue);
-
   NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
   NS_IMETHOD DoAction(PRUint8 aIndex);
 
   // nsAccessible
+  virtual void Value(nsString& aValue);
   virtual nsresult GetNameInternal(nsAString& aName);
   virtual mozilla::a11y::role NativeRole();
   virtual PRUint64 NativeState();
 
   // ActionAccessible
   virtual PRUint8 ActionCount();
 
   // HyperLinkAccessible
--- a/accessible/src/xul/nsXULTreeAccessible.cpp
+++ b/accessible/src/xul/nsXULTreeAccessible.cpp
@@ -138,46 +138,42 @@ nsXULTreeAccessible::NativeState()
   NS_ENSURE_SUCCESS(rv, state);
 
   if (!isSingle)
     state |= states::MULTISELECTABLE;
 
   return state;
 }
 
-NS_IMETHODIMP
-nsXULTreeAccessible::GetValue(nsAString& aValue)
+void
+nsXULTreeAccessible::Value(nsString& aValue)
 {
   // Return the value is the first selected child.
 
   aValue.Truncate();
 
-  if (IsDefunct() || !mTreeView)
-    return NS_ERROR_FAILURE;
-
   nsCOMPtr<nsITreeSelection> selection;
   mTreeView->GetSelection(getter_AddRefs(selection));
   if (!selection)
-    return NS_ERROR_FAILURE;
+    return;
 
   PRInt32 currentIndex;
   nsCOMPtr<nsIDOMElement> selectItem;
   selection->GetCurrentIndex(&currentIndex);
   if (currentIndex >= 0) {
     nsCOMPtr<nsITreeColumn> keyCol;
 
     nsCOMPtr<nsITreeColumns> cols;
     mTree->GetColumns(getter_AddRefs(cols));
     if (cols)
       cols->GetKeyColumn(getter_AddRefs(keyCol));
 
-    return mTreeView->GetCellText(currentIndex, keyCol, aValue);
+    mTreeView->GetCellText(currentIndex, keyCol, aValue);
   }
 
-  return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULTreeAccessible: nsAccessNode implementation
 
 void
 nsXULTreeAccessible::Shutdown()
 {
--- a/accessible/src/xul/nsXULTreeAccessible.h
+++ b/accessible/src/xul/nsXULTreeAccessible.h
@@ -69,23 +69,21 @@ public:
 
   nsXULTreeAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
 
   // nsISupports and cycle collection
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsXULTreeAccessible,
                                            nsAccessible)
 
-  // nsIAccessible
-  NS_IMETHOD GetValue(nsAString& aValue);
-
   // nsAccessNode
   virtual void Shutdown();
 
   // nsAccessible
+  virtual void Value(nsString& aValue);
   virtual mozilla::a11y::role NativeRole();
   virtual PRUint64 NativeState();
   virtual nsAccessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
                                      EWhichChildAtPoint aWhichChild);
 
   virtual nsAccessible* GetChildAt(PRUint32 aIndex);
   virtual PRInt32 GetChildCount();
 
--- a/accessible/tests/mochitest/testTextboxes.js
+++ b/accessible/tests/mochitest/testTextboxes.js
@@ -1,21 +1,11 @@
 function testValue(aID, aAcc, aValue, aRole)
 {
-  if (aRole == ROLE_PASSWORD_TEXT) {
-    var value;
-    try {
-      value = aAcc.value;
-      do_throw("We do not want a value on " + aID + "!");
-    } catch(e) {
-      is(e.result, Components.results.NS_ERROR_FAILURE,
-         "Wrong return value for getValue on " + aID + "!");
-    }
-  } else
-    is(aAcc.value, aValue, "Wrong value for " + aID + "!");
+  is(aAcc.value, aValue, "Wrong value for " + aID + "!");
 }
 
 function testAction(aID, aAcc, aNumActions, aActionName, aActionDescription)
 {
   var numActions = aAcc.numActions;
   is(numActions, aNumActions, "Wrong number of actions for " + aID + "!");
 
   if (numActions != 0) {