Bug 893117: Remove nsIDOMHTMLLabelElement r=bz
authorDavid Zbarsky <dzbarsky@gmail.com>
Tue, 30 Jul 2013 14:55:13 -0700
changeset 152917 a97e4dc75260269e5f7bb8f165f77a844c072084
parent 152916 5a51269a168b4e3072a0f272809f14b41ee347a3
child 152918 19e69f5e906ce0ab47519043affd3ef7ac7fd891
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 nsIDOMHTMLLabelElement r=bz
browser/metro/base/content/contenthandlers/FormHelper.js
content/html/content/src/HTMLLabelElement.cpp
content/html/content/src/HTMLLabelElement.h
dom/interfaces/html/moz.build
dom/interfaces/html/nsIDOMHTMLLabelElement.idl
dom/webidl/HTMLLabelElement.webidl
--- a/browser/metro/base/content/contenthandlers/FormHelper.js
+++ b/browser/metro/base/content/contenthandlers/FormHelper.js
@@ -10,17 +10,16 @@ dump("### FormHelper.js loaded\n");
 
 let HTMLTextAreaElement = Ci.nsIDOMHTMLTextAreaElement;
 let HTMLInputElement = Ci.nsIDOMHTMLInputElement;
 let HTMLSelectElement = Ci.nsIDOMHTMLSelectElement;
 let HTMLIFrameElement = Ci.nsIDOMHTMLIFrameElement;
 let HTMLDocument = Ci.nsIDOMHTMLDocument;
 let HTMLHtmlElement = Ci.nsIDOMHTMLHtmlElement;
 let HTMLBodyElement = Ci.nsIDOMHTMLBodyElement;
-let HTMLLabelElement = Ci.nsIDOMHTMLLabelElement;
 let HTMLButtonElement = Ci.nsIDOMHTMLButtonElement;
 let HTMLOptGroupElement = Ci.nsIDOMHTMLOptGroupElement;
 let HTMLOptionElement = Ci.nsIDOMHTMLOptionElement;
 let XULMenuListElement = Ci.nsIDOMXULMenuListElement;
 
 /**
  * Responsible of navigation between forms fields and of the opening of the assistant
  */
