Fix for bug 818219 (Replace HTMLElement quickstubs with new binding methods). r=bz.

--HG--
extra : rebase_source : ddbedbaea030272ce8fc1ac7245175f7fd3edaa4
This commit is contained in:
Peter Van der Beken 2012-11-26 15:19:02 +01:00
parent 3d8efefcb5
commit 8ca0ac01c9
11 changed files with 256 additions and 308 deletions

View File

@ -101,6 +101,7 @@
#include "mozilla/ErrorResult.h"
#include "nsHTMLDocument.h"
#include "nsDOMTouchEvent.h"
#include "nsGlobalWindow.h"
using namespace mozilla;
using namespace mozilla::dom;
@ -1816,6 +1817,90 @@ nsGenericHTMLElement::GetEventListenerManagerForAttr(nsIAtom* aAttrName,
aDefer);
}
// FIXME (https://bugzilla.mozilla.org/show_bug.cgi?id=431767)
// nsDocument::GetInnerWindow can return an outer window in some
// cases. We don't want to stick an event listener on an outer
// window, so bail if it does. See also similar code in
// nsGenericHTMLElement::GetEventListenerManagerForAttr.
#define EVENT(name_, id_, type_, struct_) /* nothing; handled by nsINode */
#define FORWARDED_EVENT(name_, id_, type_, struct_) \
EventHandlerNonNull* \
nsGenericHTMLElement::GetOn##name_() \
{ \
if (Tag() == nsGkAtoms::body || Tag() == nsGkAtoms::frameset) { \
/* XXXbz note to self: add tests for this! */ \
nsPIDOMWindow* win = OwnerDoc()->GetInnerWindow(); \
if (win && win->IsInnerWindow()) { \
nsCOMPtr<nsISupports> supports = do_QueryInterface(win); \
nsGlobalWindow* globalWin = nsGlobalWindow::FromSupports(supports); \
return globalWin->GetOn##name_(); \
} \
return nullptr; \
} \
\
return nsINode::GetOn##name_(); \
} \
void \
nsGenericHTMLElement::SetOn##name_(EventHandlerNonNull* handler, \
ErrorResult& error) \
{ \
if (Tag() == nsGkAtoms::body || Tag() == nsGkAtoms::frameset) { \
nsPIDOMWindow* win = OwnerDoc()->GetInnerWindow(); \
if (!win || !win->IsInnerWindow()) { \
return; \
} \
\
nsCOMPtr<nsISupports> supports = do_QueryInterface(win); \
nsGlobalWindow* globalWin = nsGlobalWindow::FromSupports(supports); \
return globalWin->SetOn##name_(handler, error); \
} \
\
return nsINode::SetOn##name_(handler, error); \
}
#define ERROR_EVENT(name_, id_, type_, struct_) \
already_AddRefed<EventHandlerNonNull> \
nsGenericHTMLElement::GetOn##name_() \
{ \
if (Tag() == nsGkAtoms::body || Tag() == nsGkAtoms::frameset) { \
/* XXXbz note to self: add tests for this! */ \
nsPIDOMWindow* win = OwnerDoc()->GetInnerWindow(); \
if (win && win->IsInnerWindow()) { \
nsCOMPtr<nsISupports> supports = do_QueryInterface(win); \
nsGlobalWindow* globalWin = nsGlobalWindow::FromSupports(supports); \
OnErrorEventHandlerNonNull* errorHandler = globalWin->GetOn##name_(); \
if (errorHandler) { \
return new EventHandlerNonNull(errorHandler); \
} \
} \
return nullptr; \
} \
\
return nsINode::GetOn##name_(); \
} \
void \
nsGenericHTMLElement::SetOn##name_(EventHandlerNonNull* handler, \
ErrorResult& error) \
{ \
if (Tag() == nsGkAtoms::body || Tag() == nsGkAtoms::frameset) { \
nsPIDOMWindow* win = OwnerDoc()->GetInnerWindow(); \
if (!win || !win->IsInnerWindow()) { \
return; \
} \
\
nsCOMPtr<nsISupports> supports = do_QueryInterface(win); \
nsGlobalWindow* globalWin = nsGlobalWindow::FromSupports(supports); \
nsRefPtr<OnErrorEventHandlerNonNull> errorHandler = \
new OnErrorEventHandlerNonNull(handler); \
return globalWin->SetOn##name_(errorHandler, error); \
} \
\
return nsINode::SetOn##name_(handler, error); \
}
#include "nsEventNameList.h"
#undef ERROR_EVENT
#undef FORWARDED_EVENT
#undef EVENT
nsresult
nsGenericHTMLElement::SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
nsIAtom* aPrefix, const nsAString& aValue,

