Bug 825196 - Rename nsHTMLInputElement to HTMLInputElement. r=Ms2ger
authorAndrea Marchesini <amarchesini@mozilla.com>
Thu, 28 Mar 2013 15:41:32 -0400
changeset 126599 3ffdb788846d95ce1a822213336c6462e6b28443
parent 126598 11994f2d5c7e4321a22646e69e37f433e022d1ba
child 126600 23850987c825d2e48be20e0e5f7bac22357af1f9
push id24488
push userryanvm@gmail.com
push dateFri, 29 Mar 2013 00:54:52 +0000
treeherdermozilla-central@8aeabe064932 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMs2ger
bugs825196
milestone22.0a1
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
Bug 825196 - Rename nsHTMLInputElement to HTMLInputElement. r=Ms2ger
accessible/src/generic/RootAccessible.cpp
accessible/src/html/HTMLFormControlAccessible.cpp
content/base/public/nsIContent.h
content/base/public/nsINode.h
content/html/content/src/HTMLInputElement.cpp
content/html/content/src/HTMLInputElement.h
content/html/content/src/HTMLLabelElement.cpp
content/html/content/src/HTMLTextAreaElement.cpp
content/html/content/src/Makefile.in
content/html/content/src/nsHTMLFormElement.cpp
content/html/content/src/nsHTMLInputElement.cpp
content/html/content/src/nsHTMLInputElement.h
content/html/content/src/nsRadioVisitor.cpp
content/html/content/src/nsTextEditorState.h
content/html/content/test/forms/test_experimental_forms_pref.html
content/smil/nsSMILAnimationFunction.h
dom/identity/nsDOMIdentity.js
layout/build/nsLayoutStatics.cpp
layout/forms/nsFileControlFrame.cpp
layout/forms/nsImageControlFrame.cpp
layout/forms/nsRangeFrame.cpp
--- a/accessible/src/generic/RootAccessible.cpp
+++ b/accessible/src/generic/RootAccessible.cpp
@@ -160,19 +160,19 @@ const char* const kEventTypes[] = {
   "select",
   // Fired when value changes immediately, wether or not focused changed.
   "ValueChange",
   "AlertActive",
   "TreeRowCountChanged",
   "TreeInvalidated",
   // add ourself as a OpenStateChange listener (custom event fired in tree.xml)
   "OpenStateChange",
-  // add ourself as a CheckboxStateChange listener (custom event fired in nsHTMLInputElement.cpp)
+  // add ourself as a CheckboxStateChange listener (custom event fired in HTMLInputElement.cpp)
   "CheckboxStateChange",
-  // add ourself as a RadioStateChange Listener ( custom event fired in in nsHTMLInputElement.cpp  & radio.xml)
+  // add ourself as a RadioStateChange Listener ( custom event fired in in HTMLInputElement.cpp  & radio.xml)
   "RadioStateChange",
   "popupshown",
   "popuphiding",
   "DOMMenuInactive",
   "DOMMenuItemActive",
   "DOMMenuItemInactive",
   "DOMMenuBarActive",
   "DOMMenuBarInactive"
--- a/accessible/src/html/HTMLFormControlAccessible.cpp
+++ b/accessible/src/html/HTMLFormControlAccessible.cpp
@@ -10,33 +10,34 @@
 #include "nsARIAMap.h"
 #include "nsEventShell.h"
 #include "nsTextEquivUtils.h"
 #include "Relation.h"
 #include "Role.h"
 #include "States.h"
 
 #include "nsContentList.h"
-#include "nsHTMLInputElement.h"
+#include "mozilla/dom/HTMLInputElement.h"
 #include "nsIAccessibleRelation.h"
 #include "nsIDOMNSEditableElement.h"
 #include "nsIDOMHTMLTextAreaElement.h"
 #include "nsIEditor.h"
 #include "nsIFormControl.h"
 #include "nsIFrame.h"
 #include "nsINameSpaceManager.h"
 #include "nsISelectionController.h"
 #include "jsapi.h"
 #include "nsIJSContextStack.h"
 #include "nsIServiceManager.h"
 #include "nsITextControlFrame.h"
 
 #include "mozilla/Preferences.h"
 
 using namespace mozilla;
+using namespace mozilla::dom;
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLCheckboxAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 HTMLCheckboxAccessible::
   HTMLCheckboxAccessible(nsIContent* aContent, DocAccessible* aDoc) :
@@ -86,17 +87,17 @@ HTMLCheckboxAccessible::DoAction(uint8_t
 }
 
 uint64_t
 HTMLCheckboxAccessible::NativeState()
 {
   uint64_t state = LeafAccessible::NativeState();
 
   state |= states::CHECKABLE;
-  nsHTMLInputElement* input = nsHTMLInputElement::FromContent(mContent);
+  HTMLInputElement* input = HTMLInputElement::FromContent(mContent);
   if (!input)
     return state;
 
   if (input->Indeterminate())
     return state | states::MIXED;
 
   if (input->Checked())
     return state | states::CHECKED;
@@ -126,17 +127,17 @@ HTMLRadioButtonAccessible::
 
 uint64_t
 HTMLRadioButtonAccessible::NativeState()
 {
   uint64_t state = AccessibleWrap::NativeState();
 
   state |= states::CHECKABLE;
 
-  nsHTMLInputElement* input = nsHTMLInputElement::FromContent(mContent);
+  HTMLInputElement* input = HTMLInputElement::FromContent(mContent);
   if (input && input->Checked())
     state |= states::CHECKED;
 
   return state;
 }
 
 void
 HTMLRadioButtonAccessible::GetPositionAndSizeInternal(int32_t* aPosInSet,
@@ -351,17 +352,17 @@ HTMLTextFieldAccessible::Value(nsString&
     return;
 
   nsCOMPtr<nsIDOMHTMLTextAreaElement> textArea(do_QueryInterface(mContent));
   if (textArea) {
     textArea->GetValue(aValue);
     return;
   }
 
-  nsHTMLInputElement* input = nsHTMLInputElement::FromContent(mContent);
+  HTMLInputElement* input = HTMLInputElement::FromContent(mContent);
   if (input)
     input->GetValue(aValue);
 }
 
 void
 HTMLTextFieldAccessible::ApplyARIAState(uint64_t* aState) const
 {
   HyperTextAccessibleWrap::ApplyARIAState(aState);
@@ -380,17 +381,17 @@ HTMLTextFieldAccessible::NativeState()
     state |= states::PROTECTED;
   }
 
   if (mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::readonly)) {
     state |= states::READONLY;
   }
 
   // Is it an <input> or a <textarea> ?
-  nsHTMLInputElement* input = nsHTMLInputElement::FromContent(mContent);
+  HTMLInputElement* input = HTMLInputElement::FromContent(mContent);
   state |= input && input->IsSingleLineTextControl() ?
     states::SINGLE_LINE : states::MULTI_LINE;
 
   if (!(state & states::EDITABLE) ||
       (state & (states::PROTECTED | states::MULTI_LINE)))
     return state;
 
   // Expose autocomplete states if this input is part of autocomplete widget.
@@ -446,17 +447,17 @@ HTMLTextFieldAccessible::GetActionName(u
   }
   return NS_ERROR_INVALID_ARG;
 }
 
 NS_IMETHODIMP
 HTMLTextFieldAccessible::DoAction(uint8_t aIndex)
 {
   if (aIndex == 0) {
-    nsHTMLInputElement* element = nsHTMLInputElement::FromContent(mContent);
+    HTMLInputElement* element = HTMLInputElement::FromContent(mContent);
     if (element)
       return element->Focus();
 
     return NS_ERROR_FAILURE;
   }
   return NS_ERROR_INVALID_ARG;
 }
 
--- a/content/base/public/nsIContent.h
+++ b/content/base/public/nsIContent.h
@@ -668,17 +668,17 @@ public:
    *
    * NOTE: this is currently only called for input and button, in the HTML
    * content sink.  If you want to call it on your element, modify the content
    * sink of your choice to do so.  This is an efficiency measure.
    *
    * If you also need to determine whether the parser is the one creating your
    * element (through createElement() or cloneNode() generally) then add a
    * uint32_t aFromParser to the NS_NewXXX() constructor for your element and
-   * have the parser pass the appropriate flags. See nsHTMLInputElement.cpp and
+   * have the parser pass the appropriate flags. See HTMLInputElement.cpp and
    * nsHTMLContentSink::MakeContentObject().
    *
    * DO NOT USE THIS METHOD to get around the fact that it's hard to deal with
    * attributes dynamically.  If you make attributes affect your element from
    * this method, it will only happen on initialization and JavaScript will not
    * be able to create elements (which requires them to first create the
    * element and then call setAttribute() directly, at which point
    * DoneCreatingElement() has already been called and is out of the picture).
@@ -704,17 +704,17 @@ public:
    * NOTE: this is currently only called for textarea, select, applet, and
    * object elements in the HTML content sink.  If you want
    * to call it on your element, modify the content sink of your
    * choice to do so.  This is an efficiency measure.
    *
    * If you also need to determine whether the parser is the one creating your
    * element (through createElement() or cloneNode() generally) then add a
    * boolean aFromParser to the NS_NewXXX() constructor for your element and
-   * have the parser pass true.  See nsHTMLInputElement.cpp and
+   * have the parser pass true.  See HTMLInputElement.cpp and
    * nsHTMLContentSink::MakeContentObject().
    *
    * @param aHaveNotified Whether there has been a
    *        ContentInserted/ContentAppended notification for this content node
    *        yet.
    */
   virtual void DoneAddingChildren(bool aHaveNotified)
   {
--- a/content/base/public/nsINode.h
+++ b/content/base/public/nsINode.h
@@ -277,17 +277,17 @@ public:
   // worthwhile:
   // - nsGenericHTMLElement:  mForm, mFieldSet
   // - nsGenericHTMLFrameElement: mFrameLoader (bug 672539), mTitleChangedListener
   // - HTMLBodyElement:       mContentStyleRule
   // - HTMLDataListElement:   mOptions
   // - HTMLFieldSetElement:   mElements, mDependentElements, mFirstLegend
   // - nsHTMLFormElement:     many!
   // - HTMLFrameSetElement:   mRowSpecs, mColSpecs
-  // - nsHTMLInputElement:    mInputData, mFiles, mFileList, mStaticDocfileList
+  // - HTMLInputElement:      mInputData, mFiles, mFileList, mStaticDocfileList
   // - nsHTMLMapElement:      mAreas
   // - HTMLMediaElement:      many!
   // - nsHTMLOutputElement:   mDefaultValue, mTokenList
   // - nsHTMLRowElement:      mCells
   // - nsHTMLSelectElement:   mOptions, mRestoreState
   // - nsHTMLTableElement:    mTBodies, mRows, mTableInheritedAttributes
   // - nsHTMLTableSectionElement: mRows
   // - nsHTMLTextAreaElement: mControllers, mState
rename from content/html/content/src/nsHTMLInputElement.cpp
rename to content/html/content/src/HTMLInputElement.cpp
--- a/content/html/content/src/nsHTMLInputElement.cpp
+++ b/content/html/content/src/HTMLInputElement.cpp
@@ -1,16 +1,16 @@
 /* -*- Mode: C++; 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 "mozilla/DebugOnly.h"
 
-#include "nsHTMLInputElement.h"
+#include "mozilla/dom/HTMLInputElement.h"
 #include "nsAttrValueInlines.h"
 
 #include "nsIDOMHTMLInputElement.h"
 #include "nsITextControlElement.h"
 #include "nsIDOMNSEditableElement.h"
 #include "nsIRadioVisitor.h"
 #include "nsIPhonetic.h"
 
@@ -93,36 +93,39 @@
 
 #include "nsIIDNService.h"
 
 #include <limits>
 
 // input type=date
 #include "jsapi.h"
 
-using namespace mozilla;
-using namespace mozilla::dom;
+NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(Input)
+DOMCI_NODE_DATA(HTMLInputElement, mozilla::dom::HTMLInputElement)
 
 // XXX align=left, hspace, vspace, border? other nav4 attrs
 
 static NS_DEFINE_CID(kXULControllersCID,  NS_XULCONTROLLERS_CID);
 
+namespace mozilla {
+namespace dom {
+
 // First bits are needed for the control type.
 #define NS_OUTER_ACTIVATE_EVENT   (1 << 9)
 #define NS_ORIGINAL_CHECKED_VALUE (1 << 10)
 #define NS_NO_CONTENT_DISPATCH    (1 << 11)
 #define NS_ORIGINAL_INDETERMINATE_VALUE (1 << 12)
 #define NS_CONTROL_TYPE(bits)  ((bits) & ~( \
   NS_OUTER_ACTIVATE_EVENT | NS_ORIGINAL_CHECKED_VALUE | NS_NO_CONTENT_DISPATCH | \
   NS_ORIGINAL_INDETERMINATE_VALUE))
 
 // whether textfields should be selected once focused:
 //  -1: no, 1: yes, 0: uninitialized
 static int32_t gSelectTextFieldOnFocus;
-UploadLastDir* nsHTMLInputElement::gUploadLastDir;
+UploadLastDir* HTMLInputElement::gUploadLastDir;
 
 static const nsAttrValue::EnumTable kInputTypeTable[] = {
   { "button", NS_FORM_INPUT_BUTTON },
   { "checkbox", NS_FORM_INPUT_CHECKBOX },
   { "date", NS_FORM_INPUT_DATE },
   { "email", NS_FORM_INPUT_EMAIL },
   { "file", NS_FORM_INPUT_FILE },
   { "hidden", NS_FORM_INPUT_HIDDEN },
@@ -175,33 +178,33 @@ static const nsAttrValue::EnumTable kInp
   { "titlecase", NS_INPUT_INPUTMODE_TITLECASE },
   { "autocapitalized", NS_INPUT_INPUTMODE_AUTOCAPITALIZED },
   { 0 }
 };
 
 // Default inputmode value is "auto".
 static const nsAttrValue::EnumTable* kInputDefaultInputmode = &kInputInputmodeTable[0];
 
-const double nsHTMLInputElement::kStepScaleFactorDate = 86400000;
-const double nsHTMLInputElement::kStepScaleFactorNumberRange = 1;
-const double nsHTMLInputElement::kStepScaleFactorTime = 1000;
-const double nsHTMLInputElement::kDefaultStepBase = 0;
-const double nsHTMLInputElement::kDefaultStep = 1;
-const double nsHTMLInputElement::kDefaultStepTime = 60;
-const double nsHTMLInputElement::kStepAny = 0;
+const double HTMLInputElement::kStepScaleFactorDate = 86400000;
+const double HTMLInputElement::kStepScaleFactorNumberRange = 1;
+const double HTMLInputElement::kStepScaleFactorTime = 1000;
+const double HTMLInputElement::kDefaultStepBase = 0;
+const double HTMLInputElement::kDefaultStep = 1;
+const double HTMLInputElement::kDefaultStepTime = 60;
+const double HTMLInputElement::kStepAny = 0;
 
 #define NS_INPUT_ELEMENT_STATE_IID                 \
 { /* dc3b3d14-23e2-4479-b513-7b369343e3a0 */       \
   0xdc3b3d14,                                      \
   0x23e2,                                          \
   0x4479,                                          \
   {0xb5, 0x13, 0x7b, 0x36, 0x93, 0x43, 0xe3, 0xa0} \
 }
 
-class nsHTMLInputElementState MOZ_FINAL : public nsISupports
+class HTMLInputElementState MOZ_FINAL : public nsISupports
 {
   public:
     NS_DECLARE_STATIC_IID_ACCESSOR(NS_INPUT_ELEMENT_STATE_IID)
     NS_DECL_ISUPPORTS
 
     bool IsCheckedSet() {
       return mCheckedSet;
     }
@@ -227,42 +230,42 @@ class nsHTMLInputElementState MOZ_FINAL 
       return mFiles;
     }
 
     void SetFiles(const nsCOMArray<nsIDOMFile> &aFiles) {
       mFiles.Clear();
       mFiles.AppendObjects(aFiles);
     }
 
-    nsHTMLInputElementState()
+    HTMLInputElementState()
       : mValue()
       , mChecked(false)
       , mCheckedSet(false)
     {};
  
   protected:
     nsString mValue;
     nsCOMArray<nsIDOMFile> mFiles;
     bool mChecked;
     bool mCheckedSet;
 };
 
-NS_IMPL_ISUPPORTS1(nsHTMLInputElementState, nsHTMLInputElementState)
-NS_DEFINE_STATIC_IID_ACCESSOR(nsHTMLInputElementState, NS_INPUT_ELEMENT_STATE_IID)
-
-nsHTMLInputElement::nsFilePickerShownCallback::nsFilePickerShownCallback(
-  nsHTMLInputElement* aInput, nsIFilePicker* aFilePicker, bool aMulti)
+NS_IMPL_ISUPPORTS1(HTMLInputElementState, HTMLInputElementState)
+NS_DEFINE_STATIC_IID_ACCESSOR(HTMLInputElementState, NS_INPUT_ELEMENT_STATE_IID)
+
+HTMLInputElement::nsFilePickerShownCallback::nsFilePickerShownCallback(
+  HTMLInputElement* aInput, nsIFilePicker* aFilePicker, bool aMulti)
   : mFilePicker(aFilePicker)
   , mInput(aInput)
   , mMulti(aMulti)
 {
 }
 
 NS_IMETHODIMP
-nsHTMLInputElement::nsFilePickerShownCallback::Done(int16_t aResult)
+HTMLInputElement::nsFilePickerShownCallback::Done(int16_t aResult)
 {
   if (aResult == nsIFilePicker::returnCancel) {
     return NS_OK;
   }
 
   // Collect new selected filenames
   nsCOMArray<nsIDOMFile> newFiles;
   if (mMulti) {
@@ -278,31 +281,31 @@ nsHTMLInputElement::nsFilePickerShownCal
       iter->GetNext(getter_AddRefs(tmp));
       nsCOMPtr<nsIDOMFile> domFile = do_QueryInterface(tmp);
       MOZ_ASSERT(domFile);
 
       newFiles.AppendObject(domFile);
 
       if (!prefSaved) {
         // Store the last used directory using the content pref service
-        nsHTMLInputElement::gUploadLastDir->StoreLastUsedDirectory(
+        HTMLInputElement::gUploadLastDir->StoreLastUsedDirectory(
           mInput->OwnerDoc(), domFile);
         prefSaved = true;
       }
     }
   }
   else {
     nsCOMPtr<nsIDOMFile> domFile;
     nsresult rv = mFilePicker->GetDomfile(getter_AddRefs(domFile));
     NS_ENSURE_SUCCESS(rv, rv);
     if (domFile) {
       newFiles.AppendObject(domFile);
 
       // Store the last used directory using the content pref service
-      nsHTMLInputElement::gUploadLastDir->StoreLastUsedDirectory(
+      HTMLInputElement::gUploadLastDir->StoreLastUsedDirectory(
         mInput->OwnerDoc(), domFile);
     }
   }
 
   if (!newFiles.Count()) {
     return NS_OK;
   }
 
@@ -311,30 +314,30 @@ nsHTMLInputElement::nsFilePickerShownCal
   // So, we can safely send one by ourself.
   mInput->SetFiles(newFiles, true);
   return nsContentUtils::DispatchTrustedEvent(mInput->OwnerDoc(),
                                               static_cast<nsIDOMHTMLInputElement*>(mInput.get()),
                                               NS_LITERAL_STRING("change"), true,
                                               false);
 }
 
-NS_IMPL_ISUPPORTS1(nsHTMLInputElement::nsFilePickerShownCallback,
+NS_IMPL_ISUPPORTS1(HTMLInputElement::nsFilePickerShownCallback,
                    nsIFilePickerShownCallback)
 
-nsHTMLInputElement::AsyncClickHandler::AsyncClickHandler(nsHTMLInputElement* aInput)
+HTMLInputElement::AsyncClickHandler::AsyncClickHandler(HTMLInputElement* aInput)
   : mInput(aInput)
 {
   nsPIDOMWindow* win = aInput->OwnerDoc()->GetWindow();
   if (win) {
     mPopupControlState = win->GetPopupControlState();
   }
 }
 
 NS_IMETHODIMP
-nsHTMLInputElement::AsyncClickHandler::Run()
+HTMLInputElement::AsyncClickHandler::Run()
 {
   // Get parent nsPIDOMWindow object.
   nsCOMPtr<nsIDocument> doc = mInput->OwnerDoc();
 
   nsPIDOMWindow* win = doc->GetWindow();
   if (!win) {
     return NS_ERROR_FAILURE;
   }
@@ -409,50 +412,50 @@ nsHTMLInputElement::AsyncClickHandler::R
       oldFiles[0]->GetName(leafName);
       if (!leafName.IsEmpty()) {
         filePicker->SetDefaultString(leafName);
       }
     }
   } else {
     // Attempt to retrieve the last used directory from the content pref service
     nsCOMPtr<nsIFile> localFile;
-    nsHTMLInputElement::gUploadLastDir->FetchLastUsedDirectory(doc,
-                                                               getter_AddRefs(localFile));
+    HTMLInputElement::gUploadLastDir->FetchLastUsedDirectory(doc,
+                                                             getter_AddRefs(localFile));
     if (!localFile) {
       // Default to "desktop" directory for each platform
       nsCOMPtr<nsIFile> homeDir;
       NS_GetSpecialDirectory(NS_OS_DESKTOP_DIR, getter_AddRefs(homeDir));
       localFile = do_QueryInterface(homeDir);
     }
     filePicker->SetDisplayDirectory(localFile);
   }
 
   nsCOMPtr<nsIFilePickerShownCallback> callback =
-    new nsHTMLInputElement::nsFilePickerShownCallback(mInput, filePicker, multi);
+    new HTMLInputElement::nsFilePickerShownCallback(mInput, filePicker, multi);
   return filePicker->Open(callback);
 }
 
 #define CPS_PREF_NAME NS_LITERAL_STRING("browser.upload.lastDir")
 
 NS_IMPL_ISUPPORTS2(UploadLastDir, nsIObserver, nsISupportsWeakReference)
 
 void
