Backed out 4 changesets (bug 1270310) for mass mochitest bustage CLOSED TREE
authorWes Kocher <wkocher@mozilla.com>
Thu, 26 May 2016 00:04:04 -0700
changeset 340162 df9fd4cff088217776253331d10e31de653cdbb4
parent 340161 29637a385bc2975ae8d34fd0322b0a2293b5f113
child 340163 1f5902db90a7f9be77ee5938861b2067874fcdc7
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1270310
milestone49.0a1
backs outff9ace379d788d46677e933021ebd041bff8607d
605790e5e6118254accae9c34c5f1a98948972da
4c302e1119e165fd389ced209be1ed34ef9e0231
3e2d76bd1f08108fc90859b51366efc3c8fa6c5c
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 4 changesets (bug 1270310) for mass mochitest bustage CLOSED TREE Backed out changeset ff9ace379d78 (bug 1270310) Backed out changeset 605790e5e611 (bug 1270310) Backed out changeset 4c302e1119e1 (bug 1270310) Backed out changeset 3e2d76bd1f08 (bug 1270310)
dom/html/HTMLInputElement.cpp
dom/html/HTMLInputElement.h
dom/html/HTMLTextAreaElement.cpp
dom/webidl/HTMLInputElement.webidl
xpcom/io/nsLinebreakConverter.cpp
--- a/dom/html/HTMLInputElement.cpp
+++ b/dom/html/HTMLInputElement.cpp
@@ -1522,38 +1522,35 @@ HTMLInputElement::SetWidth(uint32_t aWid
   ErrorResult rv;
   SetWidth(aWidth, rv);
   return rv.StealNSResult();
 }
 
 NS_IMETHODIMP
 HTMLInputElement::GetValue(nsAString& aValue)
 {
-  nsresult rv = GetValueInternal(aValue);
-  if (NS_FAILED(rv)) {
-    return rv;
-  }
+  GetValueInternal(aValue);
 
   // Don't return non-sanitized value for types that are experimental on mobile.
   if (IsExperimentalMobileType(mType)) {
     SanitizeValue(aValue);
   }
 
   return NS_OK;
 }
 
 nsresult
 HTMLInputElement::GetValueInternal(nsAString& aValue) const
 {
   switch (GetValueMode()) {
     case VALUE_MODE_VALUE:
       if (IsSingleLineTextControl(false)) {
         mInputData.mState->GetValue(aValue, true);
-      } else if (!aValue.Assign(mInputData.mValue, fallible)) {
-        return NS_ERROR_OUT_OF_MEMORY;
+      } else {
+        aValue.Assign(mInputData.mValue);
       }
       return NS_OK;
 
     case VALUE_MODE_FILENAME:
       if (nsContentUtils::LegacyIsCallerChromeOrNativeCode()) {
 #ifndef MOZ_CHILD_PERMISSIONS
         aValue.Assign(mFirstFilePath);
 #else
@@ -1680,25 +1677,16 @@ HTMLInputElement::GetValueAsDecimal() co
 
   GetValueInternal(stringValue);
 
   return !ConvertStringToNumber(stringValue, decimalValue) ? Decimal::nan()
                                                            : decimalValue;
 }
 
 void
-HTMLInputElement::GetValue(nsAString& aValue, ErrorResult& aRv)
-{
-  nsresult rv = GetValue(aValue);
-  if (NS_FAILED(rv)) {
-    aRv.Throw(rv);
-  }
-}
-
-void
 HTMLInputElement::SetValue(const nsAString& aValue, ErrorResult& aRv)
 {
   // check security.  Note that setting the value to the empty string is always
   // OK and gives pages a way to clear a file input if necessary.
   if (mType == NS_FORM_INPUT_FILE) {
     if (!aValue.IsEmpty()) {
       if (!nsContentUtils::IsCallerChrome()) {
         // setting the value of a "FILE" input widget requires
@@ -5770,33 +5758,24 @@ HTMLInputElement::SaveState()
       if ((GetValueMode() == VALUE_MODE_DEFAULT &&
            mType != NS_FORM_INPUT_HIDDEN) ||
           mType == NS_FORM_INPUT_PASSWORD || !mValueChanged) {
         break;
       }
 
       inputState = new HTMLInputElementState();
       nsAutoString value;
-      nsresult rv = GetValue(value);
-      if (NS_FAILED(rv)) {
-        return rv;
-      }
-
-      if (!IsSingleLineTextControl(false)) {
-        rv = nsLinebreakConverter::ConvertStringLineBreaks(
-               value,
-               nsLinebreakConverter::eLinebreakPlatform,
-               nsLinebreakConverter::eLinebreakContent);
-
-        if (NS_FAILED(rv)) {
-          NS_ERROR("Converting linebreaks failed!");
-          return rv;
-        }
-      }
-
+      GetValue(value);
+      DebugOnly<nsresult> rv =
+        nsLinebreakConverter::ConvertStringLineBreaks(
+             value,
+             nsLinebreakConverter::eLinebreakPlatform,
+             nsLinebreakConverter::eLinebreakContent);
+      NS_ASSERTION(NS_SUCCEEDED(rv), "Converting linebreaks failed!");
+      inputState->SetValue(value);
       break;
   }
 
   if (inputState) {
     nsPresState* state = GetPrimaryPresState();
     if (state) {
       state->SetStateProperty(inputState);
     }
--- a/dom/html/HTMLInputElement.h
+++ b/dom/html/HTMLInputElement.h
@@ -618,17 +618,17 @@ public:
   }
 
   // XPCOM GetDefaultValue() is OK
   void SetDefaultValue(const nsAString& aValue, ErrorResult& aRv)
   {
     SetHTMLAttr(nsGkAtoms::value, aValue, aRv);
   }
 
-  void GetValue(nsAString& aValue, ErrorResult& aRv);
+  // XPCOM GetValue() is OK
   void SetValue(const nsAString& aValue, ErrorResult& aRv);
 
   Nullable<Date> GetValueAsDate(ErrorResult& aRv);
 
   void SetValueAsDate(Nullable<Date>, ErrorResult& aRv);
 
   double ValueAsNumber() const
   {
--- a/dom/html/HTMLTextAreaElement.cpp
+++ b/dom/html/HTMLTextAreaElement.cpp
@@ -1080,21 +1080,17 @@ HTMLTextAreaElement::SaveState()
     if (state) {
       nsAutoString value;
       GetValueInternal(value, true);
 
       rv = nsLinebreakConverter::ConvertStringLineBreaks(
                value,
                nsLinebreakConverter::eLinebreakPlatform,
                nsLinebreakConverter::eLinebreakContent);
-
-      if (NS_FAILED(rv)) {
-        NS_ERROR("Converting linebreaks failed!");
-        return rv;
-      }
+      NS_ASSERTION(NS_SUCCEEDED(rv), "Converting linebreaks failed!");
 
       nsCOMPtr<nsISupportsString> pState =
         do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID);
       if (!pState) {
         return NS_ERROR_OUT_OF_MEMORY;
       }
       pState->SetData(value);
       state->SetStateProperty(pState);
--- a/dom/webidl/HTMLInputElement.webidl
+++ b/dom/webidl/HTMLInputElement.webidl
@@ -81,17 +81,17 @@ interface HTMLInputElement : HTMLElement
   [Pure, SetterThrows]
            attribute DOMString src;
   [Pure, SetterThrows]
            attribute DOMString step;
   [Pure, SetterThrows]
            attribute DOMString type;
   [Pure, SetterThrows]
            attribute DOMString defaultValue;
-  [Pure, TreatNullAs=EmptyString, Throws]
+  [Pure, TreatNullAs=EmptyString, SetterThrows]
            attribute DOMString value;
   [Throws, Pref="dom.experimental_forms"]
            attribute Date? valueAsDate;
   [Pure, SetterThrows]
            attribute unrestricted double valueAsNumber;
            attribute unsigned long width;
 
   [Throws]
--- a/xpcom/io/nsLinebreakConverter.cpp
+++ b/xpcom/io/nsLinebreakConverter.cpp
@@ -459,30 +459,28 @@ nsLinebreakConverter::ConvertStringLineB
     return NS_OK;
   }
 
   nsresult rv;
 
   // remember the old buffer in case
   // we blow it away later
   nsString::char_iterator stringBuf;
-  if (!aIoString.BeginWriting(stringBuf, fallible)) {
-    return NS_ERROR_OUT_OF_MEMORY;
-  }
+  aIoString.BeginWriting(stringBuf);
 
   int32_t    newLen;
 
   rv = ConvertUnicharLineBreaksInSitu(&stringBuf,
                                       aSrcBreaks, aDestBreaks,
                                       aIoString.Length() + 1, &newLen);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   if (stringBuf != aIoString.get()) {
-    aIoString.Adopt(stringBuf, newLen - 1);
+    aIoString.Adopt(stringBuf);
   }
 
   return NS_OK;
 }