diff --git a/content/html/content/src/HTMLLegendElement.cpp b/content/html/content/src/HTMLLegendElement.cpp
index 2b391ea7939f..3381b8f6694d 100644
--- a/content/html/content/src/HTMLLegendElement.cpp
+++ b/content/html/content/src/HTMLLegendElement.cpp
@@ -25,30 +25,13 @@ NS_IMPL_RELEASE_INHERITED(HTMLLegendElement, Element)
// QueryInterface implementation for HTMLLegendElement
-NS_INTERFACE_TABLE_HEAD(HTMLLegendElement)
+NS_INTERFACE_MAP_BEGIN(HTMLLegendElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
- NS_INTERFACE_TABLE_INHERITED1(HTMLLegendElement, nsIDOMHTMLLegendElement)
- NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END
-// nsIDOMHTMLLegendElement
-
-
NS_IMPL_ELEMENT_CLONE(HTMLLegendElement)
-
-NS_IMETHODIMP
-HTMLLegendElement::GetForm(nsIDOMHTMLFormElement** aForm)
-{
- Element* form = GetFormElement();
-
- return form ? CallQueryInterface(form, aForm) : NS_OK;
-}
-
-
-NS_IMPL_STRING_ATTR(HTMLLegendElement, Align, align)
-
// this contains center, because IE4 does
static const nsAttrValue::EnumTable kAlignTable[] = {
{ "left", NS_STYLE_TEXT_ALIGN_LEFT },
diff --git a/content/html/content/src/HTMLLegendElement.h b/content/html/content/src/HTMLLegendElement.h
index 8e88f7bd5940..89a998aacf65 100644
--- a/content/html/content/src/HTMLLegendElement.h
+++ b/content/html/content/src/HTMLLegendElement.h
@@ -7,7 +7,6 @@
#define mozilla_dom_HTMLLegendElement_h
#include "mozilla/Attributes.h"
-#include "nsIDOMHTMLLegendElement.h"
#include "nsGenericHTMLElement.h"
#include "mozilla/dom/HTMLFormElement.h"
@@ -15,7 +14,7 @@ namespace mozilla {
namespace dom {
class HTMLLegendElement MOZ_FINAL : public nsGenericHTMLElement,
- public nsIDOMHTMLLegendElement
+ public nsIDOMHTMLElement
{
public:
HTMLLegendElement(already_AddRefed aNodeInfo)
@@ -35,9 +34,6 @@ public:
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
- // nsIDOMHTMLLegendElement
- NS_DECL_NSIDOMHTMLLEGENDELEMENT
-
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
@@ -86,7 +82,11 @@ public:
already_AddRefed GetForm();
- // The XPCOM GetAlign is OK for us
+ void GetAlign(nsAString& aAlign)
+ {
+ GetHTMLAttr(nsGkAtoms::align, aAlign);
+ }
+
void SetAlign(const nsAString& aAlign, ErrorResult& aError)
{
SetHTMLAttr(nsGkAtoms::align, aAlign, aError);
diff --git a/dom/base/nsFocusManager.cpp b/dom/base/nsFocusManager.cpp
index b398d74116bf..898b0b0a275b 100644
--- a/dom/base/nsFocusManager.cpp
+++ b/dom/base/nsFocusManager.cpp
@@ -20,7 +20,6 @@
#include "nsIDOMHTMLFrameElement.h"
#include "nsIDOMHTMLInputElement.h"
#include "nsIDOMHTMLMapElement.h"
-#include "nsIDOMHTMLLegendElement.h"
#include "nsIDOMDocument.h"
#include "nsIDOMRange.h"
#include "nsIHTMLDocument.h"
diff --git a/dom/interfaces/html/moz.build b/dom/interfaces/html/moz.build
index 414166b2c69b..510dfaba063b 100644
--- a/dom/interfaces/html/moz.build
+++ b/dom/interfaces/html/moz.build
@@ -36,7 +36,6 @@ XPIDL_SOURCES += [
'nsIDOMHTMLInputElement.idl',
'nsIDOMHTMLLIElement.idl',
'nsIDOMHTMLLabelElement.idl',
- 'nsIDOMHTMLLegendElement.idl',
'nsIDOMHTMLLinkElement.idl',
'nsIDOMHTMLMapElement.idl',
'nsIDOMHTMLMediaElement.idl',
diff --git a/dom/interfaces/html/nsIDOMHTMLLegendElement.idl b/dom/interfaces/html/nsIDOMHTMLLegendElement.idl
deleted file mode 100644
index 09151d6efbd6..000000000000
--- a/dom/interfaces/html/nsIDOMHTMLLegendElement.idl
+++ /dev/null
@@ -1,24 +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 nsIDOMHTMLLegendElement interface is the interface to a [X]HTML
- * legend 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(2e4567be-3d91-4df8-bdf9-f3bd96a6cd06)]
-interface nsIDOMHTMLLegendElement : nsIDOMHTMLElement
-{
- readonly attribute nsIDOMHTMLFormElement form;
- attribute DOMString align;
-};
diff --git a/dom/webidl/HTMLLegendElement.webidl b/dom/webidl/HTMLLegendElement.webidl
index b13da7e54e52..0ce4ae88b9a9 100644
--- a/dom/webidl/HTMLLegendElement.webidl
+++ b/dom/webidl/HTMLLegendElement.webidl
@@ -19,5 +19,6 @@ interface HTMLLegendElement : HTMLElement {
// http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
partial interface HTMLLegendElement {
+ [SetterThrows]
attribute DOMString align;
};
diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp
index 613dc107d4a2..0b1eb3eca84a 100644
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -42,7 +42,6 @@
#include "nsIDOMXULElement.h"
#include "nsContainerFrame.h"
#include "nsINameSpaceManager.h"
-#include "nsIDOMHTMLLegendElement.h"
#include "nsIComboboxControlFrame.h"
#include "nsIListControlFrame.h"
#include "nsISelectControlFrame.h"
@@ -5879,7 +5878,7 @@ nsCSSFrameConstructor::IsValidSibling(nsIFrame* aSibling,
nsGkAtoms::blockFrame == parentType)) {
// Legends can be sibling of legends but not of other content in the fieldset
nsIAtom* sibType = aSibling->GetContentInsertionFrame()->GetType();
- nsCOMPtr legendContent(do_QueryInterface(aContent));
+ bool legendContent = aContent->IsHTML(nsGkAtoms::legend);
if ((legendContent && (nsGkAtoms::legendFrame != sibType)) ||
(!legendContent && (nsGkAtoms::legendFrame == sibType)))
@@ -5987,8 +5986,7 @@ GetAdjustedParentFrame(nsIFrame* aParentFrame,
if (nsGkAtoms::fieldSetFrame == aParentFrameType) {
// If the parent is a fieldSet, use the fieldSet's area frame as the
// parent unless the new content is a legend.
- nsCOMPtr legendContent(do_QueryInterface(aChildContent));
- if (!legendContent) {
+ if (!aChildContent->IsHTML(nsGkAtoms::legend)) {
newParent = GetFieldSetBlockFrame(aParentFrame);
}
}
diff --git a/layout/forms/nsFieldSetFrame.cpp b/layout/forms/nsFieldSetFrame.cpp
index f86d8fce1adf..6a4d5bcd541e 100644
--- a/layout/forms/nsFieldSetFrame.cpp
+++ b/layout/forms/nsFieldSetFrame.cpp
@@ -8,7 +8,6 @@
#include "nsLegendFrame.h"
#include "nsIDOMNode.h"
#include "nsIDOMHTMLFieldSetElement.h"
-#include "nsIDOMHTMLLegendElement.h"
#include "nsCSSRendering.h"
#include
#include "nsIContent.h"