-nsHTMLInputElement::InitUploadLastDir() {
+HTMLInputElement::InitUploadLastDir() {
   gUploadLastDir = new UploadLastDir();
   NS_ADDREF(gUploadLastDir);
 
   nsCOMPtr<nsIObserverService> observerService =
     mozilla::services::GetObserverService();
   if (observerService && gUploadLastDir) {
     observerService->AddObserver(gUploadLastDir, "browser:purge-session-history", true);
   }
 }
 
 void 
-nsHTMLInputElement::DestroyUploadLastDir() {
+HTMLInputElement::DestroyUploadLastDir() {
   NS_IF_RELEASE(gUploadLastDir);
 }
 
 nsresult
 UploadLastDir::FetchLastUsedDirectory(nsIDocument* aDoc, nsIFile** aFile)
 {
   NS_PRECONDITION(aDoc, "aDoc is null");
   NS_PRECONDITION(aFile, "aFile is null");
@@ -559,20 +562,18 @@ static nsresult FireEventForAccessibilit
                                           nsPresContext* aPresContext,
                                           const nsAString& aEventType);
 #endif
 
 //
 // construction, destruction
 //
 
-NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(Input)
-
-nsHTMLInputElement::nsHTMLInputElement(already_AddRefed<nsINodeInfo> aNodeInfo,
-                                       FromParser aFromParser)
+HTMLInputElement::HTMLInputElement(already_AddRefed<nsINodeInfo> aNodeInfo,
+                                   FromParser aFromParser)
   : nsGenericHTMLFormElement(aNodeInfo)
   , mType(kInputDefaultType->value)
   , mDisabledChanged(false)
   , mValueChanged(false)
   , mCheckedChanged(false)
   , mChecked(false)
   , mHandlingSelectEvent(false)
   , mShouldInitChecked(false)
@@ -585,128 +586,125 @@ nsHTMLInputElement::nsHTMLInputElement(a
   , mCanShowInvalidUI(true)
   , mHasRange(false)
   , mIsDraggingRange(false)
 {
   // We are in a type=text so we now we currenty need a nsTextEditorState.
   mInputData.mState = new nsTextEditorState(this);
 
   if (!gUploadLastDir)
-    nsHTMLInputElement::InitUploadLastDir();
+    HTMLInputElement::InitUploadLastDir();
 
   // Set up our default state.  By default we're enabled (since we're
   // a control type that can be disabled but not actually disabled
   // right now), optional, and valid.  We are NOT readwrite by default
   // until someone calls UpdateEditableState on us, apparently!  Also
   // by default we don't have to show validity UI and so forth.
   AddStatesSilently(NS_EVENT_STATE_ENABLED |
                     NS_EVENT_STATE_OPTIONAL |
                     NS_EVENT_STATE_VALID);
 }
 
-nsHTMLInputElement::~nsHTMLInputElement()
+HTMLInputElement::~HTMLInputElement()
 {
   if (mFileList) {
     mFileList->Disconnect();
   }
   DestroyImageLoadingContent();
   FreeData();
 }
 
 void
-nsHTMLInputElement::FreeData()
+HTMLInputElement::FreeData()
 {
   if (!IsSingleLineTextControl(false)) {
     nsMemory::Free(mInputData.mValue);
     mInputData.mValue = nullptr;
   } else {
     UnbindFromFrame(nullptr);
     delete mInputData.mState;
     mInputData.mState = nullptr;
   }
 }
 
 nsTextEditorState*
-nsHTMLInputElement::GetEditorState() const
+HTMLInputElement::GetEditorState() const
 {
   if (!IsSingleLineTextControl(false)) {
     return nullptr;
   }
 
   MOZ_ASSERT(mInputData.mState, "Single line text controls need to have a state"
                                 " associated with them");
 
   return mInputData.mState;
 }
 
 
 // nsISupports
 
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsHTMLInputElement,
+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(HTMLInputElement,
                                                   nsGenericHTMLFormElement)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mValidity)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mControllers)
   if (tmp->IsSingleLineTextControl(false)) {
     tmp->mInputData.mState->Traverse(cb);
   }
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mFiles)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mFileList)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsHTMLInputElement,
+NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(HTMLInputElement,
                                                   nsGenericHTMLFormElement)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mValidity)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mControllers)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mFiles)
   if (tmp->mFileList) {
     tmp->mFileList->Disconnect();
     tmp->mFileList = nullptr;
   }
   if (tmp->IsSingleLineTextControl(false)) {
     tmp->mInputData.mState->Unlink();
   }
   //XXX should unlink more?
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
                                                               
-NS_IMPL_ADDREF_INHERITED(nsHTMLInputElement, Element)
-NS_IMPL_RELEASE_INHERITED(nsHTMLInputElement, Element)
-
-
-DOMCI_NODE_DATA(HTMLInputElement, nsHTMLInputElement)
-
-// QueryInterface implementation for nsHTMLInputElement
-NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHTMLInputElement)
-  NS_HTML_CONTENT_INTERFACE_TABLE8(nsHTMLInputElement,
+NS_IMPL_ADDREF_INHERITED(HTMLInputElement, Element)
+NS_IMPL_RELEASE_INHERITED(HTMLInputElement, Element)
+
+// QueryInterface implementation for HTMLInputElement
+NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLInputElement)
+  NS_HTML_CONTENT_INTERFACE_TABLE8(HTMLInputElement,
                                    nsIDOMHTMLInputElement,
                                    nsITextControlElement,
                                    nsIPhonetic,
                                    imgINotificationObserver,
                                    nsIImageLoadingContent,
                                    imgIOnloadBlocker,
                                    nsIDOMNSEditableElement,
                                    nsIConstraintValidation)
-  NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLInputElement,
+  NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(HTMLInputElement,
                                                nsGenericHTMLFormElement)
 NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLInputElement)
 
 // nsIConstraintValidation
-NS_IMPL_NSICONSTRAINTVALIDATION_EXCEPT_SETCUSTOMVALIDITY(nsHTMLInputElement)
+NS_IMPL_NSICONSTRAINTVALIDATION_EXCEPT_SETCUSTOMVALIDITY(HTMLInputElement)
 
 // nsIDOMNode
 
 nsresult
