Bug 824823 part 6. Move HTMLLIElement to WebIDL bindings. r=peterv

This commit is contained in:
Boris Zbarsky 2013-01-04 12:02:14 -05:00
parent 96cb81e954
commit c7d060e020
5 changed files with 62 additions and 0 deletions

View File

@ -4,6 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/dom/HTMLLIElement.h"
#include "mozilla/dom/HTMLLIElementBinding.h"
#include "nsAttrValueInlines.h"
#include "nsGkAtoms.h"
@ -116,5 +117,11 @@ HTMLLIElement::GetAttributeMappingFunction() const
return &MapAttributesIntoRule;
}
JSObject*
HTMLLIElement::WrapNode(JSContext *aCx, JSObject *aScope, bool *aTriedToWrap)
{
return HTMLLIElementBinding::Wrap(aCx, aScope, this, aTriedToWrap);
}
} // namespace dom
} // namespace mozilla

View File

@ -20,6 +20,7 @@ public:
HTMLLIElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
{
SetIsDOMBinding();
}
virtual ~HTMLLIElement();
@ -47,6 +48,28 @@ public:
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
virtual nsXPCClassInfo* GetClassInfo();
virtual nsIDOMNode* AsDOMNode() { return this; }
// WebIDL API
void GetType(nsString& aType)
{
GetHTMLAttr(nsGkAtoms::type, aType);
}
void SetType(const nsAString& aType, mozilla::ErrorResult& rv)
{
SetHTMLAttr(nsGkAtoms::type, aType, rv);
}
int32_t Value() const
{
return GetIntAttr(nsGkAtoms::value, 0);
}
void SetValue(int32_t aValue, mozilla::ErrorResult& rv)
{
SetHTMLIntAttr(nsGkAtoms::value, aValue, rv);
}
protected:
virtual JSObject* WrapNode(JSContext *aCx, JSObject *aScope,
bool *aTriedToWrap) MOZ_OVERRIDE;
};
} // namespace dom

View File

@ -366,6 +366,10 @@ DOMInterfaces = {
'hasInstanceInterface': 'nsIDOMHTMLLabelElement',
},
'HTMLLIElement': {
'hasInstanceInterface': 'nsIDOMHTMLLIElement',
},
'HTMLOListElement': {
'headerFile' : 'mozilla/dom/HTMLSharedListElement.h',
'hasInstanceInterface': 'nsIDOMHTMLOListElement'

View File

@ -0,0 +1,27 @@
/* -*- 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-li-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-li-element
interface HTMLLIElement : HTMLElement {
[SetterThrows]
attribute long value;
/*
};
// http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
partial interface HTMLLIElement {
*/
[SetterThrows]
attribute DOMString type;
};

View File

@ -62,6 +62,7 @@ webidl_files = \
HTMLHeadingElement.webidl \
HTMLImageElement.webidl \
HTMLLabelElement.webidl \
HTMLLIElement.webidl \
HTMLOListElement.webidl \
HTMLOptionsCollection.webidl \
HTMLPropertiesCollection.webidl \