Bug 893117: Remove nsIDOMHTMLOutputElement r=bz
authorDavid Zbarsky <dzbarsky@gmail.com>
Wed, 31 Jul 2013 23:12:39 -0700
changeset 153182 9f7bac477e2476b7c26a19817d4dbc4da5a60b2f
parent 153181 1ddf2f76d4dfe3f3316d690a984bc4d29a4f3915
child 153183 194aa4dcfb41818be71a20980a221e2af8c45359
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs893117
milestone25.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 893117: Remove nsIDOMHTMLOutputElement r=bz
content/html/content/src/HTMLOutputElement.cpp
content/html/content/src/HTMLOutputElement.h
dom/interfaces/html/moz.build
dom/interfaces/html/nsIDOMHTMLOutputElement.idl
--- a/content/html/content/src/HTMLOutputElement.cpp
+++ b/content/html/content/src/HTMLOutputElement.cpp
@@ -48,39 +48,30 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTokenList)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_IMPL_ADDREF_INHERITED(HTMLOutputElement, Element)
 NS_IMPL_RELEASE_INHERITED(HTMLOutputElement, Element)
 
 NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLOutputElement)
   NS_HTML_CONTENT_INTERFACES(nsGenericHTMLFormElement)
-  NS_INTERFACE_TABLE_INHERITED3(HTMLOutputElement,
-                                nsIDOMHTMLOutputElement,
+  NS_INTERFACE_TABLE_INHERITED2(HTMLOutputElement,
                                 nsIMutationObserver,
                                 nsIConstraintValidation)
   NS_INTERFACE_TABLE_TO_MAP_SEGUE
 NS_ELEMENT_INTERFACE_MAP_END
 
 NS_IMPL_ELEMENT_CLONE(HTMLOutputElement)
 
-
-NS_IMPL_STRING_ATTR(HTMLOutputElement, Name, name)
-
-// nsIConstraintValidation
-NS_IMPL_NSICONSTRAINTVALIDATION_EXCEPT_SETCUSTOMVALIDITY(HTMLOutputElement)
-
-NS_IMETHODIMP
+void
 HTMLOutputElement::SetCustomValidity(const nsAString& aError)
 {
   nsIConstraintValidation::SetCustomValidity(aError);
 
   UpdateState(true);
-
-  return NS_OK;
 }
 
 NS_IMETHODIMP
 HTMLOutputElement::Reset()
 {
   mValueModeFlag = eModeDefault;
   return nsContentUtils::SetNodeTextContent(this, mDefaultValue, true);
 }
@@ -144,77 +135,41 @@ HTMLOutputElement::BindToTree(nsIDocumen
   // might end up a in a novalidate form, and unlike other form
   // controls that on its own is enough to make change ui-valid state.
   // So just go ahead and update our state now.
   UpdateState(false);
 
   return rv;
 }
 
-NS_IMETHODIMP
-HTMLOutputElement::GetForm(nsIDOMHTMLFormElement** aForm)
+void
+HTMLOutputElement::SetValue(const nsAString& aValue, ErrorResult& aRv)
 {
-  return nsGenericHTMLFormElement::GetForm(aForm);
-}
-
-NS_IMETHODIMP
-HTMLOutputElement::GetType(nsAString& aType)
-{
-  aType.AssignLiteral("output");
-  return NS_OK;
+  mValueModeFlag = eModeValue;
+  aRv = nsContentUtils::SetNodeTextContent(this, aValue, true);
 }
 
-NS_IMETHODIMP
-HTMLOutputElement::GetValue(nsAString& aValue)
-{
-  nsContentUtils::GetNodeTextContent(this, true, aValue);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-HTMLOutputElement::SetValue(const nsAString& aValue)
-{
-  mValueModeFlag = eModeValue;
-  return nsContentUtils::SetNodeTextContent(this, aValue, true);
-}
-
-NS_IMETHODIMP
-HTMLOutputElement::GetDefaultValue(nsAString& aDefaultValue)
-{
-  aDefaultValue = mDefaultValue;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-HTMLOutputElement::SetDefaultValue(const nsAString& aDefaultValue)
+void
+HTMLOutputElement::SetDefaultValue(const nsAString& aDefaultValue, ErrorResult& aRv)
 {
   mDefaultValue = aDefaultValue;
   if (mValueModeFlag == eModeDefault) {
-    return nsContentUtils::SetNodeTextContent(this, mDefaultValue, true);
+    aRv = nsContentUtils::SetNodeTextContent(this, mDefaultValue, true);
   }
-
-  return NS_OK;
 }
 
 nsDOMSettableTokenList*
 HTMLOutputElement::HtmlFor()
 {
   if (!mTokenList) {
     mTokenList = new nsDOMSettableTokenList(this, nsGkAtoms::_for);
   }
   return mTokenList;
 }
 
-NS_IMETHODIMP
-HTMLOutputElement::GetHtmlFor(nsISupports** aResult)
-{
-  NS_ADDREF(*aResult = HtmlFor());
-  return NS_OK;
-}
-
 void HTMLOutputElement::DescendantsChanged()
 {
   if (mValueModeFlag == eModeDefault) {
     nsContentUtils::GetNodeTextContent(this, true, mDefaultValue);
   }
 }
 
 // nsIMutationObserver
--- a/content/html/content/src/HTMLOutputElement.h
+++ b/content/html/content/src/HTMLOutputElement.h
@@ -3,25 +3,24 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_HTMLOutputElement_h
 #define mozilla_dom_HTMLOutputElement_h
 
 #include "mozilla/Attributes.h"
 #include "nsGenericHTMLElement.h"
-#include "nsIDOMHTMLOutputElement.h"
 #include "nsStubMutationObserver.h"
 #include "nsIConstraintValidation.h"
 
 namespace mozilla {
 namespace dom {
 
 class HTMLOutputElement MOZ_FINAL : public nsGenericHTMLFormElement,
-                                    public nsIDOMHTMLOutputElement,
+                                    public nsIDOMHTMLElement,
                                     public nsStubMutationObserver,
                                     public nsIConstraintValidation
 {
 public:
   using nsIConstraintValidation::GetValidationMessage;
 
   HTMLOutputElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~HTMLOutputElement();
@@ -33,19 +32,16 @@ public:
   NS_FORWARD_NSIDOMNODE_TO_NSINODE
 
   // nsIDOMElement
   NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
 
   // nsIDOMHTMLElement
   NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
 
-  // nsIDOMHTMLOutputElement
-  NS_DECL_NSIDOMHTMLOUTPUTELEMENT
-
   // nsIFormControl
   NS_IMETHOD_(uint32_t) GetType() const { return NS_FORM_OUTPUT; }
   NS_IMETHOD Reset() MOZ_OVERRIDE;
   NS_IMETHOD SubmitNamesValues(nsFormSubmission* aFormSubmission) MOZ_OVERRIDE;
 
   virtual bool IsDisabled() const MOZ_OVERRIDE { return false; }
 
   nsresult Clone(nsINodeInfo* aNodeInfo, nsINode** aResult) const MOZ_OVERRIDE;
@@ -74,41 +70,50 @@ public:
 
   virtual nsIDOMNode* AsDOMNode() MOZ_OVERRIDE { return this; }
   virtual JSObject* WrapNode(JSContext* aCx,
                              JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
 
   // WebIDL
   nsDOMSettableTokenList* HtmlFor();
   // nsGenericHTMLFormElement::GetForm is fine.
-  using nsGenericHTMLFormElement::GetForm;
-  // XPCOM GetName is fine.
+  void GetName(nsAString& aName)
+  {
+    GetHTMLAttr(nsGkAtoms::name, aName);
+  }
+
   void SetName(const nsAString& aName, ErrorResult& aRv)
   {
     SetHTMLAttr(nsGkAtoms::name, aName, aRv);
   }
 
-  // XPCOM GetType is fine.
-  // XPCOM GetDefaultValue is fine.
-  void SetDefaultValue(const nsAString& aDefaultValue, ErrorResult& aRv)
+  void GetType(nsAString& aType)
   {
-    aRv = SetDefaultValue(aDefaultValue);
+    aType.AssignLiteral("output");
+  }
+
+  void GetDefaultValue(nsAString& aDefaultValue)
+  {
+    aDefaultValue = mDefaultValue;
   }
-  // XPCOM GetValue is fine.
-  void SetValue(const nsAString& aValue, ErrorResult& aRv)
+
+  void SetDefaultValue(const nsAString& aDefaultValue, ErrorResult& aRv);
+
+  void GetValue(nsAString& aValue)
   {
-    aRv = SetValue(aValue);
+    nsContentUtils::GetNodeTextContent(this, true, aValue);
   }
 
+  void SetValue(const nsAString& aValue, ErrorResult& aRv);
+
   // nsIConstraintValidation::WillValidate is fine.
   // nsIConstraintValidation::Validity() is fine.
   // nsIConstraintValidation::GetValidationMessage() is fine.
   // nsIConstraintValidation::CheckValidity() is fine.
-  using nsIConstraintValidation::CheckValidity;
-  // nsIConstraintValidation::SetCustomValidity() is fine.
+  void SetCustomValidity(const nsAString& aError);
 
 protected:
   enum ValueModeFlag {
     eModeDefault,
     eModeValue
   };
 
   ValueModeFlag                     mValueModeFlag;
--- a/dom/interfaces/html/moz.build
+++ b/dom/interfaces/html/moz.build
@@ -45,17 +45,16 @@ XPIDL_SOURCES += [
     'nsIDOMHTMLMetaElement.idl',
     'nsIDOMHTMLMeterElement.idl',
     'nsIDOMHTMLModElement.idl',
     'nsIDOMHTMLOListElement.idl',
     'nsIDOMHTMLObjectElement.idl',
     'nsIDOMHTMLOptGroupElement.idl',
     'nsIDOMHTMLOptionElement.idl',
     'nsIDOMHTMLOptionsCollection.idl',
-    'nsIDOMHTMLOutputElement.idl',
     'nsIDOMHTMLParagraphElement.idl',
     'nsIDOMHTMLParamElement.idl',
     'nsIDOMHTMLPreElement.idl',
     'nsIDOMHTMLQuoteElement.idl',
     'nsIDOMHTMLScriptElement.idl',
     'nsIDOMHTMLSelectElement.idl',
     'nsIDOMHTMLSourceElement.idl',
     'nsIDOMHTMLStyleElement.idl',
deleted file mode 100644
--- a/dom/interfaces/html/nsIDOMHTMLOutputElement.idl
+++ /dev/null
@@ -1,43 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsIDOMHTMLElement.idl"
-
-/**
- * The nsIDOMHTMLOutputElement interface is the interface to a HTML
- * <output> element.
- *
- * For more information on this interface, please see
- * http://www.whatwg.org/specs/web-apps/current-work/#the-output-element
- *
- * @status UNDER_DEVELOPMENT
- */
-
-interface nsIDOMValidityState;
-
-[scriptable, uuid(c4bff576-90b5-44b0-8278-bf4e3010b09a)]
-interface nsIDOMHTMLOutputElement : nsIDOMHTMLElement
-{
-  // DOMSettableTokenList
-  readonly attribute nsISupports                htmlFor;
-  readonly attribute nsIDOMHTMLFormElement      form;
-           attribute DOMString                  name;
-
-  readonly attribute DOMString                  type;
-           attribute DOMString                  defaultValue;
-           attribute DOMString                  value;
-
-  readonly attribute boolean                    willValidate;
-  readonly attribute nsIDOMValidityState        validity;
-  readonly attribute DOMString                  validationMessage;
-  boolean  checkValidity();
-  void     setCustomValidity(in DOMString error);
-
-  /**
-   * The labels IDL attribute will be added with bug 556743.
-   */
-  //readonly attribute nsIDOMNodeList             labels;
-};
-