Backed out changeset 83a7ad25941e (bug 1412437) for robocop testAccessibleCarets bustage
authorPhil Ringnalda <philringnalda@gmail.com>
Tue, 31 Oct 2017 20:07:15 -0700
changeset 442681 9ee7c95489827c94babf15c0d4886957c1c44dac
parent 442680 e626359954d05c43899c71f77cbb4f4655f52d72
child 442682 7651a53b3faf36d9f76202eab9f1338b9d839c72
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1412437
milestone58.0a1
backs out83a7ad25941e7d20cd6a94ded43f86dc4df99f6b
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 changeset 83a7ad25941e (bug 1412437) for robocop testAccessibleCarets bustage CLOSED TREE MozReview-Commit-ID: Lg1GSdLDyin
accessible/html/HTMLFormControlAccessible.cpp
browser/components/sessionstore/test/browser_248970_b_perwindowpb.js
docshell/base/nsDocShellTreeOwner.cpp
dom/base/nsDocument.cpp
dom/base/nsWindowRoot.cpp
dom/html/HTMLTextAreaElement.cpp
dom/html/HTMLTextAreaElement.h
dom/html/nsTextEditorState.cpp
dom/interfaces/html/moz.build
dom/interfaces/html/nsIDOMHTMLTextAreaElement.idl
dom/webbrowserpersist/WebBrowserPersistLocalDocument.cpp
dom/webidl/HTMLTextAreaElement.webidl
dom/xbl/nsXBLPrototypeHandler.cpp
layout/forms/nsTextControlFrame.cpp
layout/forms/nsTextControlFrame.h
layout/generic/nsGfxScrollFrame.cpp
mobile/android/modules/ActionBarHandler.jsm
mobile/android/tests/browser/robocop/testAccessibleCarets.js
toolkit/modules/BrowserUtils.jsm
toolkit/modules/sessionstore/FormData.jsm
xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp
--- a/accessible/html/HTMLFormControlAccessible.cpp
+++ b/accessible/html/HTMLFormControlAccessible.cpp
@@ -10,17 +10,17 @@
 #include "nsEventShell.h"
 #include "nsTextEquivUtils.h"
 #include "Relation.h"
 #include "Role.h"
 #include "States.h"
 
 #include "nsContentList.h"
 #include "mozilla/dom/HTMLInputElement.h"
-#include "mozilla/dom/HTMLTextAreaElement.h"
+#include "nsIDOMHTMLTextAreaElement.h"
 #include "nsIEditor.h"
 #include "nsIFormControl.h"
 #include "nsIPersistentProperties2.h"
 #include "nsISelectionController.h"
 #include "nsIServiceManager.h"
 #include "nsITextControlElement.h"
 #include "nsITextControlFrame.h"
 #include "nsNameSpaceManager.h"
