Skip to content

Commit

Permalink
Bug 1158366: Remove nsIDOMHTML[BR|Div|Heading|TableCaption|Table|Titl…
Browse files Browse the repository at this point in the history
…e]Element.idl. r=ehsan
  • Loading branch information
khuey committed Apr 24, 2015
1 parent 6a9fb0b commit cbdb341
Show file tree
Hide file tree
Showing 24 changed files with 29 additions and 258 deletions.
6 changes: 0 additions & 6 deletions dom/html/HTMLBRElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,8 @@ HTMLBRElement::~HTMLBRElement()
{
}

NS_IMPL_ISUPPORTS_INHERITED(HTMLBRElement, nsGenericHTMLElement,
nsIDOMHTMLBRElement)

NS_IMPL_ELEMENT_CLONE(HTMLBRElement)


NS_IMPL_STRING_ATTR(HTMLBRElement, Clear, clear)

static const nsAttrValue::EnumTable kClearTable[] = {
{ "left", NS_STYLE_CLEAR_LEFT },
{ "right", NS_STYLE_CLEAR_RIGHT },
Expand Down
14 changes: 5 additions & 9 deletions dom/html/HTMLBRElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,17 @@
#define mozilla_dom_HTMLBRElement_h

#include "mozilla/Attributes.h"
#include "nsIDOMHTMLBRElement.h"
#include "nsGenericHTMLElement.h"
#include "nsGkAtoms.h"

namespace mozilla {
namespace dom {

class HTMLBRElement final : public nsGenericHTMLElement,
public nsIDOMHTMLBRElement
class HTMLBRElement final : public nsGenericHTMLElement
{
public:
explicit HTMLBRElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);

// nsISupports
NS_DECL_ISUPPORTS_INHERITED

// nsIDOMHTMLBRElement
NS_DECL_NSIDOMHTMLBRELEMENT

virtual bool ParseAttribute(int32_t aNamespaceID,
nsIAtom* aAttribute,
const nsAString& aValue,
Expand All @@ -42,6 +34,10 @@ class HTMLBRElement final : public nsGenericHTMLElement,
{
return SetHTMLAttr(nsGkAtoms::clear, aClear, aError);
}
void GetClear(DOMString& aClear) const
{
return GetHTMLAttr(nsGkAtoms::clear, aClear);
}

virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;

Expand Down
3 changes: 0 additions & 3 deletions dom/html/HTMLDivElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ HTMLDivElement::~HTMLDivElement()
{
}

NS_IMPL_ISUPPORTS_INHERITED(HTMLDivElement, nsGenericHTMLElement,
nsIDOMHTMLDivElement)

NS_IMPL_ELEMENT_CLONE(HTMLDivElement)

JSObject*
Expand Down
22 changes: 1 addition & 21 deletions dom/html/HTMLDivElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,18 @@

#include "mozilla/Attributes.h"
#include "nsGenericHTMLElement.h"
#include "nsIDOMHTMLDivElement.h"

namespace mozilla {
namespace dom {

class HTMLDivElement final : public nsGenericHTMLElement,
public nsIDOMHTMLDivElement
class HTMLDivElement final : public nsGenericHTMLElement
{
public:
explicit HTMLDivElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
{
}

// nsISupports
NS_DECL_ISUPPORTS_INHERITED

// nsIDOMHTMLDivElement
NS_IMETHOD GetAlign(nsAString& aAlign) override
{
DOMString align;
GetAlign(align);
align.ToString(aAlign);
return NS_OK;
}
NS_IMETHOD SetAlign(const nsAString& aAlign) override
{
mozilla::ErrorResult rv;
SetAlign(aAlign, rv);
return rv.ErrorCode();
}

void GetAlign(DOMString& aAlign)
{
GetHTMLAttr(nsGkAtoms::align, aAlign);
Expand Down
6 changes: 0 additions & 6 deletions dom/html/HTMLHeadingElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ HTMLHeadingElement::~HTMLHeadingElement()
{
}

NS_IMPL_ISUPPORTS_INHERITED(HTMLHeadingElement, nsGenericHTMLElement,
nsIDOMHTMLHeadingElement)

NS_IMPL_ELEMENT_CLONE(HTMLHeadingElement)

JSObject*
Expand All @@ -32,9 +29,6 @@ HTMLHeadingElement::WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto)
return HTMLHeadingElementBinding::Wrap(aCx, this, aGivenProto);
}

NS_IMPL_STRING_ATTR(HTMLHeadingElement, Align, align)


bool
HTMLHeadingElement::ParseAttribute(int32_t aNamespaceID,
nsIAtom* aAttribute,
Expand Down
20 changes: 9 additions & 11 deletions dom/html/HTMLHeadingElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,19 @@
#define mozilla_dom_HTMLHeadingElement_h

#include "mozilla/Attributes.h"
#include "nsIDOMHTMLHeadingElement.h"
#include "nsGenericHTMLElement.h"

namespace mozilla {
namespace dom {

class HTMLHeadingElement final : public nsGenericHTMLElement,
public nsIDOMHTMLHeadingElement
class HTMLHeadingElement final : public nsGenericHTMLElement
{
public:
explicit HTMLHeadingElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
{
}

// nsISupports
NS_DECL_ISUPPORTS_INHERITED

// nsIDOMHTMLHeadingElement
NS_DECL_NSIDOMHTMLHEADINGELEMENT

virtual bool ParseAttribute(int32_t aNamespaceID,
nsIAtom* aAttribute,
const nsAString& aValue,
Expand All @@ -36,8 +28,14 @@ class HTMLHeadingElement final : public nsGenericHTMLElement,
nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override;
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override;

// The XPCOM versions of GetAlign and SetAlign are fine for us for
// use from WebIDL.
void SetAlign(const nsAString& aAlign, ErrorResult& aError)
{
return SetHTMLAttr(nsGkAtoms::align, aAlign, aError);
}
void GetAlign(DOMString& aAlign) const
{
return GetHTMLAttr(nsGkAtoms::align, aAlign);
}

protected:
virtual ~HTMLHeadingElement();
Expand Down
5 changes: 0 additions & 5 deletions dom/html/HTMLTableCaptionElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,8 @@ HTMLTableCaptionElement::WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenPr
return HTMLTableCaptionElementBinding::Wrap(aCx, this, aGivenProto);
}

NS_IMPL_ISUPPORTS_INHERITED(HTMLTableCaptionElement, nsGenericHTMLElement,
nsIDOMHTMLTableCaptionElement)

NS_IMPL_ELEMENT_CLONE(HTMLTableCaptionElement)

NS_IMPL_STRING_ATTR(HTMLTableCaptionElement, Align, align)

static const nsAttrValue::EnumTable kCaptionAlignTable[] = {
{ "left", NS_STYLE_CAPTION_SIDE_LEFT },
{ "right", NS_STYLE_CAPTION_SIDE_RIGHT },
Expand Down
10 changes: 1 addition & 9 deletions dom/html/HTMLTableCaptionElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@

#include "mozilla/Attributes.h"
#include "nsGenericHTMLElement.h"
#include "nsIDOMHTMLTableCaptionElem.h"

namespace mozilla {
namespace dom {

class HTMLTableCaptionElement final : public nsGenericHTMLElement,
public nsIDOMHTMLTableCaptionElement
class HTMLTableCaptionElement final : public nsGenericHTMLElement
{
public:
explicit HTMLTableCaptionElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
Expand All @@ -22,12 +20,6 @@ class HTMLTableCaptionElement final : public nsGenericHTMLElement,
SetHasWeirdParserInsertionMode();
}

// nsISupports
NS_DECL_ISUPPORTS_INHERITED

// nsIDOMHTMLTableCaptionElement
NS_DECL_NSIDOMHTMLTABLECAPTIONELEMENT

void GetAlign(DOMString& aAlign)
{
GetHTMLAttr(nsGkAtoms::align, aAlign);
Expand Down
1 change: 0 additions & 1 deletion dom/html/HTMLTableElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,6 @@ NS_IMPL_RELEASE_INHERITED(HTMLTableElement, Element)

// QueryInterface implementation for HTMLTableElement
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLTableElement)
NS_INTERFACE_TABLE_INHERITED(HTMLTableElement, nsIDOMHTMLTableElement)
NS_INTERFACE_TABLE_TAIL_INHERITING(nsGenericHTMLElement)


Expand Down
4 changes: 1 addition & 3 deletions dom/html/HTMLTableElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

#include "mozilla/Attributes.h"
#include "nsGenericHTMLElement.h"
#include "nsIDOMHTMLTableElement.h"
#include "mozilla/dom/HTMLTableCaptionElement.h"
#include "mozilla/dom/HTMLTableSectionElement.h"

Expand All @@ -18,8 +17,7 @@ namespace dom {

class TableRowsCollection;

class HTMLTableElement final : public nsGenericHTMLElement,
public nsIDOMHTMLTableElement
class HTMLTableElement final : public nsGenericHTMLElement
{
public:
explicit HTMLTableElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
Expand Down
18 changes: 8 additions & 10 deletions dom/html/HTMLTitleElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ HTMLTitleElement::~HTMLTitleElement()
}

NS_IMPL_ISUPPORTS_INHERITED(HTMLTitleElement, nsGenericHTMLElement,
nsIDOMHTMLTitleElement, nsIMutationObserver)
nsIMutationObserver)

NS_IMPL_ELEMENT_CLONE(HTMLTitleElement)

Expand All @@ -38,20 +38,18 @@ HTMLTitleElement::WrapNode(JSContext* cx, JS::Handle<JSObject*> aGivenProto)
return HTMLTitleElementBinding::Wrap(cx, this, aGivenProto);
}


NS_IMETHODIMP
HTMLTitleElement::GetText(nsAString& aTitle)
void
HTMLTitleElement::GetText(DOMString& aText, ErrorResult& aError)
{
if (!nsContentUtils::GetNodeTextContent(this, false, aTitle)) {
return NS_ERROR_OUT_OF_MEMORY;
if (!nsContentUtils::GetNodeTextContent(this, false, aText)) {
aError.Throw(NS_ERROR_OUT_OF_MEMORY);
}
return NS_OK;
}

NS_IMETHODIMP
HTMLTitleElement::SetText(const nsAString& aTitle)
void
HTMLTitleElement::SetText(const nsAString& aText, ErrorResult& aError)
{
return nsContentUtils::SetNodeTextContent(this, aTitle, true);
aError = nsContentUtils::SetNodeTextContent(this, aText, true);
}

void
Expand Down
12 changes: 2 additions & 10 deletions dom/html/HTMLTitleElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#define mozilla_dom_HTMLTITLEElement_h_

#include "mozilla/Attributes.h"
#include "nsIDOMHTMLTitleElement.h"
#include "nsGenericHTMLElement.h"
#include "nsStubMutationObserver.h"

Expand All @@ -17,7 +16,6 @@ class ErrorResult;
namespace dom {

class HTMLTitleElement final : public nsGenericHTMLElement,
public nsIDOMHTMLTitleElement,
public nsStubMutationObserver
{
public:
Expand All @@ -29,15 +27,9 @@ class HTMLTitleElement final : public nsGenericHTMLElement,
// nsISupports
NS_DECL_ISUPPORTS_INHERITED

// nsIDOMHTMLTitleElement
NS_DECL_NSIDOMHTMLTITLEELEMENT

//HTMLTitleElement
//The xpcom GetTextContent() never fails so we just use that.
void SetText(const nsAString& aText, ErrorResult& aError)
{
aError = SetText(aText);
}
void GetText(DOMString& aText, ErrorResult& aError);
void SetText(const nsAString& aText, ErrorResult& aError);

// nsIMutationObserver
NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATACHANGED
Expand Down
1 change: 0 additions & 1 deletion dom/interfaces/base/domstubs.idl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ interface nsIDOMCounter;
interface nsIDOMRect;
interface nsIDOMCSSStyleRule;
interface nsIDOMCSSStyleRuleCollection;
interface nsIDOMHTMLTableCaptionElement;

// Range
interface nsIDOMRange;
Expand Down
6 changes: 0 additions & 6 deletions dom/interfaces/html/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ XPIDL_SOURCES += [
'nsIDOMHTMLAreaElement.idl',
'nsIDOMHTMLBaseElement.idl',
'nsIDOMHTMLBodyElement.idl',
'nsIDOMHTMLBRElement.idl',
'nsIDOMHTMLButtonElement.idl',
'nsIDOMHTMLCanvasElement.idl',
'nsIDOMHTMLCollection.idl',
'nsIDOMHTMLDirectoryElement.idl',
'nsIDOMHTMLDivElement.idl',
'nsIDOMHTMLDocument.idl',
'nsIDOMHTMLElement.idl',
'nsIDOMHTMLEmbedElement.idl',
Expand All @@ -24,7 +22,6 @@ XPIDL_SOURCES += [
'nsIDOMHTMLFrameElement.idl',
'nsIDOMHTMLFrameSetElement.idl',
'nsIDOMHTMLHeadElement.idl',
'nsIDOMHTMLHeadingElement.idl',
'nsIDOMHTMLHRElement.idl',
'nsIDOMHTMLHtmlElement.idl',
'nsIDOMHTMLIFrameElement.idl',
Expand All @@ -51,11 +48,8 @@ XPIDL_SOURCES += [
'nsIDOMHTMLSelectElement.idl',
'nsIDOMHTMLSourceElement.idl',
'nsIDOMHTMLStyleElement.idl',
'nsIDOMHTMLTableCaptionElem.idl',
'nsIDOMHTMLTableCellElement.idl',
'nsIDOMHTMLTableElement.idl',
'nsIDOMHTMLTextAreaElement.idl',
'nsIDOMHTMLTitleElement.idl',
'nsIDOMHTMLUListElement.idl',
'nsIDOMMediaError.idl',
'nsIDOMMozBrowserFrame.idl',
Expand Down
23 changes: 0 additions & 23 deletions dom/interfaces/html/nsIDOMHTMLBRElement.idl

This file was deleted.

23 changes: 0 additions & 23 deletions dom/interfaces/html/nsIDOMHTMLDivElement.idl

This file was deleted.

Loading

0 comments on commit cbdb341

Please sign in to comment.