--- a/content/html/content/src/HTMLLabelElement.cpp
+++ b/content/html/content/src/HTMLLabelElement.cpp
@@ -30,59 +30,23 @@ HTMLLabelElement::WrapNode(JSContext *aC
 
 // nsISupports
 
 
 NS_IMPL_ADDREF_INHERITED(HTMLLabelElement, Element)
 NS_IMPL_RELEASE_INHERITED(HTMLLabelElement, Element)
 
 // QueryInterface implementation for HTMLLabelElement
-NS_INTERFACE_TABLE_HEAD(HTMLLabelElement)
+NS_INTERFACE_MAP_BEGIN(HTMLLabelElement)
   NS_HTML_CONTENT_INTERFACES(nsGenericHTMLFormElement)
-  NS_INTERFACE_TABLE_INHERITED1(HTMLLabelElement,
-                                nsIDOMHTMLLabelElement)
-  NS_INTERFACE_TABLE_TO_MAP_SEGUE
 NS_ELEMENT_INTERFACE_MAP_END
 
 
-// nsIDOMHTMLLabelElement
-
 NS_IMPL_ELEMENT_CLONE(HTMLLabelElement)
 
-NS_IMETHODIMP
-HTMLLabelElement::GetForm(nsIDOMHTMLFormElement** aForm)
-{
-  return nsGenericHTMLFormElement::GetForm(aForm);
-}
-
-NS_IMETHODIMP
-HTMLLabelElement::GetControl(nsIDOMHTMLElement** aElement)
-{
-  nsCOMPtr<nsIDOMHTMLElement> element = do_QueryInterface(GetLabeledElement());
-  element.forget(aElement);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-HTMLLabelElement::SetHtmlFor(const nsAString& aHtmlFor)
-{
-  ErrorResult rv;
-  SetHtmlFor(aHtmlFor, rv);
-  return rv.ErrorCode();
-}
-
-NS_IMETHODIMP
-HTMLLabelElement::GetHtmlFor(nsAString& aHtmlFor)
-{
-  nsString htmlFor;
-  GetHtmlFor(htmlFor);
-  aHtmlFor = htmlFor;
-  return NS_OK;
-}
-
 void
 HTMLLabelElement::Focus(ErrorResult& aError)
 {
   // retarget the focus method at the for content
   nsIFocusManager* fm = nsFocusManager::GetFocusManager();
   if (fm) {
     nsCOMPtr<nsIDOMElement> elem = do_QueryInterface(GetLabeledElement());
     if (elem)
--- a/content/html/content/src/HTMLLabelElement.h
+++ b/content/html/content/src/HTMLLabelElement.h
@@ -6,23 +6,22 @@
 /**
  * Declaration of HTML <label> elements.
  */
 #ifndef HTMLLabelElement_h
 #define HTMLLabelElement_h
 
 #include "mozilla/Attributes.h"
 #include "nsGenericHTMLElement.h"
-#include "nsIDOMHTMLLabelElement.h"
 
 namespace mozilla {
 namespace dom {
 
 class HTMLLabelElement MOZ_FINAL : public nsGenericHTMLFormElement,
-                                   public nsIDOMHTMLLabelElement
+                                   public nsIDOMHTMLElement
 {
 public:
   HTMLLabelElement(already_AddRefed<nsINodeInfo> aNodeInfo)
     : nsGenericHTMLFormElement(aNodeInfo),
       mHandlingEvent(false)
   {
   }
   virtual ~HTMLLabelElement();
@@ -33,19 +32,16 @@ public:
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE_TO_NSINODE
 
   // nsIDOMElement
   NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
 
-  // nsIDOMHTMLLabelElement
-  NS_DECL_NSIDOMHTMLLABELELEMENT
-
   // nsIDOMHTMLElement
   NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
 
   using nsGenericHTMLFormElement::GetForm;
   void GetHtmlFor(nsString& aHtmlFor)
   {
     GetHTMLAttr(nsGkAtoms::_for, aHtmlFor);
   }
--- a/dom/interfaces/html/moz.build
+++ b/dom/interfaces/html/moz.build
@@ -28,17 +28,16 @@ XPIDL_SOURCES += [
     'nsIDOMHTMLFrameSetElement.idl',
     'nsIDOMHTMLHRElement.idl',
     'nsIDOMHTMLHeadElement.idl',
     'nsIDOMHTMLHtmlElement.idl',
     'nsIDOMHTMLIFrameElement.idl',
     'nsIDOMHTMLImageElement.idl',
     'nsIDOMHTMLInputElement.idl',
     'nsIDOMHTMLLIElement.idl',
-    'nsIDOMHTMLLabelElement.idl',
     'nsIDOMHTMLLinkElement.idl',
     'nsIDOMHTMLMapElement.idl',
     'nsIDOMHTMLMediaElement.idl',
     'nsIDOMHTMLMenuElement.idl',
     'nsIDOMHTMLMenuItemElement.idl',
     'nsIDOMHTMLMetaElement.idl',
     'nsIDOMHTMLMeterElement.idl',
     'nsIDOMHTMLOListElement.idl',
deleted file mode 100644
--- a/dom/interfaces/html/nsIDOMHTMLLabelElement.idl
+++ /dev/null
@@ -1,25 +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 nsIDOMHTMLLabelElement interface is the interface to a [X]HTML
- * label element.
- *
- * This interface is trying to follow the DOM Level 2 HTML specification:
- * http://www.w3.org/TR/DOM-Level-2-HTML/
- *
- * with changes from the work-in-progress WHATWG HTML specification:
- * http://www.whatwg.org/specs/web-apps/current-work/
- */
-
-[scriptable, uuid(cbffa708-f51e-4c74-9644-19f9d417aac5)]
-interface nsIDOMHTMLLabelElement : nsIDOMHTMLElement
-{
-  readonly attribute nsIDOMHTMLFormElement form;
-           attribute DOMString             htmlFor;
-  readonly attribute nsIDOMHTMLElement     control;
-};
--- a/dom/webidl/HTMLLabelElement.webidl
+++ b/dom/webidl/HTMLLabelElement.webidl
@@ -8,11 +8,12 @@
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 interface HTMLLabelElement : HTMLElement {
   readonly attribute HTMLFormElement? form;
+           [SetterThrows]
            attribute DOMString htmlFor;
   readonly attribute HTMLElement? control;
 };