Bug 837520 - Part 2: Move HTMLBRElement to Web IDL bindings; r=bzbarsky

This commit is contained in:
Ehsan Akhgari 2013-02-03 18:05:27 -05:00
Родитель 57985fa212
Коммит 50253162ca
5 изменённых файлов: 51 добавлений и 2 удалений

Просмотреть файл

@ -4,10 +4,10 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/dom/HTMLBRElement.h"
#include "mozilla/dom/HTMLBRElementBinding.h"
#include "mozilla/Util.h"
#include "nsAttrValueInlines.h"
#include "nsGkAtoms.h"
#include "nsStyleConsts.h"
#include "nsMappedAttributes.h"
#include "nsRuleData.h"
@ -23,6 +23,7 @@ namespace dom {
HTMLBRElement::HTMLBRElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
{
SetIsDOMBinding();
}
HTMLBRElement::~HTMLBRElement()
@ -106,5 +107,12 @@ HTMLBRElement::GetAttributeMappingFunction() const
return &MapAttributesIntoRule;
}
JSObject*
HTMLBRElement::WrapNode(JSContext *aCx, JSObject *aScope,
bool* aTriedToWrap)
{
return HTMLBRElementBinding::Wrap(aCx, aScope, this, aTriedToWrap);
}
} // namespace dom
} // namespace mozilla

Просмотреть файл

@ -8,6 +8,7 @@
#include "nsIDOMHTMLBRElement.h"
#include "nsGenericHTMLElement.h"
#include "nsGkAtoms.h"
namespace mozilla {
namespace dom {
@ -43,6 +44,18 @@ public:
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
virtual nsXPCClassInfo* GetClassInfo();
virtual nsIDOMNode* AsDOMNode() { return this; }
bool Clear()
{
return GetBoolAttr(nsGkAtoms::clear);
}
void SetClear(const nsAString& aClear, ErrorResult& aError)
{
return SetHTMLAttr(nsGkAtoms::clear, aClear, aError);
}
virtual JSObject* WrapNode(JSContext *aCx, JSObject *aScope,
bool *aTriedToWrap);
};
} // namespace dom

Просмотреть файл

@ -350,7 +350,11 @@ DOMInterfaces = {
},
'HTMLBodyElement': {
'hasInstanceInterface': 'nsIDOMHTMLBodyElement',
'hasInstanceInterface': 'nsIDOMHTMLBodyElement',
},
'HTMLBRElement': {
'hasInstanceInterface': 'nsIDOMHTMLBRElement',
},
'HTMLCollection': {

Просмотреть файл

@ -0,0 +1,23 @@
/* -*- 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/.
*
* The origin of this IDL file is
* http://www.whatwg.org/specs/web-apps/current-work/#the-br-element
* http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
*
* © 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.
*/
// http://www.whatwg.org/specs/web-apps/current-work/#the-br-element
interface HTMLBRElement : HTMLElement {};
// http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
partial interface HTMLBRElement {
[SetterThrows]
attribute DOMString clear;
};

Просмотреть файл

@ -57,6 +57,7 @@ webidl_files = \
GainNode.webidl \
HTMLAnchorElement.webidl \
HTMLBodyElement.webidl \
HTMLBRElement.webidl \
HTMLCollection.webidl \
HTMLDataListElement.webidl \
HTMLDivElement.webidl \