View File

@ -239,6 +239,25 @@ public:
}
return style;
}
#define EVENT(name_, id_, type_, struct_) /* nothing; handled by nsINode */
// The using nsINode::Get/SetOn* are to avoid warnings about shadowing the XPCOM
// getter and setter on nsINode.
#define FORWARDED_EVENT(name_, id_, type_, struct_) \
using nsINode::GetOn##name_; \
using nsINode::SetOn##name_; \
mozilla::dom::EventHandlerNonNull* GetOn##name_(); \
void SetOn##name_(mozilla::dom::EventHandlerNonNull* handler, \
mozilla::ErrorResult& error);
#define ERROR_EVENT(name_, id_, type_, struct_) \
using nsINode::GetOn##name_; \
using nsINode::SetOn##name_; \
already_AddRefed<mozilla::dom::EventHandlerNonNull> GetOn##name_(); \
void SetOn##name_(mozilla::dom::EventHandlerNonNull* handler, \
mozilla::ErrorResult& error);
#include "nsEventNameList.h"
#undef ERROR_EVENT
#undef FORWARDED_EVENT
#undef EVENT
void GetClassName(nsAString& aClassName)
{
GetAttr(kNameSpaceID_None, nsGkAtoms::_class, aClassName);

View File

@ -23,6 +23,7 @@
#include "nsIEditorDocShell.h"
#include "nsRuleWalker.h"
#include "jspubtd.h"
#include "mozilla/dom/EventHandlerBinding.h"
//----------------------------------------------------------------------
@ -474,34 +475,42 @@ nsHTMLBodyElement::GetAssociatedEditor()
return editor;
}
// Event listener stuff
// FIXME (https://bugzilla.mozilla.org/show_bug.cgi?id=431767)
// nsDocument::GetInnerWindow can return an outer window in some
// cases. We don't want to stick an event listener on an outer
// window, so bail if it does. See also similar code in
// nsGenericHTMLElement::GetEventListenerManagerForAttr.
#define EVENT(name_, id_, type_, struct_) /* nothing; handled by the superclass */
#define FORWARDED_EVENT(name_, id_, type_, struct_) \
// nsGenericHTMLElement::GetOnError returns
// already_AddRefed<EventHandlerNonNull> while other getters return
// EventHandlerNonNull*, so allow passing in the type to use here.
#define FORWARDED_EVENT_HELPER(name_, getter_type_) \
NS_IMETHODIMP nsHTMLBodyElement::GetOn##name_(JSContext *cx, \
jsval *vp) { \
/* XXXbz note to self: add tests for this! */ \
nsPIDOMWindow* win = OwnerDoc()->GetInnerWindow(); \
if (win && win->IsInnerWindow()) { \
nsCOMPtr<nsIInlineEventHandlers> ev = do_QueryInterface(win); \
return ev->GetOn##name_(cx, vp); \
} \
*vp = JSVAL_NULL; \
getter_type_ h = nsGenericHTMLElement::GetOn##name_(); \
vp->setObjectOrNull(h ? h->Callable() : nullptr); \
return NS_OK; \
} \
NS_IMETHODIMP nsHTMLBodyElement::SetOn##name_(JSContext *cx, \
const jsval &v) { \
nsPIDOMWindow* win = OwnerDoc()->GetInnerWindow(); \
if (win && win->IsInnerWindow()) { \
nsCOMPtr<nsIInlineEventHandlers> ev = do_QueryInterface(win); \
return ev->SetOn##name_(cx, v); \
JSObject *obj = GetWrapper(); \
if (!obj) { \
/* Just silently do nothing */ \
return NS_OK; \
} \
return NS_OK; \
nsRefPtr<EventHandlerNonNull> handler; \
JSObject *callable; \
if (v.isObject() && \
JS_ObjectIsCallable(cx, callable = &v.toObject())) { \
bool ok; \
handler = new EventHandlerNonNull(cx, obj, callable, &ok); \
if (!ok) { \
return NS_ERROR_OUT_OF_MEMORY; \
} \
} \
ErrorResult rv; \
nsGenericHTMLElement::SetOn##name_(handler, rv); \
return rv.ErrorCode(); \
}
#define FORWARDED_EVENT(name_, id_, type_, struct_) \
FORWARDED_EVENT_HELPER(name_, EventHandlerNonNull*)
#define ERROR_EVENT(name_, id_, type_, struct_) \
FORWARDED_EVENT_HELPER(name_, nsCOMPtr<EventHandlerNonNull>)
#define WINDOW_EVENT(name_, id_, type_, struct_) \
NS_IMETHODIMP nsHTMLBodyElement::GetOn##name_(JSContext *cx, \
jsval *vp) { \
@ -522,5 +531,7 @@ nsHTMLBodyElement::GetAssociatedEditor()
}
#include "nsEventNameList.h"
#undef WINDOW_EVENT
#undef ERROR_EVENT
#undef FORWARDED_EVENT
#undef FORWARDED_EVENT_HELPER
#undef EVENT

