Bug 745287 - Fix recent a11y build warnings; r=davidb,capella
authorMs2ger <ms2ger@gmail.com>
Sat, 14 Apr 2012 14:57:00 +0200
changeset 91698 f3aa582f0137cb813ba02983f5264c714444016b
parent 91697 356d8a2fd732609bce56967c76ecddc712188b38
child 91699 24ebe492528b7b90b26a51d53b3bd8812c0e70ba
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersdavidb, capella
bugs745287
milestone14.0a1
Bug 745287 - Fix recent a11y build warnings; r=davidb,capella
accessible/src/generic/FormControlAccessible.cpp
accessible/src/html/nsHTMLImageAccessible.cpp
--- a/accessible/src/generic/FormControlAccessible.cpp
+++ b/accessible/src/generic/FormControlAccessible.cpp
@@ -114,23 +114,23 @@ void
 ProgressMeterAccessible<Max>::Value(nsString& aValue)
 {
   nsLeafAccessible::Value(aValue);
   if (!aValue.IsEmpty())
     return;
 
   double maxValue = 0;
   nsresult rv = GetMaximumValue(&maxValue);
-  NS_ENSURE_SUCCESS(rv, );
-  if (maxValue == 0)
+  if (NS_FAILED(rv) || maxValue == 0)
     return;
 
   double curValue = 0;
   GetCurrentValue(&curValue);
-  NS_ENSURE_SUCCESS(rv, );
+  if (NS_FAILED(rv))
+    return;
 
   // Treat the current value bigger than maximum as 100%.
   double percentValue = (curValue < maxValue) ?
     (curValue / maxValue) * 100 : 100;
 
   aValue.AppendFloat(percentValue);
   aValue.AppendLiteral("%");
 }
--- a/accessible/src/html/nsHTMLImageAccessible.cpp
+++ b/accessible/src/html/nsHTMLImageAccessible.cpp
@@ -238,18 +238,17 @@ nsHTMLImageAccessible::GetLongDescURI() 
       element->GetURIAttr(nsGkAtoms::longdesc, nsnull, getter_AddRefs(uri));
       return uri.forget();
     }
   }
 
   nsDocAccessible* document = Document();
   if (document) {
     IDRefsIterator iter(document, mContent, nsGkAtoms::aria_describedby);
-    nsIContent* target = nsnull;
-    while (target = iter.NextElem()) {
+    while (nsIContent* target = iter.NextElem()) {
       if ((target->IsHTML(nsGkAtoms::a) || target->IsHTML(nsGkAtoms::area)) &&
           target->HasAttr(kNameSpaceID_None, nsGkAtoms::href)) {
         nsGenericHTMLElement* element =
           nsGenericHTMLElement::FromContent(target);
 
         nsCOMPtr<nsIURI> uri;
         element->GetURIAttr(nsGkAtoms::href, nsnull, getter_AddRefs(uri));
         return uri.forget();