-nsHTMLInputElement::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const
+HTMLInputElement::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const
 {
   *aResult = nullptr;
 
   nsCOMPtr<nsINodeInfo> ni = aNodeInfo;
-  nsRefPtr<nsHTMLInputElement> it =
-    new nsHTMLInputElement(ni.forget(), NOT_FROM_PARSER);
-
-  nsresult rv = const_cast<nsHTMLInputElement*>(this)->CopyInnerTo(it);
+  nsRefPtr<HTMLInputElement> it =
+    new HTMLInputElement(ni.forget(), NOT_FROM_PARSER);
+
+  nsresult rv = const_cast<HTMLInputElement*>(this)->CopyInnerTo(it);
   NS_ENSURE_SUCCESS(rv, rv);
 
   switch (mType) {
     case NS_FORM_INPUT_EMAIL:
     case NS_FORM_INPUT_SEARCH:
     case NS_FORM_INPUT_TEXT:
     case NS_FORM_INPUT_PASSWORD:
     case NS_FORM_INPUT_TEL:
@@ -751,19 +749,19 @@ nsHTMLInputElement::Clone(nsINodeInfo *a
       break;
   }
 
   it.forget(aResult);
   return NS_OK;
 }
 
 nsresult
-nsHTMLInputElement::BeforeSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
-                                  const nsAttrValueOrString* aValue,
-                                  bool aNotify)
+HTMLInputElement::BeforeSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
+                                const nsAttrValueOrString* aValue,
+                                bool aNotify)
 {
   if (aNameSpaceID == kNameSpaceID_None) {
     //
     // When name or type changes, radio should be removed from radio group.
     // (type changes are handled in the form itself currently)
     // If the parser is not done creating the radio, we also should not do it.
     //
     if ((aName == nsGkAtoms::name ||
@@ -788,18 +786,18 @@ nsHTMLInputElement::BeforeSetAttr(int32_
     }
   }
 
   return nsGenericHTMLFormElement::BeforeSetAttr(aNameSpaceID, aName,
                                                  aValue, aNotify);
 }
 
 nsresult
-nsHTMLInputElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
-                                 const nsAttrValue* aValue, bool aNotify)
+HTMLInputElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
+                               const nsAttrValue* aValue, bool aNotify)
 {
   if (aNameSpaceID == kNameSpaceID_None) {
     //
     // When name or type changes, radio should be added to radio group.
     // (type changes are handled in the form itself currently)
     // If the parser is not done creating the radio, we also should not do it.
     //
     if ((aName == nsGkAtoms::name ||
@@ -935,135 +933,135 @@ nsHTMLInputElement::AfterSetAttr(int32_t
 
   return nsGenericHTMLFormElement::AfterSetAttr(aNameSpaceID, aName,
                                                 aValue, aNotify);
 }
 
 // nsIDOMHTMLInputElement
 
 NS_IMETHODIMP
-nsHTMLInputElement::GetForm(nsIDOMHTMLFormElement** aForm)
+HTMLInputElement::GetForm(nsIDOMHTMLFormElement** aForm)
 {
   return nsGenericHTMLFormElement::GetForm(aForm);
 }
 
-NS_IMPL_STRING_ATTR(nsHTMLInputElement, DefaultValue, value)
-NS_IMPL_BOOL_ATTR(nsHTMLInputElement, DefaultChecked, checked)
-NS_IMPL_STRING_ATTR(nsHTMLInputElement, Accept, accept)
-NS_IMPL_STRING_ATTR(nsHTMLInputElement, Align, align)
-NS_IMPL_STRING_ATTR(nsHTMLInputElement, Alt, alt)
-NS_IMPL_ENUM_ATTR_DEFAULT_VALUE(nsHTMLInputElement, Autocomplete, autocomplete,
+NS_IMPL_STRING_ATTR(HTMLInputElement, DefaultValue, value)
+NS_IMPL_BOOL_ATTR(HTMLInputElement, DefaultChecked, checked)
+NS_IMPL_STRING_ATTR(HTMLInputElement, Accept, accept)
+NS_IMPL_STRING_ATTR(HTMLInputElement, Align, align)
+NS_IMPL_STRING_ATTR(HTMLInputElement, Alt, alt)
+NS_IMPL_ENUM_ATTR_DEFAULT_VALUE(HTMLInputElement, Autocomplete, autocomplete,
                                 kInputDefaultAutocomplete->tag)
-NS_IMPL_BOOL_ATTR(nsHTMLInputElement, Autofocus, autofocus)
-//NS_IMPL_BOOL_ATTR(nsHTMLInputElement, Checked, checked)
-NS_IMPL_BOOL_ATTR(nsHTMLInputElement, Disabled, disabled)
-NS_IMPL_STRING_ATTR(nsHTMLInputElement, Max, max)
-NS_IMPL_STRING_ATTR(nsHTMLInputElement, Min, min)
-NS_IMPL_ACTION_ATTR(nsHTMLInputElement, FormAction, formaction)
-NS_IMPL_ENUM_ATTR_DEFAULT_MISSING_INVALID_VALUES(nsHTMLInputElement, FormEnctype, formenctype,
+NS_IMPL_BOOL_ATTR(HTMLInputElement, Autofocus, autofocus)
+//NS_IMPL_BOOL_ATTR(HTMLInputElement, Checked, checked)
+NS_IMPL_BOOL_ATTR(HTMLInputElement, Disabled, disabled)
+NS_IMPL_STRING_ATTR(HTMLInputElement, Max, max)
+NS_IMPL_STRING_ATTR(HTMLInputElement, Min, min)
+NS_IMPL_ACTION_ATTR(HTMLInputElement, FormAction, formaction)
+NS_IMPL_ENUM_ATTR_DEFAULT_MISSING_INVALID_VALUES(HTMLInputElement, FormEnctype, formenctype,
                                                  "", kFormDefaultEnctype->tag)
-NS_IMPL_ENUM_ATTR_DEFAULT_MISSING_INVALID_VALUES(nsHTMLInputElement, FormMethod, formmethod,
+NS_IMPL_ENUM_ATTR_DEFAULT_MISSING_INVALID_VALUES(HTMLInputElement, FormMethod, formmethod,
                                                  "", kFormDefaultMethod->tag)
-NS_IMPL_BOOL_ATTR(nsHTMLInputElement, FormNoValidate, formnovalidate)
-NS_IMPL_STRING_ATTR(nsHTMLInputElement, FormTarget, formtarget)
-NS_IMPL_ENUM_ATTR_DEFAULT_VALUE(nsHTMLInputElement, InputMode, inputmode,
+NS_IMPL_BOOL_ATTR(HTMLInputElement, FormNoValidate, formnovalidate)
+NS_IMPL_STRING_ATTR(HTMLInputElement, FormTarget, formtarget)
+NS_IMPL_ENUM_ATTR_DEFAULT_VALUE(HTMLInputElement, InputMode, inputmode,
                                 kInputDefaultInputmode->tag)
-NS_IMPL_BOOL_ATTR(nsHTMLInputElement, Multiple, multiple)
-NS_IMPL_NON_NEGATIVE_INT_ATTR(nsHTMLInputElement, MaxLength, maxlength)
-NS_IMPL_STRING_ATTR(nsHTMLInputElement, Name, name)
-NS_IMPL_BOOL_ATTR(nsHTMLInputElement, ReadOnly, readonly)
-NS_IMPL_BOOL_ATTR(nsHTMLInputElement, Required, required)
-NS_IMPL_URI_ATTR(nsHTMLInputElement, Src, src)
-NS_IMPL_STRING_ATTR(nsHTMLInputElement, Step, step)
-NS_IMPL_STRING_ATTR(nsHTMLInputElement, UseMap, usemap)
-//NS_IMPL_STRING_ATTR(nsHTMLInputElement, Value, value)
-NS_IMPL_UINT_ATTR_NON_ZERO_DEFAULT_VALUE(nsHTMLInputElement, Size, size, DEFAULT_COLS)
-NS_IMPL_STRING_ATTR(nsHTMLInputElement, Pattern, pattern)
-NS_IMPL_STRING_ATTR(nsHTMLInputElement, Placeholder, placeholder)
-NS_IMPL_ENUM_ATTR_DEFAULT_VALUE(nsHTMLInputElement, Type, type,
+NS_IMPL_BOOL_ATTR(HTMLInputElement, Multiple, multiple)
+NS_IMPL_NON_NEGATIVE_INT_ATTR(HTMLInputElement, MaxLength, maxlength)
+NS_IMPL_STRING_ATTR(HTMLInputElement, Name, name)
+NS_IMPL_BOOL_ATTR(HTMLInputElement, ReadOnly, readonly)
+NS_IMPL_BOOL_ATTR(HTMLInputElement, Required, required)
+NS_IMPL_URI_ATTR(HTMLInputElement, Src, src)
+NS_IMPL_STRING_ATTR(HTMLInputElement, Step, step)
+NS_IMPL_STRING_ATTR(HTMLInputElement, UseMap, usemap)
+//NS_IMPL_STRING_ATTR(HTMLInputElement, Value, value)
+NS_IMPL_UINT_ATTR_NON_ZERO_DEFAULT_VALUE(HTMLInputElement, Size, size, DEFAULT_COLS)
+NS_IMPL_STRING_ATTR(HTMLInputElement, Pattern, pattern)
+NS_IMPL_STRING_ATTR(HTMLInputElement, Placeholder, placeholder)
+NS_IMPL_ENUM_ATTR_DEFAULT_VALUE(HTMLInputElement, Type, type,
                                 kInputDefaultType->tag)
 
 int32_t
-nsHTMLInputElement::TabIndexDefault()
+HTMLInputElement::TabIndexDefault()
 {
   return 0;
 }
 
 NS_IMETHODIMP
-nsHTMLInputElement::GetHeight(uint32_t *aHeight)
+HTMLInputElement::GetHeight(uint32_t *aHeight)
 {
   *aHeight = GetWidthHeightForImage(mCurrentRequest).height;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsHTMLInputElement::SetHeight(uint32_t aHeight)
+HTMLInputElement::SetHeight(uint32_t aHeight)
 {
   return nsGenericHTMLElement::SetUnsignedIntAttr(nsGkAtoms::height, aHeight);
 }
 
 NS_IMETHODIMP
-nsHTMLInputElement::GetIndeterminate(bool* aValue)
+HTMLInputElement::GetIndeterminate(bool* aValue)
 {
   *aValue = Indeterminate();
   return NS_OK;
 }
 
 nsresult
-nsHTMLInputElement::SetIndeterminateInternal(bool aValue,
-                                             bool aShouldInvalidate)
+HTMLInputElement::SetIndeterminateInternal(bool aValue,
+                                           bool aShouldInvalidate)
 {
   mIndeterminate = aValue;
 
   if (aShouldInvalidate) {
     // Repaint the frame
     nsIFrame* frame = GetPrimaryFrame();
     if (frame)
       frame->InvalidateFrameSubtree();
   }
 
   UpdateState(true);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsHTMLInputElement::SetIndeterminate(bool aValue)
+HTMLInputElement::SetIndeterminate(bool aValue)
 {
   return SetIndeterminateInternal(aValue, true);
 }
 
 NS_IMETHODIMP
-nsHTMLInputElement::GetWidth(uint32_t *aWidth)
+HTMLInputElement::GetWidth(uint32_t *aWidth)
 {
   *aWidth = GetWidthHeightForImage(mCurrentRequest).width;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsHTMLInputElement::SetWidth(uint32_t aWidth)
+HTMLInputElement::SetWidth(uint32_t aWidth)
 {
   return nsGenericHTMLElement::SetUnsignedIntAttr(nsGkAtoms::width, aWidth);
 }
 
 NS_IMETHODIMP
-nsHTMLInputElement::GetValue(nsAString& aValue)
+HTMLInputElement::GetValue(nsAString& aValue)
 {
   nsresult rv = GetValueInternal(aValue);
 
   // Don't return non-sanitized value for types that are experimental on mobile.
   if (IsExperimentalMobileType(mType)) {
     SanitizeValue(aValue);
   }
 
   return rv;
 }
 
 nsresult
-nsHTMLInputElement::GetValueInternal(nsAString& aValue) const
+HTMLInputElement::GetValueInternal(nsAString& aValue) const
 {
   switch (GetValueMode()) {
     case VALUE_MODE_VALUE:
       if (IsSingleLineTextControl(false)) {
         mInputData.mState->GetValue(aValue, true);
       } else {
         aValue.Assign(mInputData.mValue);
       }
@@ -1099,27 +1097,27 @@ nsHTMLInputElement::GetValueInternal(nsA
       return NS_OK;
   }
 
   // This return statement is required for some compilers.
   return NS_OK;
 }
 
 bool
-nsHTMLInputElement::IsValueEmpty() const
+HTMLInputElement::IsValueEmpty() const
 {
   nsAutoString value;
   GetValueInternal(value);
 
   return value.IsEmpty();
 }
 
 bool
-nsHTMLInputElement::ConvertStringToNumber(nsAString& aValue,
-                                          double& aResultValue) const
+HTMLInputElement::ConvertStringToNumber(nsAString& aValue,
+                                        double& aResultValue) const
 {
   MOZ_ASSERT(DoesValueAsNumberApply(),
              "ConvertStringToNumber only applies if .valueAsNumber applies");
 
   switch (mType) {
     case NS_FORM_INPUT_NUMBER:
     case NS_FORM_INPUT_RANGE:
       {
@@ -1182,29 +1180,29 @@ nsHTMLInputElement::ConvertStringToNumbe
       return false;
   }
 
   MOZ_NOT_REACHED();
   return false;
 }
 
 double
-nsHTMLInputElement::GetValueAsDouble() const
+HTMLInputElement::GetValueAsDouble() const
 {
   double doubleValue;
   nsAutoString stringValue;
 
   GetValueInternal(stringValue);
 
   return !ConvertStringToNumber(stringValue, doubleValue) ? MOZ_DOUBLE_NaN()
                                                           : doubleValue;
 }
 
 NS_IMETHODIMP 
-nsHTMLInputElement::SetValue(const nsAString& aValue)
+HTMLInputElement::SetValue(const nsAString& aValue)
 {
   // 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
         // chrome privilege
@@ -1238,17 +1236,17 @@ nsHTMLInputElement::SetValue(const nsASt
       SetValueInternal(aValue, false, true);
     }
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsHTMLInputElement::GetList(nsIDOMHTMLElement** aValue)
+HTMLInputElement::GetList(nsIDOMHTMLElement** aValue)
 {
   *aValue = nullptr;
 
   nsAutoString dataListId;
   GetAttr(kNameSpaceID_None, nsGkAtoms::list, dataListId);
   if (dataListId.IsEmpty()) {
     return NS_OK;
   }
@@ -1263,33 +1261,33 @@ nsHTMLInputElement::GetList(nsIDOMHTMLEl
     return NS_OK;
   }
 
   CallQueryInterface(element, aValue);
   return NS_OK;
 }
 
 void
-nsHTMLInputElement::SetValue(double aValue)
+HTMLInputElement::SetValue(double aValue)
 {
   MOZ_ASSERT(!MOZ_DOUBLE_IS_INFINITE(aValue), "aValue must not be Infinity!");
 
   if (MOZ_DOUBLE_IS_NaN(aValue)) {
     SetValue(EmptyString());
     return;
   }
 
   nsAutoString value;
   ConvertNumberToString(aValue, value);
   SetValue(value);
 }
 
 bool
-nsHTMLInputElement::ConvertNumberToString(double aValue,
-                                          nsAString& aResultString) const
+HTMLInputElement::ConvertNumberToString(double aValue,
+                                        nsAString& aResultString) const
 {
   MOZ_ASSERT(DoesValueAsNumberApply(),
              "ConvertNumberToString is only implemented for types implementing .valueAsNumber");
   MOZ_ASSERT(!MOZ_DOUBLE_IS_NaN(aValue) && !MOZ_DOUBLE_IS_INFINITE(aValue),
              "aValue must be a valid non-Infinite number.");
 
   aResultString.Truncate();
 
@@ -1364,17 +1362,17 @@ nsHTMLInputElement::ConvertNumberToStrin
       }
     default:
       MOZ_NOT_REACHED();
       return false;
   }
 }
 
 NS_IMETHODIMP
-nsHTMLInputElement::GetValueAsDate(JSContext* aCtx, JS::Value* aDate)
+HTMLInputElement::GetValueAsDate(JSContext* aCtx, JS::Value* aDate)
 {
   if (mType != NS_FORM_INPUT_DATE && mType != NS_FORM_INPUT_TIME) {
     aDate->setNull();
     return NS_OK;
   }
 
   switch (mType) {
     case NS_FORM_INPUT_DATE:
@@ -1430,17 +1428,17 @@ nsHTMLInputElement::GetValueAsDate(JSCon
     }
   }
 
   MOZ_NOT_REACHED();
   return NS_ERROR_UNEXPECTED;
 }
 
 NS_IMETHODIMP
-nsHTMLInputElement::SetValueAsDate(JSContext* aCtx, const JS::Value& aDate)
+HTMLInputElement::SetValueAsDate(JSContext* aCtx, const JS::Value& aDate)
 {
   if (mType != NS_FORM_INPUT_DATE && mType != NS_FORM_INPUT_TIME) {
     return NS_ERROR_DOM_INVALID_STATE_ERR;
   }
 
   if (aDate.isNullOrUndefined()) {
     return SetValue(EmptyString());
   }
@@ -1461,42 +1459,42 @@ nsHTMLInputElement::SetValueAsDate(JSCon
     return NS_OK;
   }
 
   SetValue(timestamp.toNumber());
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsHTMLInputElement::GetValueAsNumber(double* aValueAsNumber)
+HTMLInputElement::GetValueAsNumber(double* aValueAsNumber)
 {
   *aValueAsNumber = DoesValueAsNumberApply() ? GetValueAsDouble()
                                              : MOZ_DOUBLE_NaN();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsHTMLInputElement::SetValueAsNumber(double aValueAsNumber)
+HTMLInputElement::SetValueAsNumber(double aValueAsNumber)
 {
   // TODO: return TypeError when HTMLInputElement is converted to WebIDL, see
   // bug 825197.
   if (MOZ_DOUBLE_IS_INFINITE(aValueAsNumber)) {
     return NS_ERROR_INVALID_ARG;
   }
 
   if (!DoesValueAsNumberApply()) {
     return NS_ERROR_DOM_INVALID_STATE_ERR;
   }
 
   SetValue(aValueAsNumber);
   return NS_OK;
 }
 
 double
-nsHTMLInputElement::GetMinimum() const
+HTMLInputElement::GetMinimum() const
 {
   MOZ_ASSERT(DoesValueAsNumberApply(),
              "GetMinAsDouble() should only be used for types that allow .valueAsNumber");
 
   // Only type=range has a default minimum
   double defaultMinimum =
     mType == NS_FORM_INPUT_RANGE ? 0.0 : MOZ_DOUBLE_NaN();
 
@@ -1507,17 +1505,17 @@ nsHTMLInputElement::GetMinimum() const
   nsAutoString minStr;
   GetAttr(kNameSpaceID_None, nsGkAtoms::min, minStr);
 
   double min;
   return ConvertStringToNumber(minStr, min) ? min : defaultMinimum;
 }
 
 double
-nsHTMLInputElement::GetMaximum() const
+HTMLInputElement::GetMaximum() const
 {
   MOZ_ASSERT(DoesValueAsNumberApply(),
              "GetMaxAsDouble() should only be used for types that allow .valueAsNumber");
 
   // Only type=range has a default maximum
   double defaultMaximum =
     mType == NS_FORM_INPUT_RANGE ? 100.0 : MOZ_DOUBLE_NaN();
 
@@ -1528,17 +1526,17 @@ nsHTMLInputElement::GetMaximum() const
   nsAutoString maxStr;
   GetAttr(kNameSpaceID_None, nsGkAtoms::max, maxStr);
 
   double max;
   return ConvertStringToNumber(maxStr, max) ? max : defaultMaximum;
 }
 
 double
-nsHTMLInputElement::GetStepBase() const
+HTMLInputElement::GetStepBase() const
 {
   MOZ_ASSERT(mType == NS_FORM_INPUT_NUMBER ||
              mType == NS_FORM_INPUT_DATE ||
              mType == NS_FORM_INPUT_TIME ||
              mType == NS_FORM_INPUT_RANGE,
              "Check that kDefaultStepBase is correct for this new type");
 
   double stepBase;
@@ -1557,17 +1555,17 @@ nsHTMLInputElement::GetStepBase() const
       ConvertStringToNumber(valueStr, stepBase)) {
     return stepBase;
   }
 
   return kDefaultStepBase;
 }
 
 nsresult
-nsHTMLInputElement::ApplyStep(int32_t aStep)
+HTMLInputElement::ApplyStep(int32_t aStep)
 {
   if (!DoStepDownStepUpApply()) {
     return NS_ERROR_DOM_INVALID_STATE_ERR;
   }
 
   double step = GetStep();
   if (step == kStepAny) {
     return NS_ERROR_DOM_INVALID_STATE_ERR;
@@ -1642,29 +1640,29 @@ nsHTMLInputElement::ApplyStep(int32_t aS
   }
 
   SetValue(value);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsHTMLInputElement::StepDown(int32_t n, uint8_t optional_argc)
+HTMLInputElement::StepDown(int32_t n, uint8_t optional_argc)
 {
   return ApplyStep(optional_argc ? -n : -1);
 }
 
 NS_IMETHODIMP
-nsHTMLInputElement::StepUp(int32_t n, uint8_t optional_argc)
+HTMLInputElement::StepUp(int32_t n, uint8_t optional_argc)
 {
   return ApplyStep(optional_argc ? n : 1);
 }
 
 NS_IMETHODIMP 
-nsHTMLInputElement::MozGetFileNameArray(uint32_t *aLength, PRUnichar ***aFileNames)
+HTMLInputElement::MozGetFileNameArray(uint32_t *aLength, PRUnichar ***aFileNames)
 {
   if (!nsContentUtils::IsCallerChrome()) {
     // Since this function returns full paths it's important that normal pages
     // can't call it.
     return NS_ERROR_DOM_SECURITY_ERR;
   }
 
   *aLength = mFiles.Count();
@@ -1681,17 +1679,17 @@ nsHTMLInputElement::MozGetFileNameArray(
   }
 
   *aFileNames = ret;
 
   return NS_OK;
 }
 
 NS_IMETHODIMP 
-nsHTMLInputElement::MozSetFileNameArray(const PRUnichar **aFileNames, uint32_t aLength)
+HTMLInputElement::MozSetFileNameArray(const PRUnichar **aFileNames, uint32_t aLength)
 {
   if (!nsContentUtils::IsCallerChrome()) {
     // setting the value of a "FILE" input widget requires chrome privilege
     return NS_ERROR_DOM_SECURITY_ERR;
   }
 
   nsCOMArray<nsIDOMFile> files;
   for (uint32_t i = 0; i < aLength; ++i) {
@@ -1721,31 +1719,31 @@ nsHTMLInputElement::MozSetFileNameArray(
   }
 
   SetFiles(files, true);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsHTMLInputElement::MozIsTextField(bool aExcludePassword, bool* aResult)
+HTMLInputElement::MozIsTextField(bool aExcludePassword, bool* aResult)
 {
   // TODO: temporary until bug 635240 and 773205 are fixed.
   if (IsExperimentalMobileType(mType)) {
     *aResult = false;
     return NS_OK;
   }
 
   *aResult = IsSingleLineTextControl(aExcludePassword);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP 
-nsHTMLInputElement::SetUserInput(const nsAString& aValue)
+HTMLInputElement::SetUserInput(const nsAString& aValue)
 {
   if (!nsContentUtils::IsCallerChrome()) {
     return NS_ERROR_DOM_SECURITY_ERR;
   }
 
   if (mType == NS_FORM_INPUT_FILE)
   {
     const PRUnichar* name = PromiseFlatString(aValue).get();
@@ -1756,127 +1754,127 @@ nsHTMLInputElement::SetUserInput(const n
 
   return nsContentUtils::DispatchTrustedEvent(OwnerDoc(),
                                               static_cast<nsIDOMHTMLInputElement*>(this),
                                               NS_LITERAL_STRING("input"), true,
                                               true);
 }
 
 NS_IMETHODIMP_(nsIEditor*)
-nsHTMLInputElement::GetTextEditor()
+HTMLInputElement::GetTextEditor()
 {
   nsTextEditorState *state = GetEditorState();
   if (state) {
     return state->GetEditor();
   }
   return nullptr;
 }
 
 NS_IMETHODIMP_(nsISelectionController*)
-nsHTMLInputElement::GetSelectionController()
+HTMLInputElement::GetSelectionController()
 {
   nsTextEditorState *state = GetEditorState();
   if (state) {
     return state->GetSelectionController();
   }
   return nullptr;
 }
 
 nsFrameSelection*
-nsHTMLInputElement::GetConstFrameSelection()
+HTMLInputElement::GetConstFrameSelection()
 {
   nsTextEditorState *state = GetEditorState();
   if (state) {
     return state->GetConstFrameSelection();
   }
   return nullptr;
 }
 
 NS_IMETHODIMP
-nsHTMLInputElement::BindToFrame(nsTextControlFrame* aFrame)
+HTMLInputElement::BindToFrame(nsTextControlFrame* aFrame)
 {
   nsTextEditorState *state = GetEditorState();
   if (state) {
     return state->BindToFrame(aFrame);
   }
   return NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP_(void)
-nsHTMLInputElement::UnbindFromFrame(nsTextControlFrame* aFrame)
+HTMLInputElement::UnbindFromFrame(nsTextControlFrame* aFrame)
 {
   nsTextEditorState *state = GetEditorState();
   if (state && aFrame) {
     state->UnbindFromFrame(aFrame);
   }
 }
 
 NS_IMETHODIMP
-nsHTMLInputElement::CreateEditor()
+HTMLInputElement::CreateEditor()
 {
   nsTextEditorState *state = GetEditorState();
   if (state) {
     return state->PrepareEditor();
   }
   return NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP_(nsIContent*)
-nsHTMLInputElement::GetRootEditorNode()
+HTMLInputElement::GetRootEditorNode()
 {
   nsTextEditorState *state = GetEditorState();
   if (state) {
     return state->GetRootNode();
   }
   return nullptr;
 }
 
 NS_IMETHODIMP_(nsIContent*)
-nsHTMLInputElement::CreatePlaceholderNode()
+HTMLInputElement::CreatePlaceholderNode()
 {
   nsTextEditorState *state = GetEditorState();
   if (state) {
     NS_ENSURE_SUCCESS(state->CreatePlaceholderNode(), nullptr);
     return state->GetPlaceholderNode();
   }
   return nullptr;
 }
 
 NS_IMETHODIMP_(nsIContent*)
-nsHTMLInputElement::GetPlaceholderNode()
+HTMLInputElement::GetPlaceholderNode()
 {
   nsTextEditorState *state = GetEditorState();
   if (state) {
     return state->GetPlaceholderNode();
   }
   return nullptr;
 }
 
 NS_IMETHODIMP_(void)
-nsHTMLInputElement::UpdatePlaceholderVisibility(bool aNotify)
+HTMLInputElement::UpdatePlaceholderVisibility(bool aNotify)
 {
   nsTextEditorState *state = GetEditorState();
   if (state) {
     state->UpdatePlaceholderVisibility(aNotify);
   }
 }
 
 NS_IMETHODIMP_(bool)
-nsHTMLInputElement::GetPlaceholderVisibility()
+HTMLInputElement::GetPlaceholderVisibility()
 {
   nsTextEditorState* state = GetEditorState();
   if (!state) {
     return false;
   }
 
   return state->GetPlaceholderVisibility();
 }
 
 void
-nsHTMLInputElement::GetDisplayFileName(nsAString& aValue) const
+HTMLInputElement::GetDisplayFileName(nsAString& aValue) const
 {
   if (OwnerDoc()->IsStaticDocument()) {
     aValue = mStaticDocFileList;
     return;
   }
 
   if (mFiles.Count() == 1) {
     mFiles[0]->GetName(aValue);
@@ -1901,28 +1899,28 @@ nsHTMLInputElement::GetDisplayFileName(n
     nsContentUtils::FormatLocalizedString(nsContentUtils::eFORMS_PROPERTIES,
                                           "XFilesSelected", params, value);
   }
 
   aValue = value;
 }
 
 void
-nsHTMLInputElement::SetFiles(const nsCOMArray<nsIDOMFile>& aFiles,
-                             bool aSetValueChanged)
+HTMLInputElement::SetFiles(const nsCOMArray<nsIDOMFile>& aFiles,
+                           bool aSetValueChanged)
 {
   mFiles.Clear();
   mFiles.AppendObjects(aFiles);
 
   AfterSetFiles(aSetValueChanged);
 }
 
 void
-nsHTMLInputElement::SetFiles(nsIDOMFileList* aFiles,
-                             bool aSetValueChanged)
+HTMLInputElement::SetFiles(nsIDOMFileList* aFiles,
+                           bool aSetValueChanged)
 {
   mFiles.Clear();
 
   if (aFiles) {
     uint32_t listLength;
     aFiles->GetLength(&listLength);
     for (uint32_t i = 0; i < listLength; i++) {
       nsCOMPtr<nsIDOMFile> file;
@@ -1930,17 +1928,17 @@ nsHTMLInputElement::SetFiles(nsIDOMFileL
       mFiles.AppendObject(file);
     }
   }
 
   AfterSetFiles(aSetValueChanged);
 }
 
 void
-nsHTMLInputElement::AfterSetFiles(bool aSetValueChanged)
+HTMLInputElement::AfterSetFiles(bool aSetValueChanged)
 {
   // No need to flush here, if there's no frame at this point we
   // don't need to force creation of one just to tell it about this
   // new value.  We just want the display to update as needed.
   nsIFormControlFrame* formControlFrame = GetFormControlFrame(false);
   if (formControlFrame) {
     nsAutoString readableValue;
     GetDisplayFileName(readableValue);
@@ -1952,17 +1950,17 @@ nsHTMLInputElement::AfterSetFiles(bool a
   if (aSetValueChanged) {
     SetValueChanged(true);
   }
 
   UpdateAllValidityStates(true);
 }
 
 void
-nsHTMLInputElement::FireChangeEventIfNeeded()
+HTMLInputElement::FireChangeEventIfNeeded()
 {
   nsString value;
   GetValueInternal(value);
 
   if (!MayFireChangeOnBlur() || mFocusedValue.Equals(value)) {
     return;
   }
 
@@ -1970,42 +1968,42 @@ nsHTMLInputElement::FireChangeEventIfNee
   mFocusedValue = value;
   nsContentUtils::DispatchTrustedEvent(OwnerDoc(),
                                        static_cast<nsIContent*>(this), 
                                        NS_LITERAL_STRING("change"), true,
                                        false);
 }
 
 const nsCOMArray<nsIDOMFile>&
-nsHTMLInputElement::GetFiles() const
+HTMLInputElement::GetFiles() const
 {
   return mFiles;
 }
 
 nsresult
-nsHTMLInputElement::UpdateFileList()
+HTMLInputElement::UpdateFileList()
 {
   if (mFileList) {
     mFileList->Clear();
 
     const nsCOMArray<nsIDOMFile>& files = GetFiles();
     for (int32_t i = 0; i < files.Count(); ++i) {
       if (!mFileList->Append(files[i])) {
         return NS_ERROR_FAILURE;
       }
     }
   }
 
   return NS_OK;
 }
 
 nsresult
-nsHTMLInputElement::SetValueInternal(const nsAString& aValue,
-                                     bool aUserInput,
-                                     bool aSetValueChanged)
+HTMLInputElement::SetValueInternal(const nsAString& aValue,
+                                   bool aUserInput,
+                                   bool aSetValueChanged)
 {
   NS_PRECONDITION(GetValueMode() != VALUE_MODE_FILENAME,
                   "Don't call SetValueInternal for file inputs");
 
   switch (GetValueMode()) {
     case VALUE_MODE_VALUE:
     {
       // At the moment, only single line text control have to sanitize their value
@@ -2034,17 +2032,17 @@ nsHTMLInputElement::SetValueInternal(con
       return NS_OK;
     }
 
     case VALUE_MODE_DEFAULT:
     case VALUE_MODE_DEFAULT_ON:
       // If the value of a hidden input was changed, we mark it changed so that we
       // will know we need to save / restore the value.  Yes, we are overloading
       // the meaning of ValueChanged just a teensy bit to save a measly byte of
-      // storage space in nsHTMLInputElement.  Yes, you are free to make a new flag,
+      // storage space in HTMLInputElement.  Yes, you are free to make a new flag,
       // NEED_TO_SAVE_VALUE, at such time as mBitField becomes a 16-bit value.
       if (mType == NS_FORM_INPUT_HIDDEN) {
         SetValueChanged(true);
       }
 
       // Treat value == defaultValue for other input elements.
       return nsGenericHTMLFormElement::SetAttr(kNameSpaceID_None,
                                                nsGkAtoms::value, aValue,
@@ -2054,81 +2052,81 @@ nsHTMLInputElement::SetValueInternal(con
       return NS_ERROR_UNEXPECTED;
   }
 
   // This return statement is required for some compilers.
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsHTMLInputElement::SetValueChanged(bool aValueChanged)
+HTMLInputElement::SetValueChanged(bool aValueChanged)
 {
   bool valueChangedBefore = mValueChanged;
 
   mValueChanged = aValueChanged;
 
   if (valueChangedBefore != aValueChanged) {
     UpdateState(true);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP 
-nsHTMLInputElement::GetChecked(bool* aChecked)
+HTMLInputElement::GetChecked(bool* aChecked)
 {
   *aChecked = Checked();
   return NS_OK;
 }
 
 void
-nsHTMLInputElement::SetCheckedChanged(bool aCheckedChanged)
+HTMLInputElement::SetCheckedChanged(bool aCheckedChanged)
 {
   DoSetCheckedChanged(aCheckedChanged, true);
 }
 
 void
-nsHTMLInputElement::DoSetCheckedChanged(bool aCheckedChanged,
-                                        bool aNotify)
+HTMLInputElement::DoSetCheckedChanged(bool aCheckedChanged,
+                                      bool aNotify)
 {
   if (mType == NS_FORM_INPUT_RADIO) {
     if (mCheckedChanged != aCheckedChanged) {
       nsCOMPtr<nsIRadioVisitor> visitor =
         new nsRadioSetCheckedChangedVisitor(aCheckedChanged);
       VisitGroup(visitor, aNotify);
     }
   } else {
     SetCheckedChangedInternal(aCheckedChanged);
   }
 }
 
 void
-nsHTMLInputElement::SetCheckedChangedInternal(bool aCheckedChanged)
+HTMLInputElement::SetCheckedChangedInternal(bool aCheckedChanged)
 {
   bool checkedChangedBefore = mCheckedChanged;
 
   mCheckedChanged = aCheckedChanged;
 
   // This method can't be called when we are not authorized to notify
   // so we do not need a aNotify parameter.
   if (checkedChangedBefore != aCheckedChanged) {
     UpdateState(true);
   }
 }
 
 NS_IMETHODIMP
-nsHTMLInputElement::SetChecked(bool aChecked)
+HTMLInputElement::SetChecked(bool aChecked)
 {
   DoSetChecked(aChecked, true, true);
   return NS_OK;
 }
 
 void
-nsHTMLInputElement::DoSetChecked(bool aChecked, bool aNotify,
-                                 bool aSetValueChanged)
+HTMLInputElement::DoSetChecked(bool aChecked, bool aNotify,
+                               bool aSetValueChanged)
 {
   // If the user or JS attempts to set checked, whether it actually changes the
   // value or not, we say the value was changed so that defaultValue don't
   // affect it no more.
   if (aSetValueChanged) {
     DoSetCheckedChanged(true, aNotify);
   }
 
@@ -2159,26 +2157,26 @@ nsHTMLInputElement::DoSetChecked(bool aC
   }
   // SetCheckedInternal is going to ask all radios to update their
   // validity state. We have to be sure the radio group container knows
   // the currently selected radio.
   SetCheckedInternal(false, aNotify);
 }
 
 void
-nsHTMLInputElement::RadioSetChecked(bool aNotify)
+HTMLInputElement::RadioSetChecked(bool aNotify)
 {
   // Find the selected radio button so we can deselect it
   nsCOMPtr<nsIDOMHTMLInputElement> currentlySelected = GetSelectedRadioButton();
 
   // Deselect the currently selected radio button
   if (currentlySelected) {
     // Pass true for the aNotify parameter since the currently selected
     // button is already in the document.
-    static_cast<nsHTMLInputElement*>(currentlySelected.get())
+    static_cast<HTMLInputElement*>(currentlySelected.get())
       ->SetCheckedInternal(false, true);
   }
 
   // Let the group know that we are now the One True Radio Button
   nsIRadioGroupContainer* container = GetRadioGroupContainer();
   if (container) {
     nsAutoString name;
     GetAttr(kNameSpaceID_None, nsGkAtoms::name, name);
@@ -2186,17 +2184,17 @@ nsHTMLInputElement::RadioSetChecked(bool
   }
 
   // SetCheckedInternal is going to ask all radios to update their
   // validity state. 
   SetCheckedInternal(true, aNotify);
 }
 
 nsIRadioGroupContainer*
-nsHTMLInputElement::GetRadioGroupContainer() const
+HTMLInputElement::GetRadioGroupContainer() const
 {
   NS_ASSERTION(mType == NS_FORM_INPUT_RADIO,
                "GetRadioGroupContainer should only be called when type='radio'");
 
   nsAutoString name;
   GetAttr(kNameSpaceID_None, nsGkAtoms::name, name);
 
   if (name.IsEmpty()) {
@@ -2206,32 +2204,32 @@ nsHTMLInputElement::GetRadioGroupContain
   if (mForm) {
     return mForm;
   }
 
   return static_cast<nsDocument*>(GetCurrentDoc());
 }
 
 already_AddRefed<nsIDOMHTMLInputElement>
-nsHTMLInputElement::GetSelectedRadioButton()
+HTMLInputElement::GetSelectedRadioButton()
 {
   nsIRadioGroupContainer* container = GetRadioGroupContainer();
   if (!container) {
     return nullptr;
   }
 
   nsAutoString name;
   GetAttr(kNameSpaceID_None, nsGkAtoms::name, name);
 
   nsCOMPtr<nsIDOMHTMLInputElement> selected = container->GetCurrentRadioButton(name);
   return selected.forget();
 }
 
 nsresult
-nsHTMLInputElement::MaybeSubmitForm(nsPresContext* aPresContext)
+HTMLInputElement::MaybeSubmitForm(nsPresContext* aPresContext)
 {
   if (!mForm) {
     // Nothing to do here.
     return NS_OK;
   }
   
   nsCOMPtr<nsIPresShell> shell = aPresContext->GetPresShell();
   if (!shell) {
@@ -2260,17 +2258,17 @@ nsHTMLInputElement::MaybeSubmitForm(nsPr
     nsEventStatus status = nsEventStatus_eIgnore;
     shell->HandleDOMEventWithTarget(mForm, &event, &status);
   }
 
   return NS_OK;
 }
 
 void
-nsHTMLInputElement::SetCheckedInternal(bool aChecked, bool aNotify)
+HTMLInputElement::SetCheckedInternal(bool aChecked, bool aNotify)
 {
   // Set the value
   mChecked = aChecked;
 
   // Notify the frame
   if (mType == NS_FORM_INPUT_CHECKBOX || mType == NS_FORM_INPUT_RADIO) {
     nsIFrame* frame = GetPrimaryFrame();
     if (frame) {
@@ -2281,17 +2279,17 @@ nsHTMLInputElement::SetCheckedInternal(b
   UpdateAllValidityStates(aNotify);
 
   // Notify the document that the CSS :checked pseudoclass for this element
   // has changed state.
   UpdateState(aNotify);
 }
 
 void
-nsHTMLInputElement::Focus(ErrorResult& aError)
+HTMLInputElement::Focus(ErrorResult& aError)
 {
   if (mType != NS_FORM_INPUT_FILE) {
     nsGenericHTMLElement::Focus(aError);
     return;
   }
 
   // For file inputs, focus the button instead.
   nsIFrame* frame = GetPrimaryFrame();
@@ -2312,17 +2310,17 @@ nsHTMLInputElement::Focus(ErrorResult& a
       }
     }
   }
 
   return;
 }
 
 NS_IMETHODIMP
-nsHTMLInputElement::Select()
+HTMLInputElement::Select()
 {
   if (!IsSingleLineTextControl(false)) {
     return NS_OK;
   }
 
   // XXX Bug?  We have to give the input focus before contents can be
   // selected
 
@@ -2352,17 +2350,17 @@ nsHTMLInputElement::Select()
       SelectAll(presContext);
     }
   }
 
   return NS_OK;
 }
 
 bool
-nsHTMLInputElement::DispatchSelectEvent(nsPresContext* aPresContext)
+HTMLInputElement::DispatchSelectEvent(nsPresContext* aPresContext)
 {
   nsEventStatus status = nsEventStatus_eIgnore;
 
   // If already handling select event, don't dispatch a second.
   if (!mHandlingSelectEvent) {
     nsEvent event(nsContentUtils::IsCallerChrome(), NS_FORM_SELECTED);
 
     mHandlingSelectEvent = true;
@@ -2372,34 +2370,34 @@ nsHTMLInputElement::DispatchSelectEvent(
   }
 
   // If the DOM event was not canceled (e.g. by a JS event handler
   // returning false)
   return (status == nsEventStatus_eIgnore);
 }
     
 void
-nsHTMLInputElement::SelectAll(nsPresContext* aPresContext)
+HTMLInputElement::SelectAll(nsPresContext* aPresContext)
 {
   nsIFormControlFrame* formControlFrame = GetFormControlFrame(true);
 
   if (formControlFrame) {
     formControlFrame->SetFormProperty(nsGkAtoms::select, EmptyString());
   }
 }
 
 NS_IMETHODIMP
-nsHTMLInputElement::FireAsyncClickHandler()
+HTMLInputElement::FireAsyncClickHandler()
 {
   nsCOMPtr<nsIRunnable> event = new AsyncClickHandler(this);
   return NS_DispatchToMainThread(event);
 }
 
 bool
-nsHTMLInputElement::NeedToInitializeEditorForEvent(nsEventChainPreVisitor& aVisitor) const
+HTMLInputElement::NeedToInitializeEditorForEvent(nsEventChainPreVisitor& aVisitor) const
 {
   // We only need to initialize the editor for single line input controls because they
   // are lazily initialized.  We don't need to initialize the control for
   // certain types of events, because we know that those events are safe to be
   // handled without the editor being initialized.  These events include:
   // mousein/move/out, and DOM mutation events.
   if (!IsSingleLineTextControl(false) ||
       aVisitor.mEvent->eventStructType == NS_MUTATION_EVENT) {
@@ -2414,23 +2412,23 @@ nsHTMLInputElement::NeedToInitializeEdit
   case NS_MOUSE_EXIT_SYNTH:
     return false;
   default:
     return true;
   }
 }
 
 bool
-nsHTMLInputElement::IsDisabledForEvents(uint32_t aMessage)
+HTMLInputElement::IsDisabledForEvents(uint32_t aMessage)
 {
   return IsElementDisabledForEvents(aMessage, GetPrimaryFrame());
 }
 
 nsresult
-nsHTMLInputElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
+HTMLInputElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
 {
   // Do not process any DOM events if the element is disabled
   aVisitor.mCanHandle = false;
   if (IsDisabledForEvents(aVisitor.mEvent->message)) {
     return NS_OK;
   }
 
   // Initialize the editor if needed.
@@ -2553,44 +2551,44 @@ nsHTMLInputElement::PreHandleEvent(nsEve
     }
     FireChangeEventIfNeeded();
   }
 
   return nsGenericHTMLFormElement::PreHandleEvent(aVisitor);
 }
 
 void
-nsHTMLInputElement::StartRangeThumbDrag(nsGUIEvent* aEvent)
+HTMLInputElement::StartRangeThumbDrag(nsGUIEvent* aEvent)
 {
   mIsDraggingRange = true;
   mRangeThumbDragStartValue = GetValueAsDouble();
   nsIPresShell::SetCapturingContent(this, CAPTURE_IGNOREALLOWED |
                                           CAPTURE_RETARGETTOELEMENT);
   nsRangeFrame* rangeFrame = do_QueryFrame(GetPrimaryFrame());
   SetValueOfRangeForUserEvent(rangeFrame->GetValueAtEventPoint(aEvent));
 }
 
 void
-nsHTMLInputElement::FinishRangeThumbDrag(nsGUIEvent* aEvent)
+HTMLInputElement::FinishRangeThumbDrag(nsGUIEvent* aEvent)
 {
   MOZ_ASSERT(mIsDraggingRange);
   
   if (nsIPresShell::GetCapturingContent() == this) {
     nsIPresShell::SetCapturingContent(nullptr, 0); // cancel capture
   }
   if (aEvent) {
     nsRangeFrame* rangeFrame = do_QueryFrame(GetPrimaryFrame());
     SetValueOfRangeForUserEvent(rangeFrame->GetValueAtEventPoint(aEvent));
   }
   mIsDraggingRange = false;
   FireChangeEventIfNeeded();
 }
 
 void
-nsHTMLInputElement::CancelRangeThumbDrag(bool aIsForUserEvent)
+HTMLInputElement::CancelRangeThumbDrag(bool aIsForUserEvent)
 {
   MOZ_ASSERT(mIsDraggingRange);
 
   if (nsIPresShell::GetCapturingContent() == this) {
     nsIPresShell::SetCapturingContent(nullptr, 0); // cancel capture
   }
   if (aIsForUserEvent) {
     SetValueOfRangeForUserEvent(mRangeThumbDragStartValue);
@@ -2605,17 +2603,17 @@ nsHTMLInputElement::CancelRangeThumbDrag
     if (frame) {
       frame->UpdateForValueChange();
     }
   }
   mIsDraggingRange = false;
 }
 
 void
-nsHTMLInputElement::SetValueOfRangeForUserEvent(double aValue)
+HTMLInputElement::SetValueOfRangeForUserEvent(double aValue)
 {
   MOZ_ASSERT(MOZ_DOUBLE_IS_FINITE(aValue));
 
   nsAutoString val;
   ConvertNumberToString(aValue, val);
   SetValueInternal(val, true, true);
   nsRangeFrame* frame = do_QueryFrame(GetPrimaryFrame());
   if (frame) {
@@ -2652,17 +2650,17 @@ IsLTR(Element* aElement)
   if (frame) {
     return frame->StyleVisibility()->mDirection == NS_STYLE_DIRECTION_LTR;
   }
   // at least for HTML, directionality is exclusively LTR or RTL
   return aElement->GetDirectionality() == eDir_LTR;
 }
 
 bool
-nsHTMLInputElement::ShouldPreventDOMActivateDispatch(nsIDOMEventTarget* aOriginalTarget)
+HTMLInputElement::ShouldPreventDOMActivateDispatch(nsIDOMEventTarget* aOriginalTarget)
 {
   /*
    * For the moment, there is only one situation where we actually want to
    * prevent firing a DOMActivate event:
    *  - we are a <input type='file'> that just got a click event,
    *  - the event was targeted to our button which should have sent a
    *    DOMActivate event.
    */
@@ -2678,17 +2676,17 @@ nsHTMLInputElement::ShouldPreventDOMActi
 
   return target->GetParent() == this &&
          target->IsRootOfNativeAnonymousSubtree() &&
          target->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
                              nsGkAtoms::button, eCaseMatters);
 }
 
 nsresult
-nsHTMLInputElement::PostHandleEvent(nsEventChainPostVisitor& aVisitor)
+HTMLInputElement::PostHandleEvent(nsEventChainPostVisitor& aVisitor)
 {
   if (!aVisitor.mPresContext) {
     return NS_OK;
   }
 
   if (aVisitor.mEvent->message == NS_FOCUS_CONTENT ||
       aVisitor.mEvent->message == NS_BLUR_CONTENT) {
     if (aVisitor.mEvent->message == NS_FOCUS_CONTENT && 
@@ -3101,17 +3099,17 @@ nsHTMLInputElement::PostHandleEvent(nsEv
       !aVisitor.mEvent->mFlags.mDefaultPrevented) {
     return FireAsyncClickHandler();
   }
 
   return rv;
 }
 
 void
-nsHTMLInputElement::PostHandleEventForRangeThumb(nsEventChainPostVisitor& aVisitor)
+HTMLInputElement::PostHandleEventForRangeThumb(nsEventChainPostVisitor& aVisitor)
 {
   MOZ_ASSERT(mType == NS_FORM_INPUT_RANGE);
 
   if (nsEventStatus_eConsumeNoDefault == aVisitor.mEventStatus ||
       !(aVisitor.mEvent->eventStructType == NS_MOUSE_EVENT ||
         aVisitor.mEvent->eventStructType == NS_TOUCH_EVENT ||
         aVisitor.mEvent->eventStructType == NS_KEY_EVENT)) {
     return;
@@ -3197,33 +3195,33 @@ nsHTMLInputElement::PostHandleEventForRa
       if (mIsDraggingRange) {
         CancelRangeThumbDrag();
       }
       break;
   }
 }
 
 void
-nsHTMLInputElement::MaybeLoadImage()
+HTMLInputElement::MaybeLoadImage()
 {
   // Our base URI may have changed; claim that our URI changed, and the
   // nsImageLoadingContent will decide whether a new image load is warranted.
   nsAutoString uri;
   if (mType == NS_FORM_INPUT_IMAGE &&
       GetAttr(kNameSpaceID_None, nsGkAtoms::src, uri) &&
       (NS_FAILED(LoadImage(uri, false, true)) ||
        !LoadingEnabled())) {
     CancelImageRequests(true);
   }
 }
 
 nsresult
-nsHTMLInputElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
-                               nsIContent* aBindingParent,
-                               bool aCompileEventHandlers)
+HTMLInputElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
+                             nsIContent* aBindingParent,
+                             bool aCompileEventHandlers)
 {
   nsresult rv = nsGenericHTMLFormElement::BindToTree(aDocument, aParent,
                                                      aBindingParent,
                                                      aCompileEventHandlers);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsImageLoadingContent::BindToTree(aDocument, aParent, aBindingParent,
                                     aCompileEventHandlers);
@@ -3232,17 +3230,17 @@ nsHTMLInputElement::BindToTree(nsIDocume
     // Our base URI may have changed; claim that our URI changed, and the
     // nsImageLoadingContent will decide whether a new image load is warranted.
     if (HasAttr(kNameSpaceID_None, nsGkAtoms::src)) {
       // FIXME: Bug 660963 it would be nice if we could just have
       // ClearBrokenState update our state and do it fast...
       ClearBrokenState();
       RemoveStatesSilently(NS_EVENT_STATE_BROKEN);
       nsContentUtils::AddScriptRunner(
-        NS_NewRunnableMethod(this, &nsHTMLInputElement::MaybeLoadImage));
+        NS_NewRunnableMethod(this, &HTMLInputElement::MaybeLoadImage));
     }
   }
 
   // Add radio to document if we don't have a form already (if we do it's
   // already been added into that group)
   if (aDocument && !mForm && mType == NS_FORM_INPUT_RADIO) {
     AddedToRadioGroup();
   }
@@ -3261,17 +3259,17 @@ nsHTMLInputElement::BindToTree(nsIDocume
 
   // And now make sure our state is up to date
   UpdateState(false);
 
   return rv;
 }
 
 void
-nsHTMLInputElement::UnbindFromTree(bool aDeep, bool aNullParent)
+HTMLInputElement::UnbindFromTree(bool aDeep, bool aNullParent)
 {
   // If we have a form and are unbound from it,
   // nsGenericHTMLFormElement::UnbindFromTree() will unset the form and
   // that takes care of form's WillRemove so we just have to take care
   // of the case where we're removing from the document and we don't
   // have a form
   if (!mForm && mType == NS_FORM_INPUT_RADIO) {
     WillRemoveFromRadioGroup();
@@ -3286,17 +3284,17 @@ nsHTMLInputElement::UnbindFromTree(bool 
   // We might be no longer disabled because of parent chain changed.
   UpdateBarredFromConstraintValidation();
 
   // And now make sure our state is up to date
   UpdateState(false);
 }
 
 void
-nsHTMLInputElement::HandleTypeChange(uint8_t aNewType)
+HTMLInputElement::HandleTypeChange(uint8_t aNewType)
 {
   if (mType == NS_FORM_INPUT_RANGE && mIsDraggingRange) {
     CancelRangeThumbDrag(false);
   }
 
   ValueModeType aOldValueMode = GetValueMode();
   uint8_t oldType = mType;
   nsAutoString aOldValue;
@@ -3362,17 +3360,17 @@ nsHTMLInputElement::HandleTypeChange(uin
 
   UpdateHasRange();
 
   // Do not notify, it will be done after if needed.
   UpdateAllValidityStates(false);
 }
 
 void
-nsHTMLInputElement::SanitizeValue(nsAString& aValue)
+HTMLInputElement::SanitizeValue(nsAString& aValue)
 {
   NS_ASSERTION(!mParserCreating, "The element parsing should be finished!");
 
   switch (mType) {
     case NS_FORM_INPUT_TEXT:
     case NS_FORM_INPUT_SEARCH:
     case NS_FORM_INPUT_TEL:
     case NS_FORM_INPUT_PASSWORD:
@@ -3479,27 +3477,27 @@ nsHTMLInputElement::SanitizeValue(nsAStr
           aValue.Truncate();
         }
       }
       break;
   }
 }
 
 bool
-nsHTMLInputElement::IsValidDate(const nsAString& aValue) const
+HTMLInputElement::IsValidDate(const nsAString& aValue) const
 {
   uint32_t year, month, day;
   return GetValueAsDate(aValue, &year, &month, &day);
 }
 
 bool
-nsHTMLInputElement::GetValueAsDate(const nsAString& aValue,
-                                   uint32_t* aYear,
-                                   uint32_t* aMonth,
-                                   uint32_t* aDay) const
+HTMLInputElement::GetValueAsDate(const nsAString& aValue,
+                                 uint32_t* aYear,
+                                 uint32_t* aMonth,
+                                 uint32_t* aDay) const
 {
 
 /*
  * Parse the year, month, day values out a date string formatted as 'yyyy-mm-dd'.
  * -The year must be 4 or more digits long, and year > 0
  * -The month must be exactly 2 digits long, and 01 <= month <= 12
  * -The day must be exactly 2 digit long, and 01 <= day <= maxday
  *  Where maxday is the number of days in the month 'month' and year 'year'
@@ -3535,17 +3533,17 @@ nsHTMLInputElement::GetValueAsDate(const
     return false;
   }
 
   return DigitSubStringToNumber(aValue, endOfYearOffset + 4, 2, aDay) &&
          *aDay > 0 && *aDay <= NumberOfDaysInMonth(*aMonth, *aYear);
 }
 
 uint32_t
-nsHTMLInputElement::NumberOfDaysInMonth(uint32_t aMonth, uint32_t aYear) const
+HTMLInputElement::NumberOfDaysInMonth(uint32_t aMonth, uint32_t aYear) const
 {
 /*
  * Returns the number of days in a month.
  * Months that are |longMonths| always have 31 days.
  * Months that are not |longMonths| have 30 days except February (month 2).
  * February has 29 days during leap years which are years that are divisible by 400.
  * or divisible by 100 and 4. February has 28 days otherwise.
  */
@@ -3562,42 +3560,42 @@ nsHTMLInputElement::NumberOfDaysInMonth(
     return 30;
   }
 
   return (aYear % 400 == 0 || (aYear % 100 != 0 && aYear % 4 == 0))
           ? 29 : 28;
 }
 
 /* static */ bool
-nsHTMLInputElement::DigitSubStringToNumber(const nsAString& aStr,
-                                           uint32_t aStart, uint32_t aLen,
-                                           uint32_t* aRetVal)
+HTMLInputElement::DigitSubStringToNumber(const nsAString& aStr,
+                                         uint32_t aStart, uint32_t aLen,
+                                         uint32_t* aRetVal)
 {
   MOZ_ASSERT(aStr.Length() > (aStart + aLen - 1));
 
   for (uint32_t offset = 0; offset < aLen; ++offset) {
     if (!NS_IsAsciiDigit(aStr[aStart + offset])) {
       return false;
     }
   }
 
   nsresult ec;
   *aRetVal = static_cast<uint32_t>(PromiseFlatString(Substring(aStr, aStart, aLen)).ToInteger(&ec));
 
   return NS_SUCCEEDED(ec);
 }
 
 bool
-nsHTMLInputElement::IsValidTime(const nsAString& aValue) const
+HTMLInputElement::IsValidTime(const nsAString& aValue) const
 {
   return ParseTime(aValue, nullptr);
 }
 
 /* static */ bool
-nsHTMLInputElement::ParseTime(const nsAString& aValue, uint32_t* aResult)
+HTMLInputElement::ParseTime(const nsAString& aValue, uint32_t* aResult)
 {
   /* The string must have the following parts:
    * - HOURS: two digits, value being in [0, 23];
    * - Colon (:);
    * - MINUTES: two digits, value being in [0, 59];
    * - Optional:
    *   - Colon (:);
    *   - SECONDS: two digits, value being in [0, 59];
@@ -3667,20 +3665,20 @@ nsHTMLInputElement::ParseTime(const nsAS
                // some old [and stupid] compilers can't just do the right thing.
                fractionsSeconds * pow(10.0, static_cast<int>(3 - (aValue.Length() - 9)));
   }
 
   return true;
 }
  
 bool
-nsHTMLInputElement::ParseAttribute(int32_t aNamespaceID,
-                                   nsIAtom* aAttribute,
-                                   const nsAString& aValue,
-                                   nsAttrValue& aResult)
+HTMLInputElement::ParseAttribute(int32_t aNamespaceID,
+                                 nsIAtom* aAttribute,
+                                 const nsAString& aValue,
+                                 nsAttrValue& aResult)
 {
   if (aNamespaceID == kNameSpaceID_None) {
     if (aAttribute == nsGkAtoms::type) {
       // XXX ARG!! This is major evilness. ParseAttribute
       // shouldn't set members. Override SetAttr instead
       int32_t newType;
       bool success = aResult.ParseEnumValue(aValue, kInputTypeTable, false);
       if (success) {
@@ -3771,18 +3769,18 @@ MapAttributesIntoRule(const nsMappedAttr
     // Images treat align as "float"
     nsGenericHTMLFormElement::MapImageAlignAttributeInto(aAttributes, aData);
   } 
 
   nsGenericHTMLFormElement::MapCommonAttributesInto(aAttributes, aData);
 }
 
 nsChangeHint
-nsHTMLInputElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
-                                           int32_t aModType) const
+HTMLInputElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
+                                         int32_t aModType) const
 {
   nsChangeHint retval =
     nsGenericHTMLFormElement::GetAttributeChangeHint(aAttribute, aModType);
   if (aAttribute == nsGkAtoms::type) {
     NS_UpdateHint(retval, NS_STYLE_HINT_FRAMECHANGE);
   } else if (mType == NS_FORM_INPUT_IMAGE &&
              (aAttribute == nsGkAtoms::alt ||
               aAttribute == nsGkAtoms::value)) {
@@ -3796,17 +3794,17 @@ nsHTMLInputElement::GetAttributeChangeHi
     NS_UpdateHint(retval, NS_STYLE_HINT_REFLOW);
   } else if (PlaceholderApplies() && aAttribute == nsGkAtoms::placeholder) {
     NS_UpdateHint(retval, NS_STYLE_HINT_FRAMECHANGE);
   }
   return retval;
 }
 
 NS_IMETHODIMP_(bool)
-nsHTMLInputElement::IsAttributeMapped(const nsIAtom* aAttribute) const
+HTMLInputElement::IsAttributeMapped(const nsIAtom* aAttribute) const
 {
   static const MappedAttributeEntry attributes[] = {
     { &nsGkAtoms::align },
     { &nsGkAtoms::type },
     { nullptr },
   };
 
   static const MappedAttributeEntry* const map[] = {
@@ -3815,26 +3813,26 @@ nsHTMLInputElement::IsAttributeMapped(co
     sImageMarginSizeAttributeMap,
     sImageBorderAttributeMap,
   };
 
   return FindAttributeDependence(aAttribute, map);
 }
 
 nsMapRuleToAttributesFunc
-nsHTMLInputElement::GetAttributeMappingFunction() const
+HTMLInputElement::GetAttributeMappingFunction() const
 {
   return &MapAttributesIntoRule;
 }
 
 
 // Controllers Methods
 
 NS_IMETHODIMP
-nsHTMLInputElement::GetControllers(nsIControllers** aResult)
+HTMLInputElement::GetControllers(nsIControllers** aResult)
 {
   NS_ENSURE_ARG_POINTER(aResult);
 
   //XXX: what about type "file"?
   if (IsSingleLineTextControl(false))
   {
     if (!mControllers)
     {
@@ -3859,31 +3857,31 @@ nsHTMLInputElement::GetControllers(nsICo
 
   *aResult = mControllers;
   NS_IF_ADDREF(*aResult);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsHTMLInputElement::GetTextLength(int32_t* aTextLength)
+HTMLInputElement::GetTextLength(int32_t* aTextLength)
 {
   nsAutoString val;
 
   nsresult rv = GetValue(val);
 
   *aTextLength = val.Length();
 
   return rv;
 }
 
 NS_IMETHODIMP
-nsHTMLInputElement::SetSelectionRange(int32_t aSelectionStart,
-                                      int32_t aSelectionEnd,
-                                      const nsAString& aDirection)
+HTMLInputElement::SetSelectionRange(int32_t aSelectionStart,
+                                    int32_t aSelectionEnd,
+                                    const nsAString& aDirection)
 {
   nsresult rv = NS_ERROR_FAILURE;
   nsIFormControlFrame* formControlFrame = GetFormControlFrame(true);
 
   if (formControlFrame) {
     nsITextControlFrame* textControlFrame = do_QueryFrame(formControlFrame);
     if (textControlFrame) {
       // Default to forward, even if not specified.
@@ -3900,17 +3898,17 @@ nsHTMLInputElement::SetSelectionRange(in
       }
     }
   }
 
   return rv;
 }
 
 NS_IMETHODIMP
-nsHTMLInputElement::GetSelectionStart(int32_t* aSelectionStart)
+HTMLInputElement::GetSelectionStart(int32_t* aSelectionStart)
 {
   NS_ENSURE_ARG_POINTER(aSelectionStart);
 
   int32_t selEnd;
   nsresult rv = GetSelectionRange(aSelectionStart, &selEnd);
 
   if (NS_FAILED(rv)) {
     nsTextEditorState *state = GetEditorState();
@@ -3918,17 +3916,17 @@ nsHTMLInputElement::GetSelectionStart(in
       *aSelectionStart = state->GetSelectionProperties().mStart;
       return NS_OK;
     }
   }
   return rv;
 }
 
 NS_IMETHODIMP
-nsHTMLInputElement::SetSelectionStart(int32_t aSelectionStart)
+HTMLInputElement::SetSelectionStart(int32_t aSelectionStart)
 {
   nsTextEditorState *state = GetEditorState();
   if (state && state->IsSelectionCached()) {
     state->GetSelectionProperties().mStart = aSelectionStart;
     return NS_OK;
   }
 
   nsAutoString direction;
@@ -3940,17 +3938,17 @@ nsHTMLInputElement::SetSelectionStart(in
   start = aSelectionStart;
   if (end < start) {
     end = start;
   }
   return SetSelectionRange(start, end, direction);
 }
 
 NS_IMETHODIMP
-nsHTMLInputElement::GetSelectionEnd(int32_t* aSelectionEnd)
+HTMLInputElement::GetSelectionEnd(int32_t* aSelectionEnd)
 {
   NS_ENSURE_ARG_POINTER(aSelectionEnd);
 
   int32_t selStart;
   nsresult rv = GetSelectionRange(&selStart, aSelectionEnd);
 
   if (NS_FAILED(rv)) {
     nsTextEditorState *state = GetEditorState();
@@ -3959,17 +3957,17 @@ nsHTMLInputElement::GetSelectionEnd(int3
       return NS_OK;
     }
   }
   return rv;
 }
 
 
 NS_IMETHODIMP
-nsHTMLInputElement::SetSelectionEnd(int32_t aSelectionEnd)
+HTMLInputElement::SetSelectionEnd(int32_t aSelectionEnd)
 {
   nsTextEditorState *state = GetEditorState();
   if (state && state->IsSelectionCached()) {
     state->GetSelectionProperties().mEnd = aSelectionEnd;
     return NS_OK;
   }
 
   nsAutoString direction;
@@ -3981,17 +3979,17 @@ nsHTMLInputElement::SetSelectionEnd(int3
   end = aSelectionEnd;
   if (start > end) {
     start = end;
   }
   return SetSelectionRange(start, end, direction);
 }
 
 NS_IMETHODIMP
-nsHTMLInputElement::GetFiles(nsIDOMFileList** aFileList)
+HTMLInputElement::GetFiles(nsIDOMFileList** aFileList)
 {
   *aFileList = nullptr;
 
   if (mType != NS_FORM_INPUT_FILE) {
     return NS_OK;
   }
 
   if (!mFileList) {
@@ -4002,18 +4000,18 @@ nsHTMLInputElement::GetFiles(nsIDOMFileL
   }
 
   NS_ADDREF(*aFileList = mFileList);
 
   return NS_OK;
 }
 
 nsresult
-nsHTMLInputElement::GetSelectionRange(int32_t* aSelectionStart,
-                                      int32_t* aSelectionEnd)
+HTMLInputElement::GetSelectionRange(int32_t* aSelectionStart,
+                                    int32_t* aSelectionEnd)
 {
   nsresult rv = NS_ERROR_FAILURE;
   nsIFormControlFrame* formControlFrame = GetFormControlFrame(true);
 
   if (formControlFrame) {
     nsITextControlFrame* textControlFrame = do_QueryFrame(formControlFrame);
     if (textControlFrame)
       rv = textControlFrame->GetSelectionRange(aSelectionStart, aSelectionEnd);
@@ -4032,17 +4030,17 @@ DirectionToName(nsITextControlFrame::Sel
   } else if (dir == nsITextControlFrame::eBackward) {
     aDirection.AssignLiteral("backward");
   } else {
     NS_NOTREACHED("Invalid SelectionDirection value");
   }
 }
 
 NS_IMETHODIMP
-nsHTMLInputElement::GetSelectionDirection(nsAString& aDirection)
+HTMLInputElement::GetSelectionDirection(nsAString& aDirection)
 {
   nsresult rv = NS_ERROR_FAILURE;
   nsIFormControlFrame* formControlFrame = GetFormControlFrame(true);
 
   if (formControlFrame) {
     nsITextControlFrame* textControlFrame = do_QueryFrame(formControlFrame);
     if (textControlFrame) {
       nsITextControlFrame::SelectionDirection dir;
@@ -4060,17 +4058,18 @@ nsHTMLInputElement::GetSelectionDirectio
       return NS_OK;
     }
   }
 
   return rv;
 }
 
 NS_IMETHODIMP
-nsHTMLInputElement::SetSelectionDirection(const nsAString& aDirection) {
+HTMLInputElement::SetSelectionDirection(const nsAString& aDirection)
+{
   nsTextEditorState *state = GetEditorState();
   if (state && state->IsSelectionCached()) {
     nsITextControlFrame::SelectionDirection dir = nsITextControlFrame::eNone;
     if (aDirection.EqualsLiteral("forward")) {
       dir = nsITextControlFrame::eForward;
     } else if (aDirection.EqualsLiteral("backward")) {
       dir = nsITextControlFrame::eBackward;
     }
@@ -4083,17 +4082,17 @@ nsHTMLInputElement::SetSelectionDirectio
   if (NS_SUCCEEDED(rv)) {
     rv = SetSelectionRange(start, end, aDirection);
   }
 
   return rv;
 }
 
 NS_IMETHODIMP
-nsHTMLInputElement::GetPhonetic(nsAString& aPhonetic)
+HTMLInputElement::GetPhonetic(nsAString& aPhonetic)
 {
   aPhonetic.Truncate();
   nsIFormControlFrame* formControlFrame = GetFormControlFrame(true);
 
   if (formControlFrame) {
     nsITextControlFrame* textControlFrame = do_QueryFrame(formControlFrame);
     if (textControlFrame)
       textControlFrame->GetPhonetic(aPhonetic);
@@ -4119,47 +4118,47 @@ FireEventForAccessibility(nsIDOMHTMLInpu
     nsEventDispatcher::DispatchDOMEvent(aTarget, nullptr, event, aPresContext, nullptr);
   }
 
   return NS_OK;
 }
 #endif
 
 nsresult
-nsHTMLInputElement::SetDefaultValueAsValue()
+HTMLInputElement::SetDefaultValueAsValue()
 {
   NS_ASSERTION(GetValueMode() == VALUE_MODE_VALUE,
                "GetValueMode() should return VALUE_MODE_VALUE!");
 
   // The element has a content attribute value different from it's value when
   // it's in the value mode value.
   nsAutoString resetVal;
   GetDefaultValue(resetVal);
 
   // SetValueInternal is going to sanitize the value.
   return SetValueInternal(resetVal, false, false);
 }
 
 void
-nsHTMLInputElement::SetDirectionIfAuto(bool aAuto, bool aNotify)
+HTMLInputElement::SetDirectionIfAuto(bool aAuto, bool aNotify)
 {
   if (aAuto) {
     SetHasDirAuto();
     if (IsSingleLineTextControl(true)) {
       nsAutoString value;
       GetValue(value);
       SetDirectionalityFromValue(this, value, aNotify);
     }
   } else {
     ClearHasDirAuto();
   }
 }
 
 NS_IMETHODIMP
-nsHTMLInputElement::Reset()
+HTMLInputElement::Reset()
 {
   // We should be able to reset all dirty flags regardless of the type.
   SetCheckedChanged(false);
   SetValueChanged(false);
 
   switch (GetValueMode()) {
     case VALUE_MODE_VALUE:
       return SetDefaultValueAsValue();
@@ -4171,17 +4170,17 @@ nsHTMLInputElement::Reset()
       return NS_OK;
     case VALUE_MODE_DEFAULT:
     default:
       return NS_OK;
   }
 }
 
 NS_IMETHODIMP
-nsHTMLInputElement::SubmitNamesValues(nsFormSubmission* aFormSubmission)
+HTMLInputElement::SubmitNamesValues(nsFormSubmission* aFormSubmission)
 {
   // Disabled elements don't submit
   // For type=reset, and type=button, we just never submit, period.
   // For type=image and type=button, we only submit if we were the button
   // pressed
   // For type=radio and type=checkbox, we only submit if checked=true
   if (IsDisabled() || mType == NS_FORM_INPUT_RESET ||
       mType == NS_FORM_INPUT_BUTTON ||
@@ -4285,25 +4284,25 @@ nsHTMLInputElement::SubmitNamesValues(ns
       aFormSubmission->SupportsIsindexSubmission()) {
     return aFormSubmission->AddIsindex(value);
   }
   return aFormSubmission->AddNameValuePair(name, value);
 }
 
 
 NS_IMETHODIMP
-nsHTMLInputElement::SaveState()
-{
-  nsRefPtr<nsHTMLInputElementState> inputState;
+HTMLInputElement::SaveState()
+{
+  nsRefPtr<HTMLInputElementState> inputState;
   switch (mType) {
     case NS_FORM_INPUT_CHECKBOX:
     case NS_FORM_INPUT_RADIO:
       {
         if (mCheckedChanged) {
-          inputState = new nsHTMLInputElementState();
+          inputState = new HTMLInputElementState();
           inputState->SetChecked(mChecked);
         }
         break;
       }
 
     // Never save passwords in session history
     case NS_FORM_INPUT_PASSWORD:
       break;
@@ -4314,33 +4313,33 @@ nsHTMLInputElement::SaveState()
     case NS_FORM_INPUT_URL:
     case NS_FORM_INPUT_HIDDEN:
     case NS_FORM_INPUT_NUMBER:
     case NS_FORM_INPUT_DATE:
     case NS_FORM_INPUT_TIME:
     case NS_FORM_INPUT_RANGE:
       {
         if (mValueChanged) {
-          inputState = new nsHTMLInputElementState();
+          inputState = new HTMLInputElementState();
           nsAutoString value;
           GetValue(value);
           DebugOnly<nsresult> rv =
             nsLinebreakConverter::ConvertStringLineBreaks(
                  value,
                  nsLinebreakConverter::eLinebreakPlatform,
                  nsLinebreakConverter::eLinebreakContent);
           NS_ASSERTION(NS_SUCCEEDED(rv), "Converting linebreaks failed!");
           inputState->SetValue(value);
        }
       break;
     }
     case NS_FORM_INPUT_FILE:
       {
         if (mFiles.Count()) {
-          inputState = new nsHTMLInputElementState();
+          inputState = new HTMLInputElementState();
           inputState->SetFiles(mFiles);
         }
         break;
       }
   }
   
   nsresult rv = NS_OK;
   nsPresState* state = nullptr;
@@ -4362,17 +4361,17 @@ nsHTMLInputElement::SaveState()
       state->SetDisabled(HasAttr(kNameSpaceID_None, nsGkAtoms::disabled));
     }
   }
 
   return rv;
 }
 
 void
-nsHTMLInputElement::DoneCreatingElement()
+HTMLInputElement::DoneCreatingElement()
 {
   mParserCreating = false;
 
   //
   // Restore state as needed.  Note that disabled state applies to all control
   // types.
   //
   bool restoredCheckedState =
@@ -4393,17 +4392,17 @@ nsHTMLInputElement::DoneCreatingElement(
     GetValue(aValue);
     SetValueInternal(aValue, false, false);
   }
 
   mShouldInitChecked = false;
 }
 
 nsEventStates
-nsHTMLInputElement::IntrinsicState() const
+HTMLInputElement::IntrinsicState() const
 {
   // If you add states here, and they're type-dependent, you need to add them
   // to the type case in AfterSetAttr.
   
   nsEventStates state = nsGenericHTMLFormElement::IntrinsicState();
   if (mType == NS_FORM_INPUT_CHECKBOX || mType == NS_FORM_INPUT_RADIO) {
     // Check current checked state (:checked)
     if (mChecked) {
@@ -4470,21 +4469,21 @@ nsHTMLInputElement::IntrinsicState() con
                ? NS_EVENT_STATE_OUTOFRANGE
                : NS_EVENT_STATE_INRANGE;
   }
 
   return state;
 }
 
 bool
-nsHTMLInputElement::RestoreState(nsPresState* aState)
+HTMLInputElement::RestoreState(nsPresState* aState)
 {
   bool restoredCheckedState = false;
 
-  nsCOMPtr<nsHTMLInputElementState> inputState
+  nsCOMPtr<HTMLInputElementState> inputState
     (do_QueryInterface(aState->GetStateProperty()));
 
   if (inputState) {
     switch (mType) {
       case NS_FORM_INPUT_CHECKBOX:
       case NS_FORM_INPUT_RADIO:
         {
           if (inputState->IsCheckedSet()) {
@@ -4520,29 +4519,29 @@ nsHTMLInputElement::RestoreState(nsPresS
   if (aState->IsDisabledSet()) {
     SetDisabled(aState->GetDisabled());
   }
 
   return restoredCheckedState;
 }
 
 bool
-nsHTMLInputElement::AllowDrop()
+HTMLInputElement::AllowDrop()
 {
   // Allow drop on anything other than file inputs.
 
   return mType != NS_FORM_INPUT_FILE;
 }
 
 /*
  * Radio group stuff
  */
 
 void
-nsHTMLInputElement::AddedToRadioGroup()
+HTMLInputElement::AddedToRadioGroup()
 {
   // If the element is neither in a form nor a document, there is no group so we
   // should just stop here.
   if (!mForm && !IsInDoc()) {
     return;
   }
 
   // Make sure not to notify if we're still being created by the parser
@@ -4587,17 +4586,17 @@ nsHTMLInputElement::AddedToRadioGroup()
     // We initialize the validity of the element to the validity of the group
     // because we assume UpdateValueMissingState() will be called after.
     SetValidityState(VALIDITY_STATE_VALUE_MISSING,
                      container->GetValueMissingState(name));
   }
 }
 
 void
-nsHTMLInputElement::WillRemoveFromRadioGroup()
+HTMLInputElement::WillRemoveFromRadioGroup()
 {
   nsIRadioGroupContainer* container = GetRadioGroupContainer();
   if (!container) {
     return;
   }
 
   nsAutoString name;
   GetAttr(kNameSpaceID_None, nsGkAtoms::name, name);
@@ -4611,17 +4610,17 @@ nsHTMLInputElement::WillRemoveFromRadioG
   // Remove this radio from its group in the container.
   // We need to call UpdateValueMissingValidityStateForRadio before to make sure
   // the group validity is updated (with this element being ignored).
   UpdateValueMissingValidityStateForRadio(true);
   container->RemoveFromRadioGroup(name, static_cast<nsIFormControl*>(this));
 }
 
 bool
-nsHTMLInputElement::IsHTMLFocusable(bool aWithMouse, bool *aIsFocusable, int32_t *aTabIndex)
+HTMLInputElement::IsHTMLFocusable(bool aWithMouse, bool *aIsFocusable, int32_t *aTabIndex)
 {
   if (nsGenericHTMLFormElement::IsHTMLFocusable(aWithMouse, aIsFocusable, aTabIndex)) {
     return true;
   }
 
   if (IsDisabled()) {
     *aIsFocusable = false;
     return true;
@@ -4687,31 +4686,31 @@ nsHTMLInputElement::IsHTMLFocusable(bool
   if (currentRadio) {
     *aTabIndex = -1;
   }
   *aIsFocusable = defaultFocusable;
   return false;
 }
 
 nsresult
-nsHTMLInputElement::VisitGroup(nsIRadioVisitor* aVisitor, bool aFlushContent)
+HTMLInputElement::VisitGroup(nsIRadioVisitor* aVisitor, bool aFlushContent)
 {
   nsIRadioGroupContainer* container = GetRadioGroupContainer();
   if (container) {
     nsAutoString name;
     GetAttr(kNameSpaceID_None, nsGkAtoms::name, name);
     return container->WalkRadioGroup(name, aVisitor, aFlushContent);
   }
 
   aVisitor->Visit(this);
   return NS_OK;
 }
 
-nsHTMLInputElement::ValueModeType
-nsHTMLInputElement::GetValueMode() const
+HTMLInputElement::ValueModeType
+HTMLInputElement::GetValueMode() const
 {
   switch (mType)
   {
     case NS_FORM_INPUT_HIDDEN:
     case NS_FORM_INPUT_SUBMIT:
     case NS_FORM_INPUT_BUTTON:
     case NS_FORM_INPUT_RESET:
     case NS_FORM_INPUT_IMAGE:
@@ -4739,25 +4738,25 @@ nsHTMLInputElement::GetValueMode() const
 #else // DEBUG
     default:
       return VALUE_MODE_VALUE;
 #endif // DEBUG
   }
 }
 
 bool
-nsHTMLInputElement::IsMutable() const
+HTMLInputElement::IsMutable() const
 {
   return !IsDisabled() && GetCurrentDoc() &&
          !(DoesReadOnlyApply() &&
            HasAttr(kNameSpaceID_None, nsGkAtoms::readonly));
 }
 
 bool
-nsHTMLInputElement::DoesReadOnlyApply() const
+HTMLInputElement::DoesReadOnlyApply() const
 {
   switch (mType)
   {
     case NS_FORM_INPUT_HIDDEN:
     case NS_FORM_INPUT_BUTTON:
     case NS_FORM_INPUT_IMAGE:
     case NS_FORM_INPUT_RESET:
     case NS_FORM_INPUT_SUBMIT:
@@ -4785,17 +4784,17 @@ nsHTMLInputElement::DoesReadOnlyApply() 
 #else // DEBUG
     default:
       return true;
 #endif // DEBUG
   }
 }
 
 bool
-nsHTMLInputElement::DoesRequiredApply() const
+HTMLInputElement::DoesRequiredApply() const
 {
   switch (mType)
   {
     case NS_FORM_INPUT_HIDDEN:
     case NS_FORM_INPUT_BUTTON:
     case NS_FORM_INPUT_IMAGE:
     case NS_FORM_INPUT_RESET:
     case NS_FORM_INPUT_SUBMIT:
@@ -4823,39 +4822,39 @@ nsHTMLInputElement::DoesRequiredApply() 
 #else // DEBUG
     default:
       return true;
 #endif // DEBUG
   }
 }
 
 bool
-nsHTMLInputElement::PlaceholderApplies() const
+HTMLInputElement::PlaceholderApplies() const
 {
   if (mType == NS_FORM_INPUT_DATE ||
       mType == NS_FORM_INPUT_TIME) {
     return false;
   }
 
   return IsSingleLineTextControl(false);
 }
 
 bool
-nsHTMLInputElement::DoesPatternApply() const
+HTMLInputElement::DoesPatternApply() const
 {
   // TODO: temporary until bug 635240 and bug 773205 are fixed.
   if (IsExperimentalMobileType(mType)) {
     return false;
   }
 
   return IsSingleLineTextControl(false);
 }
 
 bool
-nsHTMLInputElement::DoesMinMaxApply() const
+HTMLInputElement::DoesMinMaxApply() const
 {
   switch (mType)
   {
     case NS_FORM_INPUT_NUMBER:
     case NS_FORM_INPUT_DATE:
     case NS_FORM_INPUT_TIME:
     case NS_FORM_INPUT_RANGE:
     // TODO:
@@ -4883,17 +4882,17 @@ nsHTMLInputElement::DoesMinMaxApply() co
 #else // DEBUG
     default:
       return false;
 #endif // DEBUG
   }
 }
 
 double
-nsHTMLInputElement::GetStep() const
+HTMLInputElement::GetStep() const
 {
   MOZ_ASSERT(DoesStepApply(), "GetStep() can only be called if @step applies");
 
   if (!HasAttr(kNameSpaceID_None, nsGkAtoms::step)) {
     return GetDefaultStep() * GetStepScaleFactor();
   }
 
   nsAutoString stepStr;
@@ -4913,27 +4912,27 @@ nsHTMLInputElement::GetStep() const
   // TODO: This multiplication can lead to inexact results, we should use a
   // type that supports a better precision than double. Bug 783607.
   return step * GetStepScaleFactor();
 }
 
 // nsIConstraintValidation
 
 NS_IMETHODIMP
-nsHTMLInputElement::SetCustomValidity(const nsAString& aError)
+HTMLInputElement::SetCustomValidity(const nsAString& aError)
 {
   nsIConstraintValidation::SetCustomValidity(aError);
 
   UpdateState(true);
 
   return NS_OK;
 }
 
 bool
-nsHTMLInputElement::IsTooLong()
+HTMLInputElement::IsTooLong()
 {
   if (!MaxLengthApplies() ||
       !HasAttr(kNameSpaceID_None, nsGkAtoms::maxlength) ||
       !mValueChanged) {
     return false;
   }
 
   int32_t maxLength = -1;
@@ -4946,17 +4945,17 @@ nsHTMLInputElement::IsTooLong()
 
   int32_t textLength = -1;
   GetTextLength(&textLength);
 
   return textLength > maxLength;
 }
 
 bool
-nsHTMLInputElement::IsValueMissing() const
+HTMLInputElement::IsValueMissing() const
 {
   // Should use UpdateValueMissingValidityStateForRadio() for type radio.
   MOZ_ASSERT(mType != NS_FORM_INPUT_RADIO);
 
   if (!HasAttr(kNameSpaceID_None, nsGkAtoms::required) ||
       !DoesRequiredApply()) {
     return false;
   }
@@ -4979,17 +4978,17 @@ nsHTMLInputElement::IsValueMissing() con
       return !mChecked;
     case VALUE_MODE_DEFAULT:
     default:
       return false;
   }
 }
 
 bool
-nsHTMLInputElement::HasTypeMismatch() const
+HTMLInputElement::HasTypeMismatch() const
 {
   if (mType != NS_FORM_INPUT_EMAIL && mType != NS_FORM_INPUT_URL) {
     return false;
   }
 
   nsAutoString value;
   NS_ENSURE_SUCCESS(GetValueInternal(value), false);
 
@@ -5018,17 +5017,17 @@ nsHTMLInputElement::HasTypeMismatch() co
     return !NS_SUCCEEDED(ioService->NewURI(NS_ConvertUTF16toUTF8(value), nullptr,
                                            nullptr, getter_AddRefs(uri)));
   }
 
   return false;
 }
 
 bool
-nsHTMLInputElement::HasPatternMismatch() const
+HTMLInputElement::HasPatternMismatch() const
 {
   if (!DoesPatternApply() ||
       !HasAttr(kNameSpaceID_None, nsGkAtoms::pattern)) {
     return false;
   }
 
   nsAutoString pattern;
   GetAttr(kNameSpaceID_None, nsGkAtoms::pattern, pattern);
@@ -5041,17 +5040,17 @@ nsHTMLInputElement::HasPatternMismatch()
   }
 
   nsIDocument* doc = OwnerDoc();
 
   return !nsContentUtils::IsPatternMatching(value, pattern, doc);
 }
 
 bool
-nsHTMLInputElement::IsRangeOverflow() const
+HTMLInputElement::IsRangeOverflow() const
 {
   if (!DoesMinMaxApply()) {
     return false;
   }
 
   double maximum = GetMaximum();
   if (MOZ_DOUBLE_IS_NaN(maximum)) {
     return false;
@@ -5061,17 +5060,17 @@ nsHTMLInputElement::IsRangeOverflow() co
   if (MOZ_DOUBLE_IS_NaN(value)) {
     return false;
   }
 
   return value > maximum;
 }
 
 bool
-nsHTMLInputElement::IsRangeUnderflow() const
+HTMLInputElement::IsRangeUnderflow() const
 {
   if (!DoesMinMaxApply()) {
     return false;
   }
 
   double minimum = GetMinimum();
   if (MOZ_DOUBLE_IS_NaN(minimum)) {
     return false;
@@ -5081,17 +5080,17 @@ nsHTMLInputElement::IsRangeUnderflow() c
   if (MOZ_DOUBLE_IS_NaN(value)) {
     return false;
   }
 
   return value < minimum;
 }
 
 bool
-nsHTMLInputElement::HasStepMismatch() const
+HTMLInputElement::HasStepMismatch() const
 {
   if (!DoesStepApply()) {
     return false;
   }
 
   double value = GetValueAsDouble();
   if (MOZ_DOUBLE_IS_NaN(value)) {
     // The element can't suffer from step mismatch if it's value isn't a number.
@@ -5112,26 +5111,26 @@ nsHTMLInputElement::HasStepMismatch() co
     step = NS_round(step);
   }
 
   // Value has to be an integral multiple of step.
   return NS_floorModulo(value - GetStepBase(), step) != 0;
 }
 
 void
-nsHTMLInputElement::UpdateTooLongValidityState()
+HTMLInputElement::UpdateTooLongValidityState()
 {
   // TODO: this code will be re-enabled with bug 613016 and bug 613019.
 #if 0
   SetValidityState(VALIDITY_STATE_TOO_LONG, IsTooLong());
 #endif
 }
 
 void
-nsHTMLInputElement::UpdateValueMissingValidityStateForRadio(bool aIgnoreSelf)
+HTMLInputElement::UpdateValueMissingValidityStateForRadio(bool aIgnoreSelf)
 {
   bool notify = !mParserCreating;
   nsCOMPtr<nsIDOMHTMLInputElement> selection = GetSelectedRadioButton();
 
   // If there is no selection, that might mean the radio is not in a group.
   // In that case, we can look for the checked state of the radio.
   bool selected = selection || (!aIgnoreSelf && mChecked);
   bool required = !aIgnoreSelf && HasAttr(kNameSpaceID_None, nsGkAtoms::required);
@@ -5167,87 +5166,87 @@ nsHTMLInputElement::UpdateValueMissingVa
     nsAutoScriptBlocker scriptBlocker;
     nsCOMPtr<nsIRadioVisitor> visitor =
       new nsRadioSetValueMissingState(this, valueMissing, notify);
     VisitGroup(visitor, notify);
   }
 }
 
 void
-nsHTMLInputElement::UpdateValueMissingValidityState()
+HTMLInputElement::UpdateValueMissingValidityState()
 {
   if (mType == NS_FORM_INPUT_RADIO) {
     UpdateValueMissingValidityStateForRadio(false);
     return;
   }
 
   SetValidityState(VALIDITY_STATE_VALUE_MISSING, IsValueMissing());
 }
 
 void
-nsHTMLInputElement::UpdateTypeMismatchValidityState()
+HTMLInputElement::UpdateTypeMismatchValidityState()
 {
     SetValidityState(VALIDITY_STATE_TYPE_MISMATCH, HasTypeMismatch());
 }
 
 void
-nsHTMLInputElement::UpdatePatternMismatchValidityState()
+HTMLInputElement::UpdatePatternMismatchValidityState()
 {
   SetValidityState(VALIDITY_STATE_PATTERN_MISMATCH, HasPatternMismatch());
 }
 
 void
-nsHTMLInputElement::UpdateRangeOverflowValidityState()
+HTMLInputElement::UpdateRangeOverflowValidityState()
 {
   SetValidityState(VALIDITY_STATE_RANGE_OVERFLOW, IsRangeOverflow());
 }
 
 void
-nsHTMLInputElement::UpdateRangeUnderflowValidityState()
+HTMLInputElement::UpdateRangeUnderflowValidityState()
 {
   SetValidityState(VALIDITY_STATE_RANGE_UNDERFLOW, IsRangeUnderflow());
 }
 
 void
-nsHTMLInputElement::UpdateStepMismatchValidityState()
+HTMLInputElement::UpdateStepMismatchValidityState()
 {
   SetValidityState(VALIDITY_STATE_STEP_MISMATCH, HasStepMismatch());
 }
 
 void
-nsHTMLInputElement::UpdateAllValidityStates(bool aNotify)
+HTMLInputElement::UpdateAllValidityStates(bool aNotify)
 {
   bool validBefore = IsValid();
   UpdateTooLongValidityState();
   UpdateValueMissingValidityState();
   UpdateTypeMismatchValidityState();
   UpdatePatternMismatchValidityState();
   UpdateRangeOverflowValidityState();
   UpdateRangeUnderflowValidityState();
   UpdateStepMismatchValidityState();
 
   if (validBefore != IsValid()) {
     UpdateState(aNotify);
   }
 }
 
 void
-nsHTMLInputElement::UpdateBarredFromConstraintValidation()
+HTMLInputElement::UpdateBarredFromConstraintValidation()
 {
   SetBarredFromConstraintValidation(mType == NS_FORM_INPUT_HIDDEN ||
                                     mType == NS_FORM_INPUT_BUTTON ||
                                     mType == NS_FORM_INPUT_RESET ||
                                     mType == NS_FORM_INPUT_SUBMIT ||
                                     mType == NS_FORM_INPUT_IMAGE ||
                                     HasAttr(kNameSpaceID_None, nsGkAtoms::readonly) ||
                                     IsDisabled());
 }
 
 nsresult
-nsHTMLInputElement::GetValidationMessage(nsAString& aValidationMessage,
+HTMLInputElement::GetValidationMessage(nsAString& aValidationMessage,
                                          ValidityStateType aType)
 {
   nsresult rv = NS_OK;
 
   switch (aType)
   {
     case VALIDITY_STATE_TOO_LONG:
     {
@@ -5439,32 +5438,32 @@ nsHTMLInputElement::GetValidationMessage
       rv = nsIConstraintValidation::GetValidationMessage(aValidationMessage, aType);
   }
 
   return rv;
 }
 
 //static
 bool
-nsHTMLInputElement::IsValidEmailAddressList(const nsAString& aValue)
+HTMLInputElement::IsValidEmailAddressList(const nsAString& aValue)
 {
   HTMLSplitOnSpacesTokenizer tokenizer(aValue, ',');
 
   while (tokenizer.hasMoreTokens()) {
     if (!IsValidEmailAddress(tokenizer.nextToken())) {
       return false;
     }
   }
 
   return !tokenizer.lastTokenEndedWithSeparator();
 }
 
 //static
 bool
-nsHTMLInputElement::IsValidEmailAddress(const nsAString& aValue)
+HTMLInputElement::IsValidEmailAddress(const nsAString& aValue)
 {
   nsAutoCString value = NS_ConvertUTF16toUTF8(aValue);
   uint32_t i = 0;
   uint32_t length = value.Length();
 
   // Puny-encode the string if needed before running the validation algorithm.
   nsCOMPtr<nsIIDNService> idnSrv = do_GetService(NS_IDNSERVICE_CONTRACTID);
   if (idnSrv) {
@@ -5526,143 +5525,143 @@ nsHTMLInputElement::IsValidEmailAddress(
       return false;
     }
   }
 
   return true;
 }
 
 NS_IMETHODIMP_(bool)
-nsHTMLInputElement::IsSingleLineTextControl() const
+HTMLInputElement::IsSingleLineTextControl() const
 {
   return IsSingleLineTextControl(false);
 }
 
 NS_IMETHODIMP_(bool)
-nsHTMLInputElement::IsTextArea() const
+HTMLInputElement::IsTextArea() const
 {
   return false;
 }
 
 NS_IMETHODIMP_(bool)
-nsHTMLInputElement::IsPlainTextControl() const
+HTMLInputElement::IsPlainTextControl() const
 {
   // need to check our HTML attribute and/or CSS.
   return true;
 }
 
 NS_IMETHODIMP_(bool)
-nsHTMLInputElement::IsPasswordTextControl() const
+HTMLInputElement::IsPasswordTextControl() const
 {
   return mType == NS_FORM_INPUT_PASSWORD;
 }
 
 NS_IMETHODIMP_(int32_t)
-nsHTMLInputElement::GetCols()
+HTMLInputElement::GetCols()
 {
   // Else we know (assume) it is an input with size attr
   const nsAttrValue* attr = GetParsedAttr(nsGkAtoms::size);
   if (attr && attr->Type() == nsAttrValue::eInteger) {
     int32_t cols = attr->GetIntegerValue();
     if (cols > 0) {
       return cols;
     }
   }
 
   return DEFAULT_COLS;
 }
 
 NS_IMETHODIMP_(int32_t)
-nsHTMLInputElement::GetWrapCols()
+HTMLInputElement::GetWrapCols()
 {
   return -1; // only textarea's can have wrap cols
 }
 
 NS_IMETHODIMP_(int32_t)
-nsHTMLInputElement::GetRows()
+HTMLInputElement::GetRows()
 {
   return DEFAULT_ROWS;
 }
 
 NS_IMETHODIMP_(void)
-nsHTMLInputElement::GetDefaultValueFromContent(nsAString& aValue)
+HTMLInputElement::GetDefaultValueFromContent(nsAString& aValue)
 {
   nsTextEditorState *state = GetEditorState();
   if (state) {
     GetDefaultValue(aValue);
     // This is called by the frame to show the value.
     // We have to sanitize it when needed.
     if (!mParserCreating) {
       SanitizeValue(aValue);
     }
   }
 }
 
 NS_IMETHODIMP_(bool)
-nsHTMLInputElement::ValueChanged() const
+HTMLInputElement::ValueChanged() const
 {
   return mValueChanged;
 }
 
 NS_IMETHODIMP_(void)
-nsHTMLInputElement::GetTextEditorValue(nsAString& aValue,
-                                       bool aIgnoreWrap) const
+HTMLInputElement::GetTextEditorValue(nsAString& aValue,
+                                     bool aIgnoreWrap) const
 {
   nsTextEditorState *state = GetEditorState();
   if (state) {
     state->GetValue(aValue, aIgnoreWrap);
   }
 }
 
 NS_IMETHODIMP_(void)
-nsHTMLInputElement::InitializeKeyboardEventListeners()
+HTMLInputElement::InitializeKeyboardEventListeners()
 {
   nsTextEditorState *state = GetEditorState();
   if (state) {
     state->InitializeKeyboardEventListeners();
   }
 }
 
 NS_IMETHODIMP_(void)
-nsHTMLInputElement::OnValueChanged(bool aNotify)
+HTMLInputElement::OnValueChanged(bool aNotify)
 {
   UpdateAllValidityStates(aNotify);
 
   if (HasDirAuto()) {
     SetDirectionIfAuto(true, aNotify);
   }
 }
 
 NS_IMETHODIMP_(bool)
-nsHTMLInputElement::HasCachedSelection()
+HTMLInputElement::HasCachedSelection()
 {
   bool isCached = false;
   nsTextEditorState *state = GetEditorState();
   if (state) {
     isCached = state->IsSelectionCached() &&
                state->HasNeverInitializedBefore() &&
                !state->GetSelectionProperties().IsDefault();
     if (isCached) {
       state->WillInitEagerly();
     }
   }
   return isCached;
 }
 
 void
-nsHTMLInputElement::FieldSetDisabledChanged(bool aNotify)
+HTMLInputElement::FieldSetDisabledChanged(bool aNotify)
 {
   UpdateValueMissingValidityState();
   UpdateBarredFromConstraintValidation();
 
   nsGenericHTMLFormElement::FieldSetDisabledChanged(aNotify);
 }
 
 void
-nsHTMLInputElement::SetFilePickerFiltersFromAccept(nsIFilePicker* filePicker)
+HTMLInputElement::SetFilePickerFiltersFromAccept(nsIFilePicker* filePicker)
 {
   // We always add |filterAll|
   filePicker->AppendFilters(nsIFilePicker::filterAll);
 
   NS_ASSERTION(HasAttr(kNameSpaceID_None, nsGkAtoms::accept),
                "You should not call SetFilePickerFiltersFromAccept if the"
                " element has no accept attribute!");
 
@@ -5799,17 +5798,17 @@ nsHTMLInputElement::SetFilePickerFilters
   if (filters.Length() >= 1 && allFilterAreTrusted) {
     // |filterAll| will always use index=0 so we need to set index=1 as the
     // current filter.
     filePicker->SetFilterIndex(1);
   }
 }
 
 int32_t
-nsHTMLInputElement::GetFilterFromAccept()
+HTMLInputElement::GetFilterFromAccept()
 {
   NS_ASSERTION(HasAttr(kNameSpaceID_None, nsGkAtoms::accept),
                "You should not call GetFileFiltersFromAccept if the element"
                " has no accept attribute!");
 
   int32_t filter = 0;
   nsAutoString accept;
   GetAttr(kNameSpaceID_None, nsGkAtoms::accept, accept);
@@ -5837,17 +5836,17 @@ nsHTMLInputElement::GetFilterFromAccept(
       filter = tokenFilter;
     }
   }
 
   return filter;
 }
 
 double
-nsHTMLInputElement::GetStepScaleFactor() const
+HTMLInputElement::GetStepScaleFactor() const
 {
   MOZ_ASSERT(DoesStepApply());
 
   switch (mType) {
     case NS_FORM_INPUT_DATE:
       return kStepScaleFactorDate;
     case NS_FORM_INPUT_NUMBER:
     case NS_FORM_INPUT_RANGE:
@@ -5856,17 +5855,17 @@ nsHTMLInputElement::GetStepScaleFactor()
       return kStepScaleFactorTime;
     default:
       MOZ_NOT_REACHED();
       return MOZ_DOUBLE_NaN();
   }
 }
 
 double
-nsHTMLInputElement::GetDefaultStep() const
+HTMLInputElement::GetDefaultStep() const
 {
   MOZ_ASSERT(DoesStepApply());
 
   switch (mType) {
     case NS_FORM_INPUT_DATE:
     case NS_FORM_INPUT_NUMBER:
     case NS_FORM_INPUT_RANGE:
       return kDefaultStep;
@@ -5874,34 +5873,34 @@ nsHTMLInputElement::GetDefaultStep() con
       return kDefaultStepTime;
     default:
       MOZ_NOT_REACHED();
       return MOZ_DOUBLE_NaN();
   }
 }
 
 void
-nsHTMLInputElement::UpdateValidityUIBits(bool aIsFocused)
+HTMLInputElement::UpdateValidityUIBits(bool aIsFocused)
 {
   if (aIsFocused) {
     // If the invalid UI is shown, we should show it while focusing (and
     // update). Otherwise, we should not.
     mCanShowInvalidUI = !IsValid() && ShouldShowValidityUI();
 
     // If neither invalid UI nor valid UI is shown, we shouldn't show the valid
     // UI while typing.
     mCanShowValidUI = ShouldShowValidityUI();
   } else {
     mCanShowInvalidUI = true;
     mCanShowValidUI = true;
   }
 }
 
 void
-nsHTMLInputElement::UpdateHasRange()
+HTMLInputElement::UpdateHasRange()
 {
   /*
    * There is a range if min/max applies for the type and if the element
    * currently have a valid min or max.
    */
 
   mHasRange = false;
 
@@ -5916,8 +5915,11 @@ nsHTMLInputElement::UpdateHasRange()
   }
 
   double maximum = GetMaximum();
   if (!MOZ_DOUBLE_IS_NaN(maximum)) {
     mHasRange = true;
     return;
   }
 }
+
+} // namespace dom
+} // namespace mozilla
rename from content/html/content/src/nsHTMLInputElement.h
rename to content/html/content/src/HTMLInputElement.h
--- a/content/html/content/src/nsHTMLInputElement.h
+++ b/content/html/content/src/HTMLInputElement.h
@@ -1,15 +1,15 @@
 /* -*- Mode: C++; 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/. */
 
-#ifndef nsHTMLInputElement_h__
-#define nsHTMLInputElement_h__
+#ifndef mozilla_dom_HTMLInputElement_h
+#define mozilla_dom_HTMLInputElement_h
 
 #include "nsGenericHTMLElement.h"
 #include "nsImageLoadingContent.h"
 #include "nsIDOMHTMLInputElement.h"
 #include "nsITextControlElement.h"
 #include "nsIPhonetic.h"
 #include "nsIDOMNSEditableElement.h"
 #include "nsTextEditorState.h"
@@ -21,16 +21,19 @@
 #include "nsIFilePicker.h"
 
 class nsDOMFileList;
 class nsIFilePicker;
 class nsIRadioGroupContainer;
 class nsIRadioGroupVisitor;
 class nsIRadioVisitor;
 
+namespace mozilla {
+namespace dom {
+
 class UploadLastDir MOZ_FINAL : public nsIObserver, public nsSupportsWeakReference {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIOBSERVER
 
   /**
    * Fetch the last used directory for this location from the content
    * pref service, if it is available.
@@ -45,46 +48,46 @@ public:
    * content pref service, if it is available
    * @param aURI URI of the current page
    * @param aDomFile file chosen by the user - the path to the parent of this
    *        file will be stored
    */
   nsresult StoreLastUsedDirectory(nsIDocument* aDoc, nsIDOMFile* aDomFile);
 };
 
-class nsHTMLInputElement : public nsGenericHTMLFormElement,
-                           public nsImageLoadingContent,
-                           public nsIDOMHTMLInputElement,
-                           public nsITextControlElement,
-                           public nsIPhonetic,
-                           public nsIDOMNSEditableElement,
-                           public nsIConstraintValidation
+class HTMLInputElement : public nsGenericHTMLFormElement,
+                         public nsImageLoadingContent,
+                         public nsIDOMHTMLInputElement,
+                         public nsITextControlElement,
+                         public nsIPhonetic,
+                         public nsIDOMNSEditableElement,
+                         public nsIConstraintValidation
 {
 public:
   using nsIConstraintValidation::GetValidationMessage;
 
-  nsHTMLInputElement(already_AddRefed<nsINodeInfo> aNodeInfo,
-                     mozilla::dom::FromParser aFromParser);
-  virtual ~nsHTMLInputElement();
+  HTMLInputElement(already_AddRefed<nsINodeInfo> aNodeInfo,
+                   mozilla::dom::FromParser aFromParser);
+  virtual ~HTMLInputElement();
 
-  NS_IMPL_FROMCONTENT_HTML_WITH_TAG(nsHTMLInputElement, input)
+  NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLInputElement, input)
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE_TO_NSINODE
 
   // nsIDOMElement
   NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
 
   // nsIDOMHTMLElement
   NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
   virtual int32_t TabIndexDefault() MOZ_OVERRIDE;
-  virtual void Focus(mozilla::ErrorResult& aError) MOZ_OVERRIDE;
+  virtual void Focus(ErrorResult& aError) MOZ_OVERRIDE;
 
   // nsIDOMHTMLInputElement
   NS_DECL_NSIDOMHTMLINPUTELEMENT
 
   // nsIPhonetic
   NS_DECL_NSIPHONETIC
 
   // nsIDOMNSEditableElement
@@ -183,17 +186,17 @@ public:
    * @return the selected button (or null).
    */
   already_AddRefed<nsIDOMHTMLInputElement> GetSelectedRadioButton();
 
   virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   NS_IMETHOD FireAsyncClickHandler();
 
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsHTMLInputElement,
+  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(HTMLInputElement,
                                            nsGenericHTMLFormElement)
 
   static UploadLastDir* gUploadLastDir;
   // create and destroy the static UploadLastDir object for remembering
   // which directory was last used on a site-by-site basis
   static void InitUploadLastDir();
   static void DestroyUploadLastDir();
 
@@ -882,38 +885,41 @@ private:
     // For now, only mask filters are considered to be "trusted".
     bool mIsTrusted; 
   };
 
   class AsyncClickHandler
     : public nsRunnable
   {
   public:
-    AsyncClickHandler(nsHTMLInputElement* aInput);
+    AsyncClickHandler(HTMLInputElement* aInput);
     NS_IMETHOD Run();
 
   protected:
-    nsRefPtr<nsHTMLInputElement> mInput;
+    nsRefPtr<HTMLInputElement> mInput;
     PopupControlState mPopupControlState;
   };
 
   class nsFilePickerShownCallback
     : public nsIFilePickerShownCallback
   {
   public:
-    nsFilePickerShownCallback(nsHTMLInputElement* aInput,
+    nsFilePickerShownCallback(HTMLInputElement* aInput,
                               nsIFilePicker* aFilePicker,
                               bool aMulti);
     virtual ~nsFilePickerShownCallback()
     { }
 
     NS_DECL_ISUPPORTS
 
     NS_IMETHOD Done(int16_t aResult);
 
   private:
     nsCOMPtr<nsIFilePicker> mFilePicker;
-    nsRefPtr<nsHTMLInputElement> mInput;
+    nsRefPtr<HTMLInputElement> mInput;
     bool mMulti;
   };
 };
 
+} // namespace dom
+} // namespace mozilla
+
 #endif
--- a/content/html/content/src/HTMLLabelElement.cpp
+++ b/content/html/content/src/HTMLLabelElement.cpp
@@ -179,17 +179,17 @@ HTMLLabelElement::PostHandleEvent(nsEven
               event->IsShift() || event->IsControl() || event->IsAlt() ||
               event->IsMeta()) {
             break;
           }
 
           nsIFocusManager* fm = nsFocusManager::GetFocusManager();
           if (fm) {
             // Use FLAG_BYMOVEFOCUS here so that the label is scrolled to.
-            // Also, within nsHTMLInputElement::PostHandleEvent, inputs will
+            // Also, within HTMLInputElement::PostHandleEvent, inputs will
             // be selected only when focused via a key or when the navigation
             // flag is used and we want to select the text on label clicks as
             // well.
             nsCOMPtr<nsIDOMElement> elem = do_QueryInterface(content);
             fm->SetFocus(elem, nsIFocusManager::FLAG_BYMOVEFOCUS);
           }
 
           // Dispatch a new click event to |content|
--- a/content/html/content/src/HTMLTextAreaElement.cpp
+++ b/content/html/content/src/HTMLTextAreaElement.cpp
@@ -142,17 +142,17 @@ HTMLTextAreaElement::Select()
     if (fm)
       fm->SetFocus(this, nsIFocusManager::FLAG_NOSCROLL);
     SelectAll(presContext);
     return NS_OK;
   }
 
   nsEventStatus status = nsEventStatus_eIgnore;
   nsGUIEvent event(true, NS_FORM_SELECTED, nullptr);
-  // XXXbz nsHTMLInputElement guards against this reentering; shouldn't we?
+  // XXXbz HTMLInputElement guards against this reentering; shouldn't we?
   nsEventDispatcher::Dispatch(static_cast<nsIContent*>(this), presContext,
                               &event, nullptr, &status);
 
   // If the DOM event was not canceled (e.g. by a JS event handler
   // returning false)
   if (status == nsEventStatus_eIgnore) {
     if (fm) {
       fm->SetFocus(this, nsIFocusManager::FLAG_NOSCROLL);
--- a/content/html/content/src/Makefile.in
+++ b/content/html/content/src/Makefile.in
@@ -38,16 +38,17 @@ EXPORTS_mozilla/dom = \
 		HTMLFieldSetElement.h \
 		HTMLFontElement.h \
 		HTMLFrameElement.h \
 		HTMLFrameSetElement.h \
 		HTMLHeadingElement.h \
 		HTMLHRElement.h \
 		HTMLIFrameElement.h \
 		HTMLImageElement.h \
+		HTMLInputElement.h \
 		HTMLLabelElement.h \
 		HTMLLegendElement.h \
 		HTMLLIElement.h \
 		HTMLLinkElement.h \
 		HTMLMapElement.h \
 		HTMLMenuElement.h \
 		HTMLMenuItemElement.h \
 		HTMLMetaElement.h \
@@ -105,17 +106,17 @@ CPPSRCS		= \
 		HTMLFontElement.cpp \
 		nsHTMLFormElement.cpp \
 		HTMLFrameElement.cpp \
 		HTMLFrameSetElement.cpp \
 		HTMLHRElement.cpp \
 		HTMLHeadingElement.cpp \
 		HTMLIFrameElement.cpp \
 		HTMLImageElement.cpp \
-		nsHTMLInputElement.cpp \
+		HTMLInputElement.cpp \
 		HTMLLIElement.cpp \
 		HTMLLabelElement.cpp \
 		HTMLLegendElement.cpp \
 		HTMLLinkElement.cpp \
 		HTMLMapElement.cpp \
 		HTMLMenuElement.cpp \
 		HTMLMenuItemElement.cpp \
 		HTMLMetaElement.cpp \
--- a/content/html/content/src/nsHTMLFormElement.cpp
+++ b/content/html/content/src/nsHTMLFormElement.cpp
@@ -33,17 +33,17 @@
 #include "nsNetUtil.h"
 #include "nsIWebProgress.h"
 #include "nsIDocShell.h"
 #include "nsFormData.h"
 #include "nsFormSubmissionConstants.h"
 
 // radio buttons
 #include "nsIDOMHTMLInputElement.h"
-#include "nsHTMLInputElement.h"
+#include "mozilla/dom/HTMLInputElement.h"
 #include "nsIRadioVisitor.h"
 
 #include "nsLayoutUtils.h"
 
 #include "nsEventDispatcher.h"
 
 #include "mozAutoDocUpdate.h"
 #include "nsIHTMLCollection.h"
@@ -1235,18 +1235,18 @@ nsHTMLFormElement::AddElement(nsGenericH
       UpdateValidity(false);
     }
   }
 
   // Notify the radio button it's been added to a group
   // This has to be done _after_ UpdateValidity() call to prevent the element
   // being count twice.
   if (type == NS_FORM_INPUT_RADIO) {
-    nsRefPtr<nsHTMLInputElement> radio =
-      static_cast<nsHTMLInputElement*>(aChild);
+    nsRefPtr<HTMLInputElement> radio =
+      static_cast<HTMLInputElement*>(aChild);
     radio->AddedToRadioGroup();
   }
 
   return NS_OK;
 }
 
 nsresult
 nsHTMLFormElement::AddElementToTable(nsGenericHTMLFormElement* aChild,
@@ -1260,18 +1260,18 @@ nsresult
 nsHTMLFormElement::RemoveElement(nsGenericHTMLFormElement* aChild,
                                  bool aUpdateValidity)
 {
   //
   // Remove it from the radio group if it's a radio button
   //
   nsresult rv = NS_OK;
   if (aChild->GetType() == NS_FORM_INPUT_RADIO) {
-    nsRefPtr<nsHTMLInputElement> radio =
-      static_cast<nsHTMLInputElement*>(aChild);
+    nsRefPtr<HTMLInputElement> radio =
+      static_cast<HTMLInputElement*>(aChild);
     radio->WillRemoveFromRadioGroup();
   }
 
   // Determine whether to remove the child from the elements list
   // or the not in elements list.
   bool childInElements = ShouldBeInElements(aChild);
   nsTArray<nsGenericHTMLFormElement*>& controls = childInElements ?
       mControls->mElements :  mControls->mNotInElements;
@@ -1741,17 +1741,17 @@ nsHTMLFormElement::CheckValidFormSubmiss
         nsAutoScriptBlocker scriptBlocker;
 
         for (uint32_t i = 0, length = mControls->mElements.Length();
              i < length; ++i) {
           // Input elements can trigger a form submission and we want to
           // update the style in that case.
           if (mControls->mElements[i]->IsHTML(nsGkAtoms::input) &&
               nsContentUtils::IsFocusedContent(mControls->mElements[i])) {
-            static_cast<nsHTMLInputElement*>(mControls->mElements[i])
+            static_cast<HTMLInputElement*>(mControls->mElements[i])
               ->UpdateValidityUIBits(true);
           }
 
           mControls->mElements[i]->UpdateState(true);
         }
 
         // Because of backward compatibility, <input type='image'> is not in
         // elements but can be invalid.
--- a/content/html/content/src/nsRadioVisitor.cpp
+++ b/content/html/content/src/nsRadioVisitor.cpp
@@ -1,56 +1,57 @@
 /* -*- Mode: C++; 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 "nsRadioVisitor.h"
 #include "nsAutoPtr.h"
-#include "nsHTMLInputElement.h"
+#include "mozilla/dom/HTMLInputElement.h"
 #include "nsEventStates.h"
 #include "nsIConstraintValidation.h"
 
+using namespace mozilla::dom;
 
 NS_IMPL_ISUPPORTS1(nsRadioVisitor, nsIRadioVisitor)
 
 bool
 nsRadioSetCheckedChangedVisitor::Visit(nsIFormControl* aRadio)
 {
-  nsRefPtr<nsHTMLInputElement> radio =
-    static_cast<nsHTMLInputElement*>(aRadio);
+  nsRefPtr<HTMLInputElement> radio =
+    static_cast<HTMLInputElement*>(aRadio);
   NS_ASSERTION(radio, "Visit() passed a null button!");
 
   radio->SetCheckedChangedInternal(mCheckedChanged);
   return true;
 }
 
 bool
 nsRadioGetCheckedChangedVisitor::Visit(nsIFormControl* aRadio)
 {
   if (aRadio == mExcludeElement) {
     return true;
   }
 
-  nsRefPtr<nsHTMLInputElement> radio =
-    static_cast<nsHTMLInputElement*>(aRadio);
+  nsRefPtr<HTMLInputElement> radio =
+    static_cast<HTMLInputElement*>(aRadio);
   NS_ASSERTION(radio, "Visit() passed a null button!");
 
   *mCheckedChanged = radio->GetCheckedChanged();
   return false;
 }
 
 bool
 nsRadioSetValueMissingState::Visit(nsIFormControl* aRadio)
 {
   if (aRadio == mExcludeElement) {
     return true;
   }
 
-  nsHTMLInputElement* input = static_cast<nsHTMLInputElement*>(aRadio);
+  HTMLInputElement* input = static_cast<HTMLInputElement*>(aRadio);
 
   input->SetValidityState(nsIConstraintValidation::VALIDITY_STATE_VALUE_MISSING,
                           mValidity);
 
   input->UpdateState(true);
 
   return true;
 }
--- a/content/html/content/src/nsTextEditorState.h
+++ b/content/html/content/src/nsTextEditorState.h
@@ -28,17 +28,17 @@ class nsITextControlElement;
  * nsTextEditorState is a class which is responsible for managing the state of
  * plaintext controls.  This currently includes the following HTML elements:
  *   <input type=text>
  *   <input type=password>
  *   <textarea>
  * and also XUL controls such as <textbox> which use one of these elements behind
  * the scenes.
  *
- * This class is held as a member of nsHTMLInputElement and nsHTMLTextAreaElement.
+ * This class is held as a member of HTMLInputElement and nsHTMLTextAreaElement.
  * The public functions in this class include the public APIs which content/ uses.
  * Layout code uses the nsITextControlElement interface to invoke functions on this
  * class.
  *
  * The design motivation behind this class is maintaining all of the things which
  * collectively are considered the "state" of the text control in a single location.
  * This state includes several things:
  *
--- a/content/html/content/test/forms/test_experimental_forms_pref.html
+++ b/content/html/content/test/forms/test_experimental_forms_pref.html
@@ -22,17 +22,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   SimpleTest.waitForExplicitFinish();
   SpecialPowers.pushPrefEnv({'set': [["dom.experimental_forms", false]]}, function() {
     input.type = "number";
     is(input.type, "text", "input type shouldn't be number when the experimental forms are disabled");
     is(input.getAttribute('type'), "number", "input 'type' attribute should not change");
 
     SpecialPowers.pushPrefEnv({'set': [["dom.experimental_forms",true]]}, function() {
       // Change the type of input to text and then back to number, 
-      // so that nsHTMLInputElement::ParseAttribute gets called with the pref enabled.
+      // so that HTMLInputElement::ParseAttribute gets called with the pref enabled.
       input.type = "text";
       input.type = "number";
       is(input.type, "number", "input type should be number when the experimental forms are enabled");
       is(input.getAttribute('type'), "number", "input 'type' attribute should not change");
     
       SimpleTest.finish();
     });
   });
--- a/content/smil/nsSMILAnimationFunction.h
+++ b/content/smil/nsSMILAnimationFunction.h
@@ -378,17 +378,16 @@ protected:
     SetErrorFlag(BF_KEY_TIMES, aNewValue);
   }
   inline void SetKeySplinesErrorFlag(bool aNewValue) {
     SetErrorFlag(BF_KEY_SPLINES, aNewValue);
   }
   inline void SetKeyPointsErrorFlag(bool aNewValue) {
     SetErrorFlag(BF_KEY_POINTS, aNewValue);
   }
-  // Helper method -- based on SET_BOOLBIT in nsHTMLInputElement.cpp
   inline void SetErrorFlag(AnimationAttributeIdx aField, bool aValue) {
     if (aValue) {
       mErrorFlags |=  (0x01 << aField);
     } else {
       mErrorFlags &= ~(0x01 << aField);
     }
   }
 
--- a/dom/identity/nsDOMIdentity.js
+++ b/dom/identity/nsDOMIdentity.js
@@ -100,17 +100,17 @@ nsDOMIdentity.prototype = {
 
     let emailType = typeof(aOptions["loggedInUser"]);
     if (aOptions["loggedInUser"] && aOptions["loggedInUser"] !== "undefined") {
       if (emailType !== "string") {
         throw new Error("loggedInUser must be a String or null");
       }
 
       // TODO: Bug 767610 - check email format.
-      // See nsHTMLInputElement::IsValidEmailAddress
+      // See HTMLInputElement::IsValidEmailAddress
       if (aOptions["loggedInUser"].indexOf("@") == -1
           || aOptions["loggedInUser"].length > MAX_STRING_LENGTH) {
         throw new Error("loggedInUser is not valid");
       }
       // Set loggedInUser in this block that "undefined" doesn't get through.
       message.loggedInUser = aOptions.loggedInUser;
     }
     this._log("loggedInUser: " + message.loggedInUser);
--- a/layout/build/nsLayoutStatics.cpp
+++ b/layout/build/nsLayoutStatics.cpp
@@ -49,17 +49,17 @@
 #include "nsTextFragment.h"
 #include "nsCSSRuleProcessor.h"
 #include "nsCrossSiteListenerProxy.h"
 #include "nsHTMLDNSPrefetch.h"
 #include "nsHtml5Module.h"
 #include "nsFocusManager.h"
 #include "nsFrameList.h"
 #include "nsListControlFrame.h"
-#include "nsHTMLInputElement.h"
+#include "mozilla/dom/HTMLInputElement.h"
 #include "SVGElementFactory.h"
 #include "nsSVGUtils.h"
 #include "nsMathMLAtoms.h"
 #include "nsMathMLOperators.h"
 #include "Navigator.h"
 #include "nsDOMStorageBaseDB.h"
 
 #include "AudioChannelService.h"
@@ -370,17 +370,17 @@ nsLayoutStatics::Shutdown()
   nsHtml5Module::ReleaseStatics();
 
   nsRegion::ShutdownStatic();
 
   NS_ShutdownEventTargetChainItemRecyclePool();
 
   nsFrameList::Shutdown();
 
-  nsHTMLInputElement::DestroyUploadLastDir();
+  HTMLInputElement::DestroyUploadLastDir();
 
   nsLayoutUtils::Shutdown();
 
   nsHyphenationManager::Shutdown();
   nsEditorSpellCheck::ShutDown();
   nsDOMMutationObserver::Shutdown();
 
   AudioChannelService::Shutdown();
--- a/layout/forms/nsFileControlFrame.cpp
+++ b/layout/forms/nsFileControlFrame.cpp
@@ -22,17 +22,17 @@
 #include "nsXPCOM.h"
 #include "nsISupportsPrimitives.h"
 #include "nsPIDOMWindow.h"
 #include "nsIFilePicker.h"
 #include "nsIDOMMouseEvent.h"
 #include "nsINodeInfo.h"
 #include "nsIDOMEventTarget.h"
 #include "nsIFile.h"
-#include "nsHTMLInputElement.h"
+#include "mozilla/dom/HTMLInputElement.h"
 #include "nsNodeInfoManager.h"
 #include "nsContentCreatorFunctions.h"
 #include "nsContentUtils.h"
 #include "nsDisplayList.h"
 #include "nsEventListenerManager.h"
 
 #include "nsInterfaceHashtable.h"
 #include "nsURIHashKey.h"
@@ -46,16 +46,17 @@
 #include "nsTextControlFrame.h"
 
 #include "nsIDOMDOMStringList.h"
 #include "nsIDOMDragEvent.h"
 #include "nsContentList.h"
 #include "nsIDOMMutationEvent.h"
 
 using namespace mozilla;
+using namespace mozilla::dom;
 
 nsIFrame*
 NS_NewFileControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
 {
   return new (aPresShell) nsFileControlFrame(aContext);
 }
 
 NS_IMPL_FRAMEARENA_HELPERS(nsFileControlFrame)
@@ -144,17 +145,17 @@ nsFileControlFrame::CreateAnonymousConte
   NS_TrustedNewXULElement(getter_AddRefs(mTextContent), nodeInfo.forget());
   // NOTE: SetNativeAnonymous() has to be called before setting any attribute.
   mTextContent->SetNativeAnonymous();
   mTextContent->SetAttr(kNameSpaceID_None, nsGkAtoms::crop,
                         NS_LITERAL_STRING("center"), false);
 
   // Update the displayed text to reflect the current element's value.
   nsAutoString value;
-  nsHTMLInputElement::FromContent(mContent)->GetDisplayFileName(value);
+  HTMLInputElement::FromContent(mContent)->GetDisplayFileName(value);
   UpdateDisplayedValue(value, false);
 
   if (!aElements.AppendElement(mTextContent)) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   // We should be able to interact with the element by doing drag and drop.
   mContent->AddSystemEventListener(NS_LITERAL_STRING("drop"),
@@ -214,17 +215,17 @@ nsFileControlFrame::DnDListener::HandleE
 
   if (eventType.EqualsLiteral("drop")) {
     aEvent->StopPropagation();
     aEvent->PreventDefault();
 
     nsIContent* content = mFrame->GetContent();
     NS_ASSERTION(content, "The frame has no content???");
 
-    nsHTMLInputElement* inputElement = nsHTMLInputElement::FromContent(content);
+    HTMLInputElement* inputElement = HTMLInputElement::FromContent(content);
     NS_ASSERTION(inputElement, "No input element for this file upload control frame!");
 
     nsCOMPtr<nsIDOMDataTransfer> dataTransfer;
     dragEvent->GetDataTransfer(getter_AddRefs(dataTransfer));
 
     nsCOMPtr<nsIDOMFileList> fileList;
     dataTransfer->GetFiles(getter_AddRefs(fileList));
 
--- a/layout/forms/nsImageControlFrame.cpp
+++ b/layout/forms/nsImageControlFrame.cpp
@@ -177,17 +177,17 @@ nsImageControlFrame::HandleEvent(nsPresC
     return NS_OK;
   }
 
   *aEventStatus = nsEventStatus_eIgnore;
 
   if (aEvent->eventStructType == NS_MOUSE_EVENT &&
       aEvent->message == NS_MOUSE_BUTTON_UP &&
       static_cast<nsMouseEvent*>(aEvent)->button == nsMouseEvent::eLeftButton) {
-    // Store click point for nsHTMLInputElement::SubmitNamesValues
+    // Store click point for HTMLInputElement::SubmitNamesValues
     // Do this on MouseUp because the specs don't say and that's what IE does
     nsIntPoint* lastClickPoint =
       static_cast<nsIntPoint*>
                  (mContent->GetProperty(nsGkAtoms::imageClickedPoint));
     if (lastClickPoint) {
       // normally lastClickedPoint is not null, as it's allocated in Init()
       nsPoint pt = nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, this);
       TranslateEventCoords(pt, *lastClickPoint);
--- a/layout/forms/nsRangeFrame.cpp
+++ b/layout/forms/nsRangeFrame.cpp
@@ -12,27 +12,29 @@
 #include "nsFormControlFrame.h"
 #include "nsIContent.h"
 #include "nsIDocument.h"
 #include "nsIDOMHTMLInputElement.h"
 #include "nsINameSpaceManager.h"
 #include "nsINodeInfo.h"
 #include "nsIPresShell.h"
 #include "nsGkAtoms.h"
-#include "nsHTMLInputElement.h"
+#include "mozilla/dom/HTMLInputElement.h"
 #include "nsPresContext.h"
 #include "nsNodeInfoManager.h"
 #include "nsRenderingContext.h"
 #include "mozilla/dom/Element.h"
 #include "prtypes.h"
 
 #include <algorithm>
 
 #define LONG_SIDE_TO_SHORT_SIDE_RATIO 10
 
+using namespace mozilla;
+
 nsIFrame*
 NS_NewRangeFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
 {
   return new (aPresShell) nsRangeFrame(aContext);
 }
 
 nsRangeFrame::nsRangeFrame(nsStyleContext* aContext)
   : nsContainerFrame(aContext)
@@ -72,17 +74,17 @@ nsRangeFrame::MakeAnonymousDiv(nsIConten
   nsCOMPtr<nsIDocument> doc = mContent->GetDocument();
 
   nsCOMPtr<nsINodeInfo> nodeInfo;
   nodeInfo = doc->NodeInfoManager()->GetNodeInfo(nsGkAtoms::div, nullptr,
                                                  kNameSpaceID_XHTML,
                                                  nsIDOMNode::ELEMENT_NODE);
   NS_ENSURE_TRUE(nodeInfo, NS_ERROR_OUT_OF_MEMORY);
   nsresult rv = NS_NewHTMLElement(aResult, nodeInfo.forget(),
-                                  mozilla::dom::NOT_FROM_PARSER);
+                                  dom::NOT_FROM_PARSER);
   NS_ENSURE_SUCCESS(rv, rv);
   // Associate the pseudo-element with the anonymous child.
   nsRefPtr<nsStyleContext> newStyleContext =
     PresContext()->StyleSet()->ResolvePseudoElementStyle(mContent->AsElement(),
                                                          aPseudoType,
                                                          StyleContext());
 
   if (!aElements.AppendElement(ContentInfo(*aResult, newStyleContext))) {
@@ -306,17 +308,17 @@ nsRangeFrame::ReflowAnonymousContent(nsP
 
   return NS_OK;
 }
 
 double
 nsRangeFrame::GetValueAsFractionOfRange()
 {
   MOZ_ASSERT(mContent->IsHTML(nsGkAtoms::input), "bad cast");
-  nsHTMLInputElement* input = static_cast<nsHTMLInputElement*>(mContent);
+  dom::HTMLInputElement* input = static_cast<dom::HTMLInputElement*>(mContent);
 
   MOZ_ASSERT(input->GetType() == NS_FORM_INPUT_RANGE);
 
   double value = input->GetValueAsDouble();
   double minimum = input->GetMinimum();
   double maximum = input->GetMaximum();
 
   MOZ_ASSERT(MOZ_DOUBLE_IS_FINITE(value) &&
@@ -337,17 +339,17 @@ nsRangeFrame::GetValueAsFractionOfRange(
 double
 nsRangeFrame::GetValueAtEventPoint(nsGUIEvent* aEvent)
 {
   MOZ_ASSERT(aEvent->eventStructType == NS_MOUSE_EVENT ||
              aEvent->eventStructType == NS_TOUCH_EVENT,
              "Unexpected event type - aEvent->refPoint may be meaningless");
 
   MOZ_ASSERT(mContent->IsHTML(nsGkAtoms::input), "bad cast");
-  nsHTMLInputElement* input = static_cast<nsHTMLInputElement*>(mContent);
+  dom::HTMLInputElement* input = static_cast<dom::HTMLInputElement*>(mContent);
 
   MOZ_ASSERT(input->GetType() == NS_FORM_INPUT_RANGE);
 
   double minimum = input->GetMinimum();
   double maximum = input->GetMaximum();
   MOZ_ASSERT(MOZ_DOUBLE_IS_FINITE(minimum) &&
              MOZ_DOUBLE_IS_FINITE(maximum),
              "type=range should have a default maximum/minimum");
@@ -550,25 +552,25 @@ nsRangeFrame::AttributeChanged(int32_t  
   if (aNameSpaceID == kNameSpaceID_None) {
     if (aAttribute == nsGkAtoms::value ||
         aAttribute == nsGkAtoms::min ||
         aAttribute == nsGkAtoms::max ||
         aAttribute == nsGkAtoms::step) {
       // We want to update the position of the thumb, except in one special
       // case: If the value attribute is being set, it is possible that we are
       // in the middle of a type change away from type=range, under the
-      // SetAttr(..., nsGkAtoms::value, ...) call in nsHTMLInputElement::
-      // HandleTypeChange. In that case the nsHTMLInputElement's type will
+      // SetAttr(..., nsGkAtoms::value, ...) call in HTMLInputElement::
+      // HandleTypeChange. In that case the HTMLInputElement's type will
       // already have changed, and if we call UpdateForValueChange()
       // we'll fail the asserts under that call that check the type of our
-      // nsHTMLInputElement. Given that we're changing away from being a range
+      // HTMLInputElement. Given that we're changing away from being a range
       // and this frame will shortly be destroyed, there's no point in calling
       // UpdateForValueChange() anyway.
       MOZ_ASSERT(mContent->IsHTML(nsGkAtoms::input), "bad cast");
-      bool typeIsRange = static_cast<nsHTMLInputElement*>(mContent)->GetType() ==
+      bool typeIsRange = static_cast<dom::HTMLInputElement*>(mContent)->GetType() ==
                            NS_FORM_INPUT_RANGE;
       MOZ_ASSERT(typeIsRange || aAttribute == nsGkAtoms::value, "why?");
       if (typeIsRange) {
         UpdateForValueChange();
       }
     } else if (aAttribute == nsGkAtoms::orient) {
       PresContext()->PresShell()->FrameNeedsReflow(this, nsIPresShell::eResize,
                                                    NS_FRAME_IS_DIRTY);
@@ -643,37 +645,37 @@ nsRangeFrame::GetPrefWidth(nsRenderingCo
   }
 
   return prefWidth;
 }
 
 bool
 nsRangeFrame::IsHorizontal(const nsSize *aFrameSizeOverride) const
 {
-  nsHTMLInputElement* element = static_cast<nsHTMLInputElement*>(mContent);
+  dom::HTMLInputElement* element = static_cast<dom::HTMLInputElement*>(mContent);
   return !element->AttrValueIs(kNameSpaceID_None, nsGkAtoms::orient,
                                nsGkAtoms::vertical, eCaseMatters);
 }
 
 double
 nsRangeFrame::GetMin() const
 {
-  return static_cast<nsHTMLInputElement*>(mContent)->GetMinimum();
+  return static_cast<dom::HTMLInputElement*>(mContent)->GetMinimum();
 }
 
 double
 nsRangeFrame::GetMax() const
 {
-  return static_cast<nsHTMLInputElement*>(mContent)->GetMaximum();
+  return static_cast<dom::HTMLInputElement*>(mContent)->GetMaximum();
 }
 
 double
 nsRangeFrame::GetValue() const
 {
-  return static_cast<nsHTMLInputElement*>(mContent)->GetValueAsDouble();
+  return static_cast<dom::HTMLInputElement*>(mContent)->GetValueAsDouble();
 }
 
 nsIAtom*
 nsRangeFrame::GetType() const
 {
   return nsGkAtoms::rangeFrame;
 }