View File

@ -5,7 +5,9 @@
#include "nsHTMLFrameSetElement.h"
#include "jsapi.h"
#include "mozilla/dom/EventHandlerBinding.h"
using namespace mozilla;
using namespace mozilla::dom;
NS_IMPL_NS_NEW_HTML_ELEMENT(FrameSet)
@ -318,34 +320,42 @@ nsHTMLFrameSetElement::ParseRowCol(const nsAString & aValue,
return NS_OK;
}
// Event listener stuff
// FIXME (https://bugzilla.mozilla.org/show_bug.cgi?id=431767)
// nsDocument::GetInnerWindow can return an outer window in some
// cases. We don't want to stick an event listener on an outer
// window, so bail if it does. See also similar code in
// nsGenericHTMLElement::GetEventListenerManagerForAttr.
#define EVENT(name_, id_, type_, struct_) /* nothing; handled by the shim */
#define FORWARDED_EVENT(name_, id_, type_, struct_) \
// nsGenericHTMLElement::GetOnError returns
// already_AddRefed<EventHandlerNonNull> while other getters return
// EventHandlerNonNull*, so allow passing in the type to use here.
#define FORWARDED_EVENT_HELPER(name_, getter_type_) \
NS_IMETHODIMP nsHTMLFrameSetElement::GetOn##name_(JSContext *cx, \
jsval *vp) { \
/* XXXbz note to self: add tests for this! */ \
nsPIDOMWindow* win = OwnerDoc()->GetInnerWindow(); \
if (win && win->IsInnerWindow()) { \
nsCOMPtr<nsIInlineEventHandlers> ev = do_QueryInterface(win); \
return ev->GetOn##name_(cx, vp); \
} \
*vp = JSVAL_NULL; \
getter_type_ h = nsGenericHTMLElement::GetOn##name_(); \
vp->setObjectOrNull(h ? h->Callable() : nullptr); \
return NS_OK; \
} \
NS_IMETHODIMP nsHTMLFrameSetElement::SetOn##name_(JSContext *cx, \
const jsval &v) { \
nsPIDOMWindow* win = OwnerDoc()->GetInnerWindow(); \
if (win && win->IsInnerWindow()) { \
nsCOMPtr<nsIInlineEventHandlers> ev = do_QueryInterface(win); \
return ev->SetOn##name_(cx, v); \
JSObject *obj = GetWrapper(); \
if (!obj) { \
/* Just silently do nothing */ \
return NS_OK; \
} \
return NS_OK; \
nsRefPtr<EventHandlerNonNull> handler; \
JSObject *callable; \
if (v.isObject() && \
JS_ObjectIsCallable(cx, callable = &v.toObject())) { \
bool ok; \
handler = new EventHandlerNonNull(cx, obj, callable, &ok); \
if (!ok) { \
return NS_ERROR_OUT_OF_MEMORY; \
} \
} \
ErrorResult rv; \
nsGenericHTMLElement::SetOn##name_(handler, rv); \
return rv.ErrorCode(); \
}
#define FORWARDED_EVENT(name_, id_, type_, struct_) \
FORWARDED_EVENT_HELPER(name_, EventHandlerNonNull*)
#define ERROR_EVENT(name_, id_, type_, struct_) \
FORWARDED_EVENT_HELPER(name_, nsCOMPtr<EventHandlerNonNull>)
#define WINDOW_EVENT(name_, id_, type_, struct_) \
NS_IMETHODIMP nsHTMLFrameSetElement::GetOn##name_(JSContext *cx, \
jsval *vp) { \
@ -367,5 +377,7 @@ nsHTMLFrameSetElement::ParseRowCol(const nsAString & aValue,
}
#include "nsEventNameList.h"
#undef WINDOW_EVENT
#undef ERROR_EVENT
#undef FORWARDED_EVENT
#undef FORWARDED_EVENT_HELPER
#undef EVENT

View File

@ -670,11 +670,7 @@ nsHTMLOptionCollection::Add(const HTMLOptionOrOptGroupElement& aElement,
if (aBefore.IsNull()) {
mSelect->Add(element, (nsGenericHTMLElement*)nullptr, aError);
} else if (aBefore.Value().IsHTMLElement()) {
nsCOMPtr<nsIContent> content =
do_QueryInterface(aBefore.Value().GetAsHTMLElement());
nsGenericHTMLElement* before =
static_cast<nsGenericHTMLElement*>(content.get());
mSelect->Add(element, before, aError);
mSelect->Add(element, &aBefore.Value().GetAsHTMLElement(), aError);
} else {
mSelect->Add(element, aBefore.Value().GetAsLong(), aError);
}

View File

@ -11220,27 +11220,16 @@ nsGlobalWindow::DisableNetworkEvent(uint32_t aType)
#define EVENT(name_, id_, type_, struct_) \
NS_IMETHODIMP nsGlobalWindow::GetOn##name_(JSContext *cx, \
jsval *vp) { \
nsEventListenerManager *elm = GetListenerManager(false); \
if (elm) { \
EventHandlerNonNull* h = elm->GetEventHandler(nsGkAtoms::on##name_); \
if (h) { \
*vp = JS::ObjectValue(*h->Callable()); \
return NS_OK; \
} \
} \
*vp = JSVAL_NULL; \
EventHandlerNonNull* h = GetOn##name_(); \
vp->setObjectOrNull(h ? h->Callable() : nullptr); \
return NS_OK; \
} \
NS_IMETHODIMP nsGlobalWindow::SetOn##name_(JSContext *cx, \
const jsval &v) { \
nsEventListenerManager *elm = GetListenerManager(true); \
if (!elm) { \
return NS_ERROR_OUT_OF_MEMORY; \
} \
\
JSObject *obj = mJSObject; \
if (!obj) { \
return NS_ERROR_UNEXPECTED; \
/* Just silently do nothing */ \
return NS_OK; \
} \
nsRefPtr<EventHandlerNonNull> handler; \
JSObject *callable; \
@ -11252,7 +11241,9 @@ nsGlobalWindow::DisableNetworkEvent(uint32_t aType)
return NS_ERROR_OUT_OF_MEMORY; \
} \
} \
return elm->SetEventHandler(nsGkAtoms::on##name_, handler); \
ErrorResult rv; \
SetOn##name_(handler, rv); \
return rv.ErrorCode(); \
}
#define ERROR_EVENT(name_, id_, type_, struct_) \
NS_IMETHODIMP nsGlobalWindow::GetOn##name_(JSContext *cx, \
@ -11334,5 +11325,7 @@ nsGlobalWindow::DisableNetworkEvent(uint32_t aType)
#include "nsEventNameList.h"
#undef TOUCH_EVENT
#undef WINDOW_ONLY_EVENT
#undef BEFOREUNLOAD_EVENT
#undef ERROR_EVENT
#undef EVENT

