mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-03 18:47:53 +00:00
Bug 824823 part 11. Switch HTMLParagraphElement to WebIDL. r=peterv
This commit is contained in:
parent
fd1ec7eb71
commit
2c6bdd4730
@ -4,6 +4,7 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "mozilla/dom/HTMLParagraphElement.h"
|
||||
#include "mozilla/dom/HTMLParagraphElementBinding.h"
|
||||
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsMappedAttributes.h"
|
||||
@ -74,5 +75,11 @@ HTMLParagraphElement::GetAttributeMappingFunction() const
|
||||
return &MapAttributesIntoRule;
|
||||
}
|
||||
|
||||
JSObject*
|
||||
HTMLParagraphElement::WrapNode(JSContext *aCx, JSObject *aScope, bool *aTriedToWrap)
|
||||
{
|
||||
return HTMLParagraphElementBinding::Wrap(aCx, aScope, this, aTriedToWrap);
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
@ -21,6 +21,7 @@ public:
|
||||
HTMLParagraphElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
: nsGenericHTMLElement(aNodeInfo)
|
||||
{
|
||||
SetIsDOMBinding();
|
||||
}
|
||||
virtual ~HTMLParagraphElement();
|
||||
|
||||
@ -51,6 +52,17 @@ public:
|
||||
virtual nsXPCClassInfo* GetClassInfo();
|
||||
|
||||
virtual nsIDOMNode* AsDOMNode() { return this; }
|
||||
|
||||
// WebIDL API
|
||||
// The XPCOM GetAlign is fine for our purposes
|
||||
void SetAlign(const nsAString& aValue, mozilla::ErrorResult& rv)
|
||||
{
|
||||
SetHTMLAttr(nsGkAtoms::align, aValue, rv);
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual JSObject* WrapNode(JSContext *aCx, JSObject *aScope,
|
||||
bool *aTriedToWrap) MOZ_OVERRIDE;
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
|
@ -395,6 +395,10 @@ DOMInterfaces = {
|
||||
}
|
||||
},
|
||||
|
||||
'HTMLParagraphElement': {
|
||||
'hasInstanceInterface': 'nsIDOMHTMLParagraphElement',
|
||||
},
|
||||
|
||||
'HTMLPropertiesCollection': {
|
||||
'headerFile': 'HTMLPropertiesCollection.h',
|
||||
'resultNotAddRefed': [ 'item', 'namedItem', 'names' ]
|
||||
|
23
dom/webidl/HTMLParagraphElement.webidl
Normal file
23
dom/webidl/HTMLParagraphElement.webidl
Normal file
@ -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-p-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-p-element
|
||||
interface HTMLParagraphElement : HTMLElement {
|
||||
/*};
|
||||
|
||||
// http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
|
||||
partial interface HTMLParagraphElement {
|
||||
*/
|
||||
[SetterThrows]
|
||||
attribute DOMString align;
|
||||
};
|
@ -67,6 +67,7 @@ webidl_files = \
|
||||
HTMLLIElement.webidl \
|
||||
HTMLOListElement.webidl \
|
||||
HTMLOptionsCollection.webidl \
|
||||
HTMLParagraphElement.webidl \
|
||||
HTMLPropertiesCollection.webidl \
|
||||
HTMLTitleElement.webidl \
|
||||
HTMLUListElement.webidl \
|
||||
|
Loading…
Reference in New Issue
Block a user