@@ -340,17 +340,17 @@ HTMLTextFieldAccessible::NativeName(nsSt
 
 void
 HTMLTextFieldAccessible::Value(nsString& aValue)
 {
   aValue.Truncate();
   if (NativeState() & states::PROTECTED)    // Don't return password text!
     return;
 
-  HTMLTextAreaElement* textArea = HTMLTextAreaElement::FromContent(mContent);
+  nsCOMPtr<nsIDOMHTMLTextAreaElement> textArea(do_QueryInterface(mContent));
   if (textArea) {
     textArea->GetValue(aValue);
     return;
   }
 
   HTMLInputElement* input = HTMLInputElement::FromContent(mContent);
   if (input) {
     // Pass NonSystem as the caller type, to be safe.  We don't expect to have a
--- a/browser/components/sessionstore/test/browser_248970_b_perwindowpb.js
+++ b/browser/components/sessionstore/test/browser_248970_b_perwindowpb.js
@@ -60,17 +60,17 @@ function test() {
 
   function compareFormValue(aTab, aQuery, aValue) {
     let node = getElementByXPath(aTab, aQuery);
     if (!node)
       return false;
     if (node instanceof Ci.nsIDOMHTMLInputElement)
       return aValue == (node.type == "checkbox" || node.type == "radio" ?
                        node.checked : node.value);
-    if (ChromeUtils.getClassName(node) === "HTMLTextAreaElement")
+    if (node instanceof Ci.nsIDOMHTMLTextAreaElement)
       return aValue == node.value;
     if (!node.multiple)
       return aValue == node.selectedIndex;
     return Array.every(node.options, (aOpt, aIx) =>
             (aValue.indexOf(aIx) > -1) == aOpt.selected);
   }
 
   /**
--- a/docshell/base/nsDocShellTreeOwner.cpp
+++ b/docshell/base/nsDocShellTreeOwner.cpp
@@ -35,16 +35,17 @@
 #include "Link.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/SVGTitleElement.h"
 #include "nsIDOMEvent.h"
 #include "nsIDOMFileList.h"
 #include "nsIDOMMouseEvent.h"
 #include "nsIFormControl.h"
 #include "nsIDOMHTMLInputElement.h"
+#include "nsIDOMHTMLTextAreaElement.h"
 #include "nsIDOMHTMLHtmlElement.h"
 #include "nsIDOMHTMLDocument.h"
 #include "nsIImageLoadingContent.h"
 #include "nsIWebNavigation.h"
 #include "nsIDOMHTMLElement.h"
 #include "nsIPresShell.h"
 #include "nsIStringBundle.h"
 #include "nsPIDOMWindow.h"
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -167,17 +167,16 @@
 #include "nsFrameLoader.h"
 #include "nsEscape.h"
 #include "nsObjectLoadingContent.h"
 #include "nsHtml5TreeOpExecutor.h"
 #include "mozilla/dom/HTMLLinkElement.h"
 #include "mozilla/dom/HTMLMediaElement.h"
 #include "mozilla/dom/HTMLIFrameElement.h"
 #include "mozilla/dom/HTMLImageElement.h"
-#include "mozilla/dom/HTMLTextAreaElement.h"
 #include "mozilla/dom/MediaSource.h"
 #include "mozilla/dom/FlyWebService.h"
 
 #include "mozAutoDocUpdate.h"
 #include "nsGlobalWindow.h"
 #include "mozilla/Encoding.h"
 #include "nsDOMNavigationTiming.h"
 
@@ -226,16 +225,17 @@
 #include "mozilla/dom/TabChild.h"
 #include "mozilla/dom/WebComponentsBinding.h"
 #include "mozilla/dom/CustomElementRegistryBinding.h"
 #include "mozilla/dom/CustomElementRegistry.h"
 #include "mozilla/dom/TimeoutManager.h"
 #include "mozilla/ExtensionPolicyService.h"
 #include "nsFrame.h"
 #include "nsDOMCaretPosition.h"
+#include "nsIDOMHTMLTextAreaElement.h"
 #include "nsViewportInfo.h"
 #include "mozilla/StaticPtr.h"
 #include "nsITextControlElement.h"
 #include "nsIDOMNSEditableElement.h"
 #include "nsIEditor.h"
 #include "nsIDOMCSSStyleRule.h"
 #include "mozilla/css/StyleRule.h"
 #include "nsIHttpChannelInternal.h"
@@ -10946,17 +10946,17 @@ nsIDocument::CaretPositionFromPoint(floa
 
   nsCOMPtr<nsIContent> node = offsets.content;
   uint32_t offset = offsets.offset;
   nsCOMPtr<nsIContent> anonNode = node;
   bool nodeIsAnonymous = node && node->IsInNativeAnonymousSubtree();
   if (nodeIsAnonymous) {
     node = ptFrame->GetContent();
     nsIContent* nonanon = node->FindFirstNonChromeOnlyAccessContent();
-    HTMLTextAreaElement* textArea = HTMLTextAreaElement::FromContent(nonanon);
+    nsCOMPtr<nsIDOMHTMLTextAreaElement> textArea = do_QueryInterface(nonanon);
     nsITextControlFrame* textFrame = do_QueryFrame(nonanon->GetPrimaryFrame());
     nsNumberControlFrame* numberFrame = do_QueryFrame(nonanon->GetPrimaryFrame());
     if (textFrame || numberFrame) {
       // If the anonymous content node has a child, then we need to make sure
       // that we get the appropriate child, as otherwise the offset may not be
       // correct when we construct a range for it.
       nsCOMPtr<nsIContent> firstChild = anonNode->GetFirstChild();
       if (firstChild) {
--- a/dom/base/nsWindowRoot.cpp
+++ b/dom/base/nsWindowRoot.cpp
@@ -14,22 +14,22 @@
 #include "nsPresContext.h"
 #include "nsLayoutCID.h"
 #include "nsContentCID.h"
 #include "nsString.h"
 #include "nsGlobalWindow.h"
 #include "nsFocusManager.h"
 #include "nsIContent.h"
 #include "nsIDOMHTMLInputElement.h"
+#include "nsIDOMHTMLTextAreaElement.h"
 #include "nsIControllers.h"
 #include "nsIController.h"
 #include "xpcpublic.h"
 #include "nsCycleCollectionParticipant.h"
 #include "mozilla/dom/TabParent.h"
-#include "mozilla/dom/HTMLTextAreaElement.h"
 
 #ifdef MOZ_XUL
 #include "nsXULElement.h"
 #endif
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
@@ -229,18 +229,18 @@ nsWindowRoot::GetControllers(bool aForVi
     if (xulElement) {
       ErrorResult rv;
       *aResult = xulElement->GetControllers(rv);
       NS_IF_ADDREF(*aResult);
       return rv.StealNSResult();
     }
 #endif
 
-    HTMLTextAreaElement* htmlTextArea =
-      HTMLTextAreaElement::FromContent(focusedContent);
+    nsCOMPtr<nsIDOMHTMLTextAreaElement> htmlTextArea =
+      do_QueryInterface(focusedContent);
     if (htmlTextArea)
       return htmlTextArea->GetControllers(aResult);
 
     nsCOMPtr<nsIDOMHTMLInputElement> htmlInputElement =
       do_QueryInterface(focusedContent);
     if (htmlInputElement)
       return htmlInputElement->GetControllers(aResult);
 
--- a/dom/html/HTMLTextAreaElement.cpp
+++ b/dom/html/HTMLTextAreaElement.cpp
@@ -81,16 +81,17 @@ HTMLTextAreaElement::HTMLTextAreaElement
 NS_IMPL_CYCLE_COLLECTION_INHERITED(HTMLTextAreaElement,
                                    nsGenericHTMLFormElementWithState,
                                    mValidity,
                                    mControllers,
                                    mState)
 
 NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED(HTMLTextAreaElement,
                                              nsGenericHTMLFormElementWithState,
+                                             nsIDOMHTMLTextAreaElement,
                                              nsITextControlElement,
                                              nsIDOMNSEditableElement,
                                              nsIMutationObserver,
                                              nsIConstraintValidation)
 
 // nsIDOMHTMLTextAreaElement
 
 nsresult
@@ -115,37 +116,44 @@ HTMLTextAreaElement::Clone(mozilla::dom:
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   it->mLastValueChangeWasInteractive = mLastValueChangeWasInteractive;
   it.forget(aResult);
   return NS_OK;
 }
 
+NS_IMETHODIMP
+HTMLTextAreaElement::GetForm(nsIDOMHTMLFormElement** aForm)
+{
+  return nsGenericHTMLFormElementWithState::GetForm(aForm);
+}
+
+
 // nsIContent
 
-void
+NS_IMETHODIMP
 HTMLTextAreaElement::Select()
 {
   // XXX Bug?  We have to give the input focus before contents can be
   // selected
 
   FocusTristate state = FocusState();
   if (state == eUnfocusable) {
-    return;
+    return NS_OK;
   }
 
   nsIFocusManager* fm = nsFocusManager::GetFocusManager();
 
   RefPtr<nsPresContext> presContext = GetPresContext(eForComposedDoc);
   if (state == eInactiveWindow) {
     if (fm)
       fm->SetFocus(this, nsIFocusManager::FLAG_NOSCROLL);
     SelectAll(presContext);
-    return;
+    return NS_OK;
   }
 
   nsEventStatus status = nsEventStatus_eIgnore;
   WidgetGUIEvent event(true, eFormSelect, nullptr);
   // XXXbz HTMLInputElement guards against this reentering; shouldn't we?
   EventDispatcher::Dispatch(static_cast<nsIContent*>(this), presContext,
                             &event, nullptr, &status);
 
@@ -159,16 +167,18 @@ HTMLTextAreaElement::Select()
       nsCOMPtr<nsIDOMElement> focusedElement;
       fm->GetFocusedElement(getter_AddRefs(focusedElement));
       if (SameCOMIdentity(static_cast<nsIDOMNode*>(this), focusedElement)) {
         // Now Select all the text!
         SelectAll(presContext);
       }
     }
   }
+
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 HTMLTextAreaElement::SelectAll(nsPresContext* aPresContext)
 {
   nsIFormControlFrame* formControlFrame = GetFormControlFrame(true);
 
   if (formControlFrame) {
@@ -188,38 +198,53 @@ HTMLTextAreaElement::IsHTMLFocusable(boo
     return true;
   }
 
   // disabled textareas are not focusable
   *aIsFocusable = !IsDisabled();
   return false;
 }
 
+NS_IMPL_BOOL_ATTR(HTMLTextAreaElement, Autofocus, autofocus)
+NS_IMPL_UINT_ATTR_NON_ZERO_DEFAULT_VALUE(HTMLTextAreaElement, Cols, cols, DEFAULT_COLS)
+NS_IMPL_BOOL_ATTR(HTMLTextAreaElement, Disabled, disabled)
+NS_IMPL_NON_NEGATIVE_INT_ATTR(HTMLTextAreaElement, MaxLength, maxlength)
+NS_IMPL_NON_NEGATIVE_INT_ATTR(HTMLTextAreaElement, MinLength, minlength)
+NS_IMPL_STRING_ATTR(HTMLTextAreaElement, Name, name)
+NS_IMPL_BOOL_ATTR(HTMLTextAreaElement, ReadOnly, readonly)
+NS_IMPL_BOOL_ATTR(HTMLTextAreaElement, Required, required)
+NS_IMPL_UINT_ATTR_NON_ZERO_DEFAULT_VALUE(HTMLTextAreaElement, Rows, rows, DEFAULT_ROWS_TEXTAREA)
+NS_IMPL_STRING_ATTR(HTMLTextAreaElement, Wrap, wrap)
+NS_IMPL_STRING_ATTR(HTMLTextAreaElement, Placeholder, placeholder)
+
 int32_t
 HTMLTextAreaElement::TabIndexDefault()
 {
   return 0;
 }
 
-void
+NS_IMETHODIMP
 HTMLTextAreaElement::GetType(nsAString& aType)
 {
   aType.AssignLiteral("textarea");
+
+  return NS_OK;
 }
 
-void
+NS_IMETHODIMP
 HTMLTextAreaElement::GetValue(nsAString& aValue)
 {
   nsAutoString value;
   GetValueInternal(value, true);
 
   // Normalize CRLF and CR to LF
   nsContentUtils::PlatformToDOMLineBreaks(value);
 
   aValue = value;
+  return NS_OK;
 }
 
 void
 HTMLTextAreaElement::GetValueInternal(nsAString& aValue, bool aIgnoreWrap) const
 {
   mState.GetValue(aValue, aIgnoreWrap);
 }
 
@@ -341,42 +366,41 @@ HTMLTextAreaElement::SetValueInternal(co
 
   if (!mState.SetValue(aValue, aFlags)) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   return NS_OK;
 }
 
-void
-HTMLTextAreaElement::SetValue(const nsAString& aValue, ErrorResult& aError)
+NS_IMETHODIMP
+HTMLTextAreaElement::SetValue(const nsAString& aValue)
 {
   // If the value has been set by a script, we basically want to keep the
   // current change event state. If the element is ready to fire a change
   // event, we should keep it that way. Otherwise, we should make sure the
   // element will not fire any event because of the script interaction.
   //
   // NOTE: this is currently quite expensive work (too much string
   // manipulation). We should probably optimize that.
   nsAutoString currentValue;
   GetValueInternal(currentValue, true);
 
   nsresult rv =
     SetValueInternal(aValue,
       nsTextEditorState::eSetValue_ByContent |
       nsTextEditorState::eSetValue_Notify |
       nsTextEditorState::eSetValue_MoveCursorToEndIfValueChanged);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    aError.Throw(rv);
-    return;
-  }
+  NS_ENSURE_SUCCESS(rv, rv);
 
   if (mFocusedValue.Equals(currentValue)) {
     GetValueInternal(mFocusedValue, true);
   }
+
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 HTMLTextAreaElement::SetUserInput(const nsAString& aValue)
 {
   return SetValueInternal(aValue,
     nsTextEditorState::eSetValue_BySetUserInput |
     nsTextEditorState::eSetValue_Notify|
@@ -395,22 +419,31 @@ HTMLTextAreaElement::SetValueChanged(boo
 
   if (mValueChanged != previousValue) {
     UpdateState(true);
   }
 
   return NS_OK;
 }
 
-void
-HTMLTextAreaElement::GetDefaultValue(nsAString& aDefaultValue, ErrorResult& aError)
+NS_IMETHODIMP
+HTMLTextAreaElement::GetDefaultValue(nsAString& aDefaultValue)
 {
   if (!nsContentUtils::GetNodeTextContent(this, false, aDefaultValue, fallible)) {
-    aError.Throw(NS_ERROR_OUT_OF_MEMORY);
+    return NS_ERROR_OUT_OF_MEMORY;
   }
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+HTMLTextAreaElement::SetDefaultValue(const nsAString& aDefaultValue)
+{
+  ErrorResult error;
+  SetDefaultValue(aDefaultValue, error);
+  return error.StealNSResult();
 }
 
 void
 HTMLTextAreaElement::SetDefaultValue(const nsAString& aDefaultValue, ErrorResult& aError)
 {
   nsresult rv = nsContentUtils::SetNodeTextContent(this, aDefaultValue, true);
   if (NS_SUCCEEDED(rv) && !mValueChanged) {
     Reset();
@@ -664,17 +697,17 @@ HTMLTextAreaElement::GetControllers(Erro
     }
 
     mControllers->AppendController(controller);
   }
 
   return mControllers;
 }
 
-nsresult
+NS_IMETHODIMP
 HTMLTextAreaElement::GetControllers(nsIControllers** aResult)
 {
   NS_ENSURE_ARG_POINTER(aResult);
 
   ErrorResult error;
   *aResult = GetControllers(error);
   NS_IF_ADDREF(*aResult);
 
@@ -684,16 +717,25 @@ HTMLTextAreaElement::GetControllers(nsIC
 uint32_t
 HTMLTextAreaElement::GetTextLength()
 {
   nsAutoString val;
   GetValue(val);
   return val.Length();
 }
 
+NS_IMETHODIMP
+HTMLTextAreaElement::GetTextLength(int32_t *aTextLength)
+{
+  NS_ENSURE_ARG_POINTER(aTextLength);
+  *aTextLength = GetTextLength();
+
+  return NS_OK;
+}
+
 Nullable<uint32_t>
 HTMLTextAreaElement::GetSelectionStart(ErrorResult& aError)
 {
   uint32_t selStart, selEnd;
   GetSelectionRange(&selStart, &selEnd, aError);
   return Nullable<uint32_t>(selStart);
 }
 
@@ -779,18 +821,17 @@ HTMLTextAreaElement::SetValueFromSetRang
                           nsTextEditorState::eSetValue_ByContent |
                           nsTextEditorState::eSetValue_Notify);
 }
 
 nsresult
 HTMLTextAreaElement::Reset()
 {
   nsAutoString resetVal;
-  IgnoredErrorResult res;
-  GetDefaultValue(resetVal, res);
+  GetDefaultValue(resetVal);
   SetValueChanged(false);
 
   nsresult rv = SetValueInternal(resetVal,
                                  nsTextEditorState::eSetValue_Internal);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return NS_OK;
 }
@@ -875,24 +916,22 @@ bool
 HTMLTextAreaElement::RestoreState(nsPresState* aState)
 {
   nsCOMPtr<nsISupportsString> state
     (do_QueryInterface(aState->GetStateProperty()));
 
   if (state) {
     nsAutoString data;
     state->GetData(data);
-    ErrorResult rv;
-    SetValue(data, rv);
-    ENSURE_SUCCESS(rv, false);
+    nsresult rv = SetValue(data);
+    NS_ENSURE_SUCCESS(rv, false);
   }
 
   if (aState->IsDisabledSet() && !aState->GetDisabled()) {
-    IgnoredErrorResult rv;
-    SetDisabled(false, rv);
+    SetDisabled(false);
   }
 
   return false;
 }
 
 EventStates
 HTMLTextAreaElement::IntrinsicState() const
 {
@@ -1076,19 +1115,17 @@ HTMLTextAreaElement::CopyInnerTo(Element
 {
   nsresult rv = nsGenericHTMLFormElementWithState::CopyInnerTo(aDest,
                                                                aPreallocateChildren);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (aDest->OwnerDoc()->IsStaticDocument()) {
     nsAutoString value;
     GetValueInternal(value, true);
-    ErrorResult ret;
-    static_cast<HTMLTextAreaElement*>(aDest)->SetValue(value, ret);
-    return ret.StealNSResult();
+    return static_cast<HTMLTextAreaElement*>(aDest)->SetValue(value);
   }
   return NS_OK;
 }
 
 bool
 HTMLTextAreaElement::IsMutable() const
 {
   return (!HasAttr(kNameSpaceID_None, nsGkAtoms::readonly) && !IsDisabled());
@@ -1115,45 +1152,49 @@ bool
 HTMLTextAreaElement::IsTooLong()
 {
   if (!mValueChanged ||
       !mLastValueChangeWasInteractive ||
       !HasAttr(kNameSpaceID_None, nsGkAtoms::maxlength)) {
     return false;
   }
 
-  int32_t maxLength = MaxLength();
+  int32_t maxLength = -1;
+  GetMaxLength(&maxLength);
 
   // Maxlength of -1 means parsing error.
   if (maxLength == -1) {
     return false;
   }
 
-  int32_t textLength = GetTextLength();
+  int32_t textLength = -1;
+  GetTextLength(&textLength);
 
   return textLength > maxLength;
 }
 
 bool
 HTMLTextAreaElement::IsTooShort()
 {
   if (!mValueChanged ||
       !mLastValueChangeWasInteractive ||
       !HasAttr(kNameSpaceID_None, nsGkAtoms::minlength)) {
     return false;
   }
 
-  int32_t minLength = MinLength();
+  int32_t minLength = -1;
+  GetMinLength(&minLength);
 
   // Minlength of -1 means parsing error.
   if (minLength == -1) {
     return false;
   }
 
-  int32_t textLength = GetTextLength();
+  int32_t textLength = -1;
+  GetTextLength(&textLength);
 
   return textLength && textLength < minLength;
 }
 
 bool
 HTMLTextAreaElement::IsValueMissing() const
 {
   if (!Required() || !IsMutable()) {
@@ -1195,39 +1236,45 @@ HTMLTextAreaElement::GetValidationMessag
 {
   nsresult rv = NS_OK;
 
   switch (aType)
   {
     case VALIDITY_STATE_TOO_LONG:
       {
         nsAutoString message;
-        int32_t maxLength = MaxLength();
-        int32_t textLength = GetTextLength();
+        int32_t maxLength = -1;
+        int32_t textLength = -1;
         nsAutoString strMaxLength;
         nsAutoString strTextLength;
 
+        GetMaxLength(&maxLength);
+        GetTextLength(&textLength);
+
         strMaxLength.AppendInt(maxLength);
         strTextLength.AppendInt(textLength);
 
         const char16_t* params[] = { strMaxLength.get(), strTextLength.get() };
         rv = nsContentUtils::FormatLocalizedString(nsContentUtils::eDOM_PROPERTIES,
                                                    "FormValidationTextTooLong",
                                                    params, message);
         aValidationMessage = message;
       }
       break;
     case VALIDITY_STATE_TOO_SHORT:
       {
         nsAutoString message;
-        int32_t minLength = MinLength();
-        int32_t textLength = GetTextLength();
+        int32_t minLength = -1;
+        int32_t textLength = -1;
         nsAutoString strMinLength;
         nsAutoString strTextLength;
 
+        GetMinLength(&minLength);
+        GetTextLength(&textLength);
+
         strMinLength.AppendInt(minLength);
         strTextLength.AppendInt(textLength);
 
         const char16_t* params[] = { strMinLength.get(), strTextLength.get() };
         rv = nsContentUtils::FormatLocalizedString(nsContentUtils::eDOM_PROPERTIES,
                                                    "FormValidationTextTooShort",
                                                    params, message);
         aValidationMessage = message;
@@ -1299,18 +1346,17 @@ HTMLTextAreaElement::GetRows()
   }
 
   return DEFAULT_ROWS_TEXTAREA;
 }
 
 NS_IMETHODIMP_(void)
 HTMLTextAreaElement::GetDefaultValueFromContent(nsAString& aValue)
 {
-  IgnoredErrorResult rv;
-  GetDefaultValue(aValue, rv);
+  GetDefaultValue(aValue);
 }
 
 NS_IMETHODIMP_(bool)
 HTMLTextAreaElement::ValueChanged() const
 {
   return mValueChanged;
 }
 
--- a/dom/html/HTMLTextAreaElement.h
+++ b/dom/html/HTMLTextAreaElement.h
@@ -3,16 +3,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_HTMLTextAreaElement_h
 #define mozilla_dom_HTMLTextAreaElement_h
 
 #include "mozilla/Attributes.h"
+#include "nsIDOMHTMLTextAreaElement.h"
 #include "nsITextControlElement.h"
 #include "nsIControllers.h"
 #include "nsIDOMNSEditableElement.h"
 #include "nsCOMPtr.h"
 #include "nsGenericHTMLElement.h"
 #include "nsStubMutationObserver.h"
 #include "nsIConstraintValidation.h"
 #include "mozilla/dom/HTMLFormElement.h"
@@ -33,40 +34,42 @@ class EventChainPostVisitor;
 class EventChainPreVisitor;
 class EventStates;
 
 namespace dom {
 
 class HTMLFormSubmission;
 
 class HTMLTextAreaElement final : public nsGenericHTMLFormElementWithState,
+                                  public nsIDOMHTMLTextAreaElement,
                                   public nsITextControlElement,
                                   public nsIDOMNSEditableElement,
                                   public nsStubMutationObserver,
                                   public nsIConstraintValidation
 {
 public:
   using nsIConstraintValidation::GetValidationMessage;
 
   explicit HTMLTextAreaElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
                                FromParser aFromParser = NOT_FROM_PARSER);
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
-  NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLTextAreaElement, textarea)
-
   virtual int32_t TabIndexDefault() override;
 
   // Element
   virtual bool IsInteractiveHTMLContent(bool aIgnoreTabindex) const override
   {
     return true;
   }
 
+  // nsIDOMHTMLTextAreaElement
+  NS_DECL_NSIDOMHTMLTEXTAREAELEMENT
+
   // nsIDOMNSEditableElement
   NS_IMETHOD GetEditor(nsIEditor** aEditor) override
   {
     nsCOMPtr<nsIEditor> editor = GetEditor();
     editor.forget(aEditor);
     return NS_OK;
   }
   NS_IMETHOD SetUserInput(const nsAString& aInput) override;
@@ -229,28 +232,22 @@ public:
   {
     int32_t maxLength = MaxLength();
     if (aMinLength < 0 || (maxLength >= 0 && aMinLength > maxLength)) {
       aError.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
     } else {
       SetHTMLIntAttr(nsGkAtoms::minlength, aMinLength, aError);
     }
   }
-  void GetName(nsAString& aName)
-  {
-    GetHTMLAttr(nsGkAtoms::name, aName);
-  }
+  // XPCOM GetName is fine
   void SetName(const nsAString& aName, ErrorResult& aError)
   {
     SetHTMLAttr(nsGkAtoms::name, aName, aError);
   }
-  void GetPlaceholder(nsAString& aPlaceholder)
-  {
-    GetHTMLAttr(nsGkAtoms::placeholder, aPlaceholder);
-  }
+  // XPCOM GetPlaceholder is fine
   void SetPlaceholder(const nsAString& aPlaceholder, ErrorResult& aError)
   {
     SetHTMLAttr(nsGkAtoms::placeholder, aPlaceholder, aError);
   }
   bool ReadOnly()
   {
     return GetBoolAttr(nsGkAtoms::readonly);
   }
@@ -277,48 +274,40 @@ public:
   {
     return GetIntAttr(nsGkAtoms::rows, DEFAULT_ROWS_TEXTAREA);
   }
   void SetRows(uint32_t aRows, ErrorResult& aError)
   {
     uint32_t rows = aRows ? aRows : DEFAULT_ROWS_TEXTAREA;
     SetUnsignedIntAttr(nsGkAtoms::rows, rows, DEFAULT_ROWS_TEXTAREA, aError);
   }
-  void GetWrap(nsAString& aWrap)
-  {
-    GetHTMLAttr(nsGkAtoms::wrap, aWrap);
-  }
+  // XPCOM GetWrap is fine
   void SetWrap(const nsAString& aWrap, ErrorResult& aError)
   {
     SetHTMLAttr(nsGkAtoms::wrap, aWrap, aError);
   }
-  void GetType(nsAString& aType);
-  void GetDefaultValue(nsAString& aDefaultValue, ErrorResult& aError);
+  // XPCOM GetType is fine
+  // XPCOM GetDefaultValue is fine
   void SetDefaultValue(const nsAString& aDefaultValue, ErrorResult& aError);
-  void GetValue(nsAString& aValue);
-  void SetValue(const nsAString& aValue, ErrorResult& aError);
-
+  // XPCOM GetValue/SetValue are fine
   uint32_t GetTextLength();
 
   // Override SetCustomValidity so we update our state properly when it's called
   // via bindings.
   void SetCustomValidity(const nsAString& aError);
 
-  void Select();
+  // XPCOM Select is fine
   Nullable<uint32_t> GetSelectionStart(ErrorResult& aError);
   void SetSelectionStart(const Nullable<uint32_t>& aSelectionStart, ErrorResult& aError);
   Nullable<uint32_t> GetSelectionEnd(ErrorResult& aError);
   void SetSelectionEnd(const Nullable<uint32_t>& aSelectionEnd, ErrorResult& aError);
   void GetSelectionDirection(nsAString& aDirection, ErrorResult& aError);
   void SetSelectionDirection(const nsAString& aDirection, ErrorResult& aError);
   void SetSelectionRange(uint32_t aSelectionStart, uint32_t aSelectionEnd, const Optional<nsAString>& aDirecton, ErrorResult& aError);
   nsIControllers* GetControllers(ErrorResult& aError);
-  // XPCOM adapter function widely used throughout code, leaving it as is.
-  nsresult GetControllers(nsIControllers** aResult);
-
   nsIEditor* GetEditor()
   {
     return mState.GetTextEditor();
   }
 
 protected:
   virtual ~HTMLTextAreaElement() {}
 
--- a/dom/html/nsTextEditorState.cpp
+++ b/dom/html/nsTextEditorState.cpp
@@ -14,16 +14,17 @@
 #include "nsLayoutCID.h"
 #include "nsITextControlFrame.h"
 #include "nsIDOMCharacterData.h"
 #include "nsIDOMDocument.h"
 #include "nsContentCreatorFunctions.h"
 #include "nsTextControlFrame.h"
 #include "nsIControllers.h"
 #include "nsIDOMHTMLInputElement.h"
+#include "nsIDOMHTMLTextAreaElement.h"
 #include "nsITransactionManager.h"
 #include "nsIControllerContext.h"
 #include "nsAttrValue.h"
 #include "nsAttrValueInlines.h"
 #include "nsGenericHTMLElement.h"
 #include "nsIDOMEventListener.h"
 #include "nsIEditorObserver.h"
 #include "nsIWidget.h"
@@ -37,17 +38,16 @@
 #include "nsContentUtils.h"
 #include "mozilla/Preferences.h"
 #include "nsTextNode.h"
 #include "nsIController.h"
 #include "mozilla/AutoRestore.h"
 #include "mozilla/TextEvents.h"
 #include "mozilla/dom/ScriptSettings.h"
 #include "mozilla/dom/HTMLInputElement.h"
-#include "mozilla/dom/HTMLTextAreaElement.h"
 #include "nsNumberControlFrame.h"
 #include "nsFrameSelection.h"
 #include "mozilla/ErrorResult.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/layers/ScrollInputMethods.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
@@ -963,18 +963,18 @@ DoCommandCallback(Command aCommand, void
   nsTextControlFrame *frame = static_cast<nsTextControlFrame*>(aData);
   nsIContent *content = frame->GetContent();
 
   nsCOMPtr<nsIControllers> controllers;
   nsCOMPtr<nsIDOMHTMLInputElement> input = do_QueryInterface(content);
   if (input) {
     input->GetControllers(getter_AddRefs(controllers));
   } else {
-    HTMLTextAreaElement* textArea =
-      HTMLTextAreaElement::FromContent(content);
+    nsCOMPtr<nsIDOMHTMLTextAreaElement> textArea =
+      do_QueryInterface(content);
 
     if (textArea) {
       textArea->GetControllers(getter_AddRefs(controllers));
     }
   }
 
   if (!controllers) {
     NS_WARNING("Could not get controllers");
@@ -1507,19 +1507,18 @@ nsTextEditorState::PrepareEditor(const n
 
   if (!SuppressEventHandlers(presContext)) {
     nsCOMPtr<nsIControllers> controllers;
     nsCOMPtr<nsIDOMHTMLInputElement> inputElement =
       do_QueryInterface(mTextCtrlElement);
     if (inputElement) {
       rv = inputElement->GetControllers(getter_AddRefs(controllers));
     } else {
-      nsCOMPtr<nsIContent> content = do_QueryInterface(mTextCtrlElement);
-      HTMLTextAreaElement* textAreaElement =
-        HTMLTextAreaElement::FromContentOrNull(content);
+      nsCOMPtr<nsIDOMHTMLTextAreaElement> textAreaElement =
+        do_QueryInterface(mTextCtrlElement);
 
       if (!textAreaElement)
         return NS_ERROR_FAILURE;
 
       rv = textAreaElement->GetControllers(getter_AddRefs(controllers));
     }
 
     NS_ENSURE_SUCCESS(rv, rv);
@@ -2172,19 +2171,18 @@ nsTextEditorState::UnbindFromFrame(nsTex
   {
     nsCOMPtr<nsIControllers> controllers;
     nsCOMPtr<nsIDOMHTMLInputElement> inputElement =
       do_QueryInterface(mTextCtrlElement);
     if (inputElement)
       inputElement->GetControllers(getter_AddRefs(controllers));
     else
     {
-      nsCOMPtr<nsIContent> content = do_QueryInterface(mTextCtrlElement);
-      HTMLTextAreaElement* textAreaElement =
-        HTMLTextAreaElement::FromContentOrNull(content);
+      nsCOMPtr<nsIDOMHTMLTextAreaElement> textAreaElement =
+        do_QueryInterface(mTextCtrlElement);
       if (textAreaElement) {
         textAreaElement->GetControllers(getter_AddRefs(controllers));
       }
     }
 
     if (controllers)
     {
       uint32_t numControllers;
--- a/dom/interfaces/html/moz.build
+++ b/dom/interfaces/html/moz.build
@@ -16,16 +16,17 @@ XPIDL_SOURCES += [
     'nsIDOMHTMLHtmlElement.idl',
     'nsIDOMHTMLInputElement.idl',
     'nsIDOMHTMLMediaElement.idl',
     'nsIDOMHTMLOptionElement.idl',
     'nsIDOMHTMLOptionsCollection.idl',
     'nsIDOMHTMLScriptElement.idl',
     'nsIDOMHTMLSelectElement.idl',
     'nsIDOMHTMLSourceElement.idl',
+    'nsIDOMHTMLTextAreaElement.idl',
     'nsIDOMMozBrowserFrame.idl',
     'nsIDOMTimeRanges.idl',
     'nsIDOMValidityState.idl',
     'nsIMozBrowserFrame.idl',
 ]
 
 XPIDL_MODULE = 'dom_html'
 
new file mode 100644
--- /dev/null
+++ b/dom/interfaces/html/nsIDOMHTMLTextAreaElement.idl
@@ -0,0 +1,54 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "nsIDOMHTMLElement.idl"
+
+interface nsIControllers;
+interface nsIDOMValidityState;
+
+/**
+ * The nsIDOMHTMLTextAreaElement interface is the interface to a
+ * [X]HTML textarea element.
+ *
+ * This interface is trying to follow the DOM Level 2 HTML specification:
+ * http://www.w3.org/TR/DOM-Level-2-HTML/
+ *
+ * with changes from the work-in-progress WHATWG HTML specification:
+ * http://www.whatwg.org/specs/web-apps/current-work/
+ */
+
+[uuid(7a4aeb2e-fcf3-443e-b002-ca1c8ea322e9)]
+interface nsIDOMHTMLTextAreaElement : nsISupports
+{
+           attribute boolean               autofocus;
+           attribute unsigned long         cols;
+           attribute boolean               disabled;
+  readonly attribute nsIDOMHTMLFormElement form;
+           attribute long                  maxLength;
+           attribute long                  minLength;
+           attribute DOMString             name;
+           attribute DOMString             placeholder;
+           attribute boolean               readOnly;
+           attribute boolean               required;
+           attribute unsigned long         rows;
+  /**
+   * Reflects the wrap content attribute. Possible values are "soft", "hard" and
+   * "off". "soft" is the default.
+   */
+  [Null(Stringify)]
+           attribute DOMString             wrap;
+
+  readonly attribute DOMString             type;
+           attribute DOMString             defaultValue;
+           attribute DOMString             value;
+  readonly attribute long                  textLength;
+
+  void select();
+
+  // Mozilla extensions
+  // Please make sure to update the HTMLTextAreaElement Web IDL interface to
+  // mirror the list of Mozilla extensions here when changing it.
+  readonly attribute nsIControllers   controllers;
+};
--- a/dom/webbrowserpersist/WebBrowserPersistLocalDocument.cpp
+++ b/dom/webbrowserpersist/WebBrowserPersistLocalDocument.cpp
@@ -7,17 +7,16 @@
 #include "WebBrowserPersistDocumentParent.h"
 
 #include "mozilla/dom/HTMLAnchorElement.h"
 #include "mozilla/dom/HTMLAreaElement.h"
 #include "mozilla/dom/HTMLInputElement.h"
 #include "mozilla/dom/HTMLLinkElement.h"
 #include "mozilla/dom/HTMLObjectElement.h"
 #include "mozilla/dom/HTMLSharedElement.h"
-#include "mozilla/dom/HTMLTextAreaElement.h"
 #include "mozilla/dom/TabParent.h"
 #include "nsComponentManagerUtils.h"
 #include "nsContentUtils.h"
 #include "nsContentCID.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsFrameLoader.h"
 #include "nsIComponentRegistrar.h"
 #include "nsIContent.h"
@@ -27,16 +26,17 @@
 #include "nsIDOMHTMLBaseElement.h"
 #include "nsIDOMHTMLCollection.h"
 #include "nsIDOMHTMLDocument.h"
 #include "nsIDOMHTMLInputElement.h"
 #include "nsIDOMHTMLMediaElement.h"
 #include "nsIDOMHTMLOptionElement.h"
 #include "nsIDOMHTMLScriptElement.h"
 #include "nsIDOMHTMLSourceElement.h"
+#include "nsIDOMHTMLTextAreaElement.h"
 #include "nsIDOMMozNamedAttrMap.h"
 #include "nsIDOMNode.h"
 #include "nsIDOMNodeFilter.h"
 #include "nsIDOMNodeList.h"
 #include "nsIDOMProcessingInstruction.h"
 #include "nsIDOMTreeWalker.h"
 #include "nsIDOMWindowUtils.h"
 #include "nsIDocShell.h"
@@ -1148,17 +1148,17 @@ PersistNodeFixup::FixupNode(nsIDOMNode *
                     break;
                 default:
                     break;
             }
         }
         return rv;
     }
 
-    dom::HTMLTextAreaElement* nodeAsTextArea = dom::HTMLTextAreaElement::FromContent(content);
+    nsCOMPtr<nsIDOMHTMLTextAreaElement> nodeAsTextArea = do_QueryInterface(aNodeIn);
     if (nodeAsTextArea) {
         rv = GetNodeToFixup(aNodeIn, aNodeOut);
         if (NS_SUCCEEDED(rv) && *aNodeOut) {
             // Tell the document encoder to serialize the text child we create below
             *aSerializeCloneKids = true;
 
             nsAutoString valueStr;
             nodeAsTextArea->GetValue(valueStr);
--- a/dom/webidl/HTMLTextAreaElement.webidl
+++ b/dom/webidl/HTMLTextAreaElement.webidl
@@ -41,19 +41,19 @@ interface HTMLTextAreaElement : HTMLElem
            attribute boolean required;
   [CEReactions, SetterThrows, Pure]
            attribute unsigned long rows;
   [CEReactions, SetterThrows, Pure]
            attribute DOMString wrap;
 
   [Constant]
   readonly attribute DOMString type;
-  [CEReactions, Throws, Pure]
+  [CEReactions, SetterThrows, Pure]
            attribute DOMString defaultValue;
-  [CEReactions, SetterThrows, TreatNullAs=EmptyString] attribute DOMString value;
+  [CEReactions, TreatNullAs=EmptyString] attribute DOMString value;
   readonly attribute unsigned long textLength;
 
   readonly attribute boolean willValidate;
   readonly attribute ValidityState validity;
   [Throws]
   readonly attribute DOMString validationMessage;
   boolean checkValidity();
   boolean reportValidity();
@@ -73,17 +73,18 @@ interface HTMLTextAreaElement : HTMLElem
   [Throws]
   void setRangeText(DOMString replacement, unsigned long start,
     unsigned long end, optional SelectionMode selectionMode = "preserve");
   [Throws]
   void setSelectionRange(unsigned long start, unsigned long end, optional DOMString direction);
 };
 
 partial interface HTMLTextAreaElement {
-  // Chrome-only Mozilla extensions
+  // Mirrored chrome-only Mozilla extensions to nsIDOMHTMLTextAreaElement.
+  // Please make sure to update this list of nsIDOMHTMLTextAreaElement changes.
 
   [Throws, ChromeOnly]
   readonly attribute XULControllers controllers;
 };
 
 partial interface HTMLTextAreaElement {
   // Mirrored chrome-only nsIDOMNSEditableElement methods.  Please make sure
   // to update this list if nsIDOMNSEditableElement changes.
--- a/dom/xbl/nsXBLPrototypeHandler.cpp
+++ b/dom/xbl/nsXBLPrototypeHandler.cpp
@@ -18,16 +18,17 @@
 #include "nsIDOMKeyEvent.h"
 #include "nsIDOMMouseEvent.h"
 #include "nsNameSpaceManager.h"
 #include "nsIDocument.h"
 #include "nsIController.h"
 #include "nsIControllers.h"
 #include "nsXULElement.h"
 #include "nsIURI.h"
+#include "nsIDOMHTMLTextAreaElement.h"
 #include "nsIDOMHTMLInputElement.h"
 #include "nsFocusManager.h"
 #include "nsIFormControl.h"
 #include "nsIDOMEventListener.h"
 #include "nsPIDOMWindow.h"
 #include "nsPIWindowRoot.h"
 #include "nsIDOMWindow.h"
 #include "nsIServiceManager.h"
@@ -44,17 +45,16 @@
 #include "nsXBLSerialize.h"
 #include "nsJSUtils.h"
 #include "mozilla/BasicEvents.h"
 #include "mozilla/JSEventHandler.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/TextEvents.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/EventHandlerBinding.h"
-#include "mozilla/dom/HTMLTextAreaElement.h"
 #include "mozilla/dom/ScriptSettings.h"
 #include "mozilla/layers/KeyboardMap.h"
 #include "xpcpublic.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 using namespace mozilla::layers;
 
@@ -676,17 +676,17 @@ nsXBLPrototypeHandler::GetController(Eve
   RefPtr<nsXULElement> xulElement =
     nsXULElement::FromContentOrNull(targetContent);
   if (xulElement) {
     IgnoredErrorResult rv;
     controllers = xulElement->GetControllers(rv);
   }
 
   if (!controllers) {
-    HTMLTextAreaElement* htmlTextArea = HTMLTextAreaElement::FromContent(targetContent);
+    nsCOMPtr<nsIDOMHTMLTextAreaElement> htmlTextArea(do_QueryInterface(aTarget));
     if (htmlTextArea)
       htmlTextArea->GetControllers(getter_AddRefs(controllers));
   }
 
   if (!controllers) {
     nsCOMPtr<nsIDOMHTMLInputElement> htmlInputElement(do_QueryInterface(aTarget));
     if (htmlInputElement)
       htmlInputElement->GetControllers(getter_AddRefs(controllers));
--- a/layout/forms/nsTextControlFrame.cpp
+++ b/layout/forms/nsTextControlFrame.cpp
@@ -11,16 +11,17 @@
 #include "nsFontMetrics.h"
 #include "nsTextControlFrame.h"
 #include "nsIPlaintextEditor.h"
 #include "nsCaret.h"
 #include "nsCSSPseudoElements.h"
 #include "nsGenericHTMLElement.h"
 #include "nsIEditor.h"
 #include "nsTextFragment.h"
+#include "nsIDOMHTMLTextAreaElement.h"
 #include "nsNameSpaceManager.h"
 #include "nsCheckboxRadioFrame.h" //for registering accesskeys
 
 #include "nsIContent.h"
 #include "nsPresContext.h"
 #include "nsGkAtoms.h"
 #include "nsLayoutUtils.h"
 #include "nsIDOMElement.h"
@@ -1156,30 +1157,32 @@ nsTextControlFrame::AttributeChanged(int
   }
 
   // Allow the base class to handle common attributes supported by all form
   // elements...
   return nsContainerFrame::AttributeChanged(aNameSpaceID, aAttribute, aModType);
 }
 
 
-void
+nsresult
 nsTextControlFrame::GetText(nsString& aText)
 {
+  nsresult rv = NS_OK;
   nsCOMPtr<nsITextControlElement> txtCtrl = do_QueryInterface(GetContent());
   NS_ASSERTION(txtCtrl, "Content not a text control element");
   if (IsSingleLineTextControl()) {
     // There will be no line breaks so we can ignore the wrap property.
     txtCtrl->GetTextEditorValue(aText, true);
   } else {
-    HTMLTextAreaElement* textArea = HTMLTextAreaElement::FromContent(mContent);
+    nsCOMPtr<nsIDOMHTMLTextAreaElement> textArea = do_QueryInterface(mContent);
     if (textArea) {
-      textArea->GetValue(aText);
+      rv = textArea->GetValue(aText);
     }
   }
+  return rv;
 }
 
 
 ///END NSIFRAME OVERLOADS
 /////BEGIN PROTECTED METHODS
 
 bool
 nsTextControlFrame::GetMaxLength(int32_t* aSize)
--- a/layout/forms/nsTextControlFrame.h
+++ b/layout/forms/nsTextControlFrame.h
@@ -164,17 +164,17 @@ public:
 
 //==== OVERLOAD of nsIFrame
 
   /** handler for attribute changes to mContent */
   virtual nsresult AttributeChanged(int32_t         aNameSpaceID,
                                     nsAtom*        aAttribute,
                                     int32_t         aModType) override;
 
-  void GetText(nsString& aText);
+  nsresult GetText(nsString& aText);
 
   virtual nsresult PeekOffset(nsPeekOffsetStruct *aPos) override;
 
   NS_DECL_QUERYFRAME
 
 protected:
   /**
    * Launch the reflow on the child frames - see nsTextControlFrame::Reflow()
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -21,30 +21,30 @@
 #include "nsNameSpaceManager.h"
 #include "nsIDocumentInlines.h"
 #include "nsFontMetrics.h"
 #include "nsBoxLayoutState.h"
 #include "mozilla/dom/NodeInfo.h"
 #include "nsScrollbarFrame.h"
 #include "nsIScrollbarMediator.h"
 #include "nsITextControlFrame.h"
+#include "nsIDOMHTMLTextAreaElement.h"
 #include "nsNodeInfoManager.h"
 #include "nsContentCreatorFunctions.h"
 #include "nsPresState.h"
 #include "nsIHTMLDocument.h"
 #include "nsContentUtils.h"
 #include "nsLayoutUtils.h"
 #include "nsBidiPresUtils.h"
 #include "nsBidiUtils.h"
 #include "mozilla/ContentEvents.h"
 #include "mozilla/EventDispatcher.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/LookAndFeel.h"
 #include "mozilla/dom/Element.h"
-#include "mozilla/dom/HTMLTextAreaElement.h"
 #include <stdint.h>
 #include "mozilla/MathAlgorithms.h"
 #include "mozilla/Telemetry.h"
 #include "FrameLayerBuilder.h"
 #include "nsSMILKeySpline.h"
 #include "nsSubDocumentFrame.h"
 #include "nsSVGOuterSVGFrame.h"
 #include "nsIObjectLoadingContent.h"
@@ -4497,18 +4497,17 @@ ScrollFrameHelper::CreateAnonymousConten
     canHaveHorizontal = true;
     canHaveVertical = true;
   }
 
   // The anonymous <div> used by <inputs> never gets scrollbars.
   nsITextControlFrame* textFrame = do_QueryFrame(parent);
   if (textFrame) {
     // Make sure we are not a text area.
-    HTMLTextAreaElement* textAreaElement =
-      HTMLTextAreaElement::FromContent(parent->GetContent());
+    nsCOMPtr<nsIDOMHTMLTextAreaElement> textAreaElement(do_QueryInterface(parent->GetContent()));
     if (!textAreaElement) {
       mNeverHasVerticalScrollbar = mNeverHasHorizontalScrollbar = true;
       return NS_OK;
     }
   }
 
   nsNodeInfoManager *nodeInfoManager =
     presContext->Document()->NodeInfoManager();
--- a/mobile/android/modules/ActionBarHandler.jsm
+++ b/mobile/android/modules/ActionBarHandler.jsm
@@ -203,17 +203,17 @@ var ActionBarHandler = {
     let [element, win] = [Services.focus.focusedElement, Services.focus.focusedWindow];
     if (!element) {
       // No focused editable.
       return [null, win];
     }
 
     // Return focused editable text element and its window.
     if (((element instanceof Ci.nsIDOMHTMLInputElement) && element.mozIsTextField(false)) ||
-        (ChromeUtils.getClassName(element) === "HTMLTextAreaElement") ||
+        (element instanceof Ci.nsIDOMHTMLTextAreaElement) ||
         element.isContentEditable) {
       return [element, win];
     }
 
     // Focused element can't contain text.
     return [null, win];
   },
 
@@ -738,17 +738,17 @@ var ActionBarHandler = {
     if (!this._selectionID) {
       return "";
     }
 
     let selection = this._getSelection();
 
     // Textarea can contain LF, etc.
     if (this._targetElement &&
-        ChromeUtils.getClassName(this._targetElement) === "HTMLTextAreaElement") {
+        this._targetElement instanceof Ci.nsIDOMHTMLTextAreaElement) {
       let flags = Ci.nsIDocumentEncoder.OutputPreformatted |
         Ci.nsIDocumentEncoder.OutputRaw;
       return selection.QueryInterface(Ci.nsISelectionPrivate).
         toStringWithFormat("text/plain", flags, 0);
     }
 
     // Return explicitly selected text.
     return selection.toString();
--- a/mobile/android/tests/browser/robocop/testAccessibleCarets.js
+++ b/mobile/android/tests/browser/robocop/testAccessibleCarets.js
@@ -41,17 +41,17 @@ function do_promiseTabChangeEvent(tabId,
 }
 
 /**
  * Selection methods vary if we have an input / textarea element,
  * or if we have basic content.
  */
 function isInputOrTextarea(element) {
   return ((element instanceof Ci.nsIDOMHTMLInputElement) ||
-          (ChromeUtils.getClassName(element) === "HTMLTextAreaElement"));
+          (element instanceof Ci.nsIDOMHTMLTextAreaElement));
 }
 
 /**
  * Return the selection controller based on element.
  */
 function elementSelection(element) {
   return (isInputOrTextarea(element)) ?
     element.editor.selection :
--- a/toolkit/modules/BrowserUtils.jsm
+++ b/toolkit/modules/BrowserUtils.jsm
@@ -495,17 +495,17 @@ this.BrowserUtils = {
     let collapsed = selection.isCollapsed;
 
     let url;
     let linkText;
 
     // try getting a selected text in text input.
     if (!selectionStr && focusedElement instanceof Ci.nsIDOMNSEditableElement) {
       // Don't get the selection for password fields. See bug 565717.
-      if (ChromeUtils.getClassName(focusedElement) === "HTMLTextAreaElement" ||
+      if (focusedElement instanceof Ci.nsIDOMHTMLTextAreaElement ||
           (focusedElement instanceof Ci.nsIDOMHTMLInputElement &&
            focusedElement.mozIsTextField(true))) {
         selectionStr = focusedElement.editor.selection.toString();
       }
     }
 
     if (selectionStr) {
       // Have some text, let's figure out if it looks like a URL that isn't
--- a/toolkit/modules/sessionstore/FormData.jsm
+++ b/toolkit/modules/sessionstore/FormData.jsm
@@ -202,17 +202,17 @@ var FormDataInternal = {
 
       // We do not want to collect credit card numbers.
       if (node instanceof Ci.nsIDOMHTMLInputElement &&
           isValidCCNumber(node.value)) {
         continue;
       }
 
       if (node instanceof Ci.nsIDOMHTMLInputElement ||
-          ChromeUtils.getClassName(node) === "HTMLTextAreaElement" ||
+          node instanceof Ci.nsIDOMHTMLTextAreaElement ||
           node instanceof Ci.nsIDOMXULTextBoxElement) {
         switch (node.type) {
           case "checkbox":
           case "radio":
             value = node.checked;
             hasDefaultValue = value == node.defaultChecked;
             break;
           case "file":
--- a/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp
+++ b/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp
@@ -53,16 +53,17 @@
 #include "nsIDOMHTMLHtmlElement.h"
 #include "nsIDOMHTMLInputElement.h"
 #include "nsIDOMHTMLMediaElement.h"
 #include "nsIDOMHTMLOptionElement.h"
 #include "nsIDOMHTMLOptionsCollection.h"
 #include "nsIDOMHTMLScriptElement.h"
 #include "nsIDOMHTMLSelectElement.h"
 #include "nsIDOMHTMLSourceElement.h"
+#include "nsIDOMHTMLTextAreaElement.h"
 #include "nsIDOMKeyEvent.h"
 #include "nsIDOMMediaList.h"
 #include "nsIDOMMouseEvent.h"
 #include "nsIDOMMouseScrollEvent.h"
 #include "nsIDOMMutationEvent.h"
 #include "nsIDOMMozNamedAttrMap.h"
 #include "nsIDOMNode.h"
 #include "nsIDOMNodeIterator.h"
@@ -157,16 +158,17 @@
 #include "mozilla/dom/HTMLInputElementBinding.h"
 #include "mozilla/dom/HTMLMediaElementBinding.h"
 #include "mozilla/dom/HTMLObjectElementBinding.h"
 #include "mozilla/dom/HTMLOptionElementBinding.h"
 #include "mozilla/dom/HTMLOptionsCollectionBinding.h"
 #include "mozilla/dom/HTMLScriptElementBinding.h"
 #include "mozilla/dom/HTMLSelectElementBinding.h"
 #include "mozilla/dom/HTMLSourceElementBinding.h"
+#include "mozilla/dom/HTMLTextAreaElementBinding.h"
 #include "mozilla/dom/KeyEventBinding.h"
 #include "mozilla/dom/ListBoxObjectBinding.h"
 #include "mozilla/dom/MediaListBinding.h"
 #include "mozilla/dom/MessageEventBinding.h"
 #include "mozilla/dom/MenuBoxObjectBinding.h"
 #include "mozilla/dom/MouseEventBinding.h"
 #include "mozilla/dom/MouseScrollEventBinding.h"
 #include "mozilla/dom/MutationEventBinding.h"
@@ -312,16 +314,17 @@ const ComponentsInterfaceShimEntry kComp
   DEFINE_SHIM(HTMLHtmlElement),
   DEFINE_SHIM(HTMLInputElement),
   DEFINE_SHIM(HTMLMediaElement),
   DEFINE_SHIM(HTMLOptionElement),
   DEFINE_SHIM(HTMLOptionsCollection),
   DEFINE_SHIM(HTMLScriptElement),
   DEFINE_SHIM(HTMLSelectElement),
   DEFINE_SHIM(HTMLSourceElement),
+  DEFINE_SHIM(HTMLTextAreaElement),
   DEFINE_SHIM(KeyEvent),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIListBoxObject, ListBoxObject),
   DEFINE_SHIM(MediaList),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIMenuBoxObject, MenuBoxObject),
   DEFINE_SHIM(MouseEvent),
   DEFINE_SHIM(MouseScrollEvent),
   DEFINE_SHIM(MutationEvent),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMMozNamedAttrMap, NamedNodeMap),