View File

@ -619,6 +619,64 @@ public:
{
mAllowScriptsToClose = true;
}
#define EVENT(name_, id_, type_, struct_) \
mozilla::dom::EventHandlerNonNull* GetOn##name_() \
{ \
nsEventListenerManager *elm = GetListenerManager(false); \
return elm ? elm->GetEventHandler(nsGkAtoms::on##name_) : nullptr; \
} \
void SetOn##name_(mozilla::dom::EventHandlerNonNull* handler, \
mozilla::ErrorResult& error) \
{ \
nsEventListenerManager *elm = GetListenerManager(true); \
if (elm) { \
error = elm->SetEventHandler(nsGkAtoms::on##name_, handler); \
} else { \
error.Throw(NS_ERROR_OUT_OF_MEMORY); \
} \
}
#define ERROR_EVENT(name_, id_, type_, struct_) \
mozilla::dom::OnErrorEventHandlerNonNull* GetOn##name_() \
{ \
nsEventListenerManager *elm = GetListenerManager(false); \
return elm ? elm->GetOnErrorEventHandler() : nullptr; \
} \
void SetOn##name_(mozilla::dom::OnErrorEventHandlerNonNull* handler, \
mozilla::ErrorResult& error) \
{ \
nsEventListenerManager *elm = GetListenerManager(true); \
if (elm) { \
error = elm->SetEventHandler(handler); \
} else { \
error.Throw(NS_ERROR_OUT_OF_MEMORY); \
} \
}
#define BEFOREUNLOAD_EVENT(name_, id_, type_, struct_) \
mozilla::dom::BeforeUnloadEventHandlerNonNull* GetOn##name_() \
{ \
nsEventListenerManager *elm = GetListenerManager(false); \
return elm ? elm->GetOnBeforeUnloadEventHandler() : nullptr; \
} \
void SetOn##name_(mozilla::dom::BeforeUnloadEventHandlerNonNull* handler, \
mozilla::ErrorResult& error) \
{ \
nsEventListenerManager *elm = GetListenerManager(true); \
if (elm) { \
error = elm->SetEventHandler(handler); \
} else { \
error.Throw(NS_ERROR_OUT_OF_MEMORY); \
} \
}
#define WINDOW_ONLY_EVENT EVENT
#define TOUCH_EVENT EVENT
#include "nsEventNameList.h"
#undef TOUCH_EVENT
#undef WINDOW_ONLY_EVENT
#undef BEFOREUNLOAD_EVENT
#undef ERROR_EVENT
#undef EVENT
protected:
// Array of idle observers that are notified of idle events.
nsTObserverArray<IdleObserverHolder> mIdleObservers;

View File

@ -260,6 +260,17 @@ DOMInterfaces = {
'resultNotAddRefed': [ 'item' ]
},
'HTMLElement': {
'nativeType': 'nsGenericHTMLElement',
'register': False,
'hasXPConnectImpls': True,
'hasInstanceInterface': 'nsIDOMHTMLElement',
'resultNotAddRefed': [
'itemType', 'itemRef', 'itemProp', 'properties', 'contextMenu', 'style',
'offsetParent'
]
},
'HTMLOptionsCollection': {
'nativeType': 'nsHTMLOptionCollection',
'headerFile': 'nsHTMLSelectElement.h',
@ -274,6 +285,12 @@ DOMInterfaces = {
'resultNotAddRefed': [ 'item', 'namedItem', 'names' ]
},
'HTMLUnknownElement': {
'nativeType': 'nsHTMLUnknownElement',
'register': False,
'hasXPConnectImpls': True
},
'IID': [
{
'nativeType': 'nsIJSID',
@ -728,6 +745,7 @@ def addExternalHTMLElement(element):
addExternalHTMLElement('HTMLCanvasElement')
addExternalHTMLElement('HTMLImageElement')
addExternalHTMLElement('HTMLMenuElement')
addExternalHTMLElement('HTMLOptionElement')
addExternalHTMLElement('HTMLOptGroupElement')
addExternalHTMLElement('HTMLVideoElement')
@ -743,7 +761,6 @@ addExternalIface('DOMStringList', nativeType='nsDOMStringList',
headerFile='nsDOMLists.h')
addExternalIface('File')
addExternalIface('HitRegionOptions', nativeType='nsISupports')
addExternalIface('HTMLElement')
addExternalIface('LockedFile')
addExternalIface('MediaStream')
addExternalIface('NamedNodeMap')

View File

@ -10,7 +10,6 @@
* liability, trademark and document use rules apply.
*/
interface HTMLElement;
interface HTMLOptionElement;
interface HTMLOptGroupElement;

View File

@ -39,6 +39,7 @@ webidl_files = \
Function.webidl \
GainNode.webidl \
HTMLCollection.webidl \
HTMLElement.webidl \
HTMLOptionsCollection.webidl \
HTMLPropertiesCollection.webidl \
ImageData.webidl \

View File

@ -178,35 +178,6 @@ members = [
'nsIDOMHTMLDocument.getSelection',
'nsIDOMHTMLDocument.designMode',
'nsIDOMHTMLDocument.head',
# We can't quick stub nsIDOMHTMLElement.* because we don't
# generate quick stubs for nsIVariant attributes.
'nsIDOMHTMLElement.id',
'nsIDOMHTMLElement.title',
'nsIDOMHTMLElement.lang',
'nsIDOMHTMLElement.dir',
'nsIDOMHTMLElement.className',
'nsIDOMHTMLElement.dataset',
'nsIDOMHTMLElement.itemScope',
'nsIDOMHTMLElement.itemId',
'nsIDOMHTMLElement.properties',
'nsIDOMHTMLElement.hidden',
'nsIDOMHTMLElement.click',
'nsIDOMHTMLElement.tabIndex',
'nsIDOMHTMLElement.focus',
'nsIDOMHTMLElement.accessKey',
'nsIDOMHTMLElement.accessKeyLabel',
'nsIDOMHTMLElement.draggable',
'nsIDOMHTMLElement.contentEditable',
'nsIDOMHTMLElement.isContentEditable',
'nsIDOMHTMLElement.contextMenu',
'nsIDOMHTMLElement.spellcheck',
'nsIDOMHTMLElement.innerHTML',
'nsIDOMHTMLElement.outerHTML',
'nsIDOMHTMLElement.offsetParent',
'nsIDOMHTMLElement.offsetTop',
'nsIDOMHTMLElement.offsetLeft',
'nsIDOMHTMLElement.offsetWidth',
'nsIDOMHTMLElement.offsetHeight',
'nsIDOMHTMLFormElement.elements',
'nsIDOMHTMLFormElement.name',
'nsIDOMHTMLFormElement.submit',
@ -450,7 +421,8 @@ customIncludes = [
'nsHTMLMenuElement.h',
'nsICSSDeclaration.h',
'mozilla/dom/NodeBinding.h',
'mozilla/dom/ElementBinding.h'
'mozilla/dom/ElementBinding.h',
'mozilla/dom/HTMLElementBinding.h'
]
customReturnInterfaces = [
@ -523,60 +495,6 @@ customMethodCalls = {
' nsCOMPtr<nsINodeList> result = self->QuerySelectorAll(arg0, error);\n'
' rv = error.ErrorCode();'
},
'nsIDOMHTMLElement_': {
'thisType': 'nsGenericHTMLElement'
},
'nsIDOMHTMLElement_DOMClick': {
'thisType' : 'nsGenericHTMLElement',
'code': ' self->Click();',
'canFail': False
},
'nsIDOMHTMLElement_GetTabIndex': {
'thisType' : 'nsGenericHTMLElement',
'code': ' int32_t result = self->TabIndex();',
'canFail': False
},
'nsIDOMHTMLElement_SetTabIndex': {
'thisType' : 'nsGenericHTMLElement',
'code': ' mozilla::ErrorResult error;\n'
' self->SetTabIndex(arg0, error);\n'
' rv = error.ErrorCode();'
},
'nsIDOMHTMLElement_Focus': {
'thisType' : 'nsGenericHTMLElement',
'code': ' mozilla::ErrorResult error;\n'
' self->Focus(error);\n'
' rv = error.ErrorCode();'
},
'nsIDOMHTMLElement_GetDraggable': {
'thisType' : 'nsGenericHTMLElement',
'code': ' bool result = self->Draggable();',
'canFail': False
},
'nsIDOMHTMLElement_SetDraggable': {
'thisType' : 'nsGenericHTMLElement',
'code': ' mozilla::ErrorResult error;\n'
' self->SetDraggable(arg0, error);\n'
' rv = error.ErrorCode();'
},
'nsIDOMHTMLElement_GetInnerHTML': {
'thisType' : 'nsGenericHTMLElement',
'code': ' nsString result;\n'
' mozilla::ErrorResult error;\n'
' self->GetInnerHTML(result, error);\n'
' rv = error.ErrorCode();'
},
'nsIDOMHTMLElement_SetInnerHTML': {
'thisType' : 'nsGenericHTMLElement',
'code': ' mozilla::ErrorResult error;\n'
' self->SetInnerHTML(arg0, error);\n'
' rv = error.ErrorCode();'
},
'nsIDOMHTMLElement_GetDataset': {
'thisType' : 'nsGenericHTMLElement',
'code': ' nsRefPtr<nsDOMStringMap> result = self->Dataset();',
'canFail': False
},
'nsIDOMElementCSSInlineStyle_GetStyle': {
'thisType': 'nsStyledElement',
'code': ' /* XXXbz MathML elements inherit from nsStyledElement but\n'
@ -650,168 +568,6 @@ customMethodCalls = {
'thisType' : 'nsDocument',
'unwrapThisFailureFatal' : False
},
'nsIDOMHTMLElement_GetTitle': {
'thisType' : 'nsGenericHTMLElement',
'canFail': False
},
'nsIDOMHTMLElement_SetTitle': {
'thisType' : 'nsGenericHTMLElement',
'canFail': False
},
'nsIDOMHTMLElement_GetLang': {
'thisType' : 'nsGenericHTMLElement',
'canFail': False
},
'nsIDOMHTMLElement_SetLang': {
'thisType' : 'nsGenericHTMLElement',
'canFail': False
},
'nsIDOMHTMLElement_GetDir': {
'thisType' : 'nsGenericHTMLElement',
'canFail': False
},
'nsIDOMHTMLElement_SetDir': {
'thisType' : 'nsGenericHTMLElement',
'code': ' mozilla::ErrorResult error;\n'
' self->SetDir(arg0, error);\n'
' rv = error.ErrorCode();'
},
'nsIDOMHTMLElement_GetItemScope': {
'thisType' : 'nsGenericHTMLElement',
'code': ' bool result = self->ItemScope();',
'canFail': False
},
'nsIDOMHTMLElement_SetItemScope': {
'thisType' : 'nsGenericHTMLElement',
'code': ' mozilla::ErrorResult error;\n'
' self->SetItemScope(arg0, error);\n'
' rv = error.ErrorCode();'
},
'nsIDOMHTMLElement_GetItemId': {
'thisType' : 'nsGenericHTMLElement',
'canFail': False
},
'nsIDOMHTMLElement_SetItemId': {
'thisType' : 'nsGenericHTMLElement',
'code': ' mozilla::ErrorResult error;\n'
' self->SetItemId(arg0, error);\n'
' rv = error.ErrorCode();'
},
'nsIDOMHTMLElement_GetProperties': {
'thisType' : 'nsGenericHTMLElement',
'code': ' nsIDOMHTMLPropertiesCollection* result = self->Properties();',
'canFail': False
},
'nsIDOMHTMLElement_GetHidden': {
'thisType' : 'nsGenericHTMLElement',
'code': ' bool result = self->Hidden();',
'canFail': False
},
'nsIDOMHTMLElement_SetHidden': {
'thisType' : 'nsGenericHTMLElement',
'code': ' mozilla::ErrorResult error;\n'
' self->SetHidden(arg0, error);\n'
' rv = error.ErrorCode();'
},
'nsIDOMHTMLElement_GetId': {
'thisType' : 'nsGenericHTMLElement',
'canFail': False
},
'nsIDOMHTMLElement_SetId': {
'thisType' : 'nsGenericHTMLElement',
'canFail': False
},
'nsIDOMHTMLElement_GetAccessKey': {
'thisType' : 'nsGenericHTMLElement',
'canFail': False
},
'nsIDOMHTMLElement_SetAccessKey': {
'thisType' : 'nsGenericHTMLElement',
'code': ' mozilla::ErrorResult error;\n'
' self->SetAccessKey(arg0, error);\n'
' rv = error.ErrorCode();'
},
'nsIDOMHTMLElement_GetAccessKeyLabel': {
'thisType' : 'nsGenericHTMLElement',
'canFail': False
},
'nsIDOMHTMLElement_GetSpellcheck': {
'thisType' : 'nsGenericHTMLElement',
'code': ' bool result = self->Spellcheck();',
'canFail': False
},
'nsIDOMHTMLElement_SetSpellcheck': {
'thisType' : 'nsGenericHTMLElement',
'code': ' mozilla::ErrorResult error;\n'
' self->SetSpellcheck(arg0, error);\n'
' rv = error.ErrorCode();'
},
'nsIDOMHTMLElement_GetOuterHTML': {
'thisType' : 'nsGenericHTMLElement',
'code': ' nsString result;\n'
' mozilla::ErrorResult error;\n'
' self->GetOuterHTML(result, error);\n'
' rv = error.ErrorCode();'
},
'nsIDOMHTMLElement_SetOuterHTML': {
'thisType' : 'nsGenericHTMLElement',
'code': ' mozilla::ErrorResult error;\n'
' self->SetOuterHTML(arg0, error);\n'
' rv = error.ErrorCode();'
},
'nsIDOMHTMLElement_GetContentEditable': {
'thisType' : 'nsGenericHTMLElement',
'canFail': False
},
'nsIDOMHTMLElement_SetContentEditable': {
'thisType' : 'nsGenericHTMLElement',
'code': ' mozilla::ErrorResult error;\n'
' self->SetContentEditable(arg0, error);\n'
' rv = error.ErrorCode();'
},
'nsIDOMHTMLElement_GetIsContentEditable': {
'thisType' : 'nsGenericHTMLElement',
'code': ' bool result = self->IsContentEditable();',
'canFail': False
},
'nsIDOMHTMLElement_GetContextMenu': {
'thisType' : 'nsGenericHTMLElement',
'code': ' mozilla::dom::Element* result = self->GetContextMenu();',
'canFail': False
},
'nsIDOMHTMLElement_GetOffsetParent': {
'thisType' : 'nsGenericHTMLElement',
'code': ' mozilla::dom::Element* result = self->GetOffsetParent();',
'canFail': False
},
'nsIDOMHTMLElement_GetOffsetTop': {
'thisType' : 'nsGenericHTMLElement',
'code': ' uint32_t result = self->OffsetTop();',
'canFail': False
},
'nsIDOMHTMLElement_GetOffsetLeft': {
'thisType' : 'nsGenericHTMLElement',
'code': ' uint32_t result = self->OffsetLeft();',
'canFail': False
},
'nsIDOMHTMLElement_GetOffsetWidth': {
'thisType' : 'nsGenericHTMLElement',
'code': ' uint32_t result = self->OffsetWidth();',
'canFail': False
},
'nsIDOMHTMLElement_GetOffsetHeight': {
'thisType' : 'nsGenericHTMLElement',
'code': ' uint32_t result = self->OffsetHeight();',
'canFail': False
},
'nsIDOMHTMLElement_GetClassName': {
'thisType' : 'nsGenericHTMLElement',
'canFail': False
},
'nsIDOMHTMLElement_SetClassName': {
'thisType' : 'nsGenericHTMLElement',
'canFail': False
},
'nsIDOMWindow_GetOnmouseenter' : {
'thisType' : 'nsIDOMWindow',
'unwrapThisFailureFatal' : False
@ -832,5 +588,6 @@ customMethodCalls = {
newBindingProperties = {
'nsIDOMNode': 'mozilla::dom::NodeBinding::sNativePropertyHooks.mNativeProperties.regular',
'nsIDOMElement': 'mozilla::dom::ElementBinding::sNativePropertyHooks.mNativeProperties.regular'
'nsIDOMElement': 'mozilla::dom::ElementBinding::sNativePropertyHooks.mNativeProperties.regular',
'nsIDOMHTMLElement': 'mozilla::dom::HTMLElementBinding::sNativePropertyHooks.mNativeProperties.regular'
}