From f4edbb98499be140000bcb0f16daa74035fb3bf6 Mon Sep 17 00:00:00 2001 From: "jst%netscape.com" Date: Fri, 22 Sep 2000 10:18:07 +0000 Subject: [PATCH] Redoing how 'replaceable' properties on DOM objects are resolved to be compatible with 4.x, with this change named frames in framesets override 'replaceable' properties so that window.toolbar (or any replaceable property) in a frameset document with a frame named 'toolbar' actually resolves to the frame, and not the native toolbar. r/a=brendan, r=rpotts&scc --- content/base/src/nsDocument.cpp | 5 +- content/base/src/nsDocument.h | 3 +- content/base/src/nsGenericElement.cpp | 5 +- content/base/src/nsGenericElement.h | 10 +- .../html/content/src/nsHTMLAppletElement.cpp | 7 +- .../html/content/src/nsHTMLEmbedElement.cpp | 8 +- .../html/content/src/nsHTMLFormElement.cpp | 10 +- .../html/content/src/nsHTMLImageElement.cpp | 10 +- .../html/content/src/nsHTMLSelectElement.cpp | 22 +- .../html/content/src/nsHTMLSpacerElement.cpp | 8 +- content/html/document/src/nsHTMLDocument.cpp | 7 +- content/html/document/src/nsHTMLDocument.h | 3 +- content/xml/content/src/nsXMLElement.h | 5 +- content/xul/content/src/nsXULElement.cpp | 5 +- content/xul/content/src/nsXULElement.h | 3 +- content/xul/document/src/nsXULDocument.cpp | 5 +- content/xul/document/src/nsXULDocument.h | 3 +- dom/public/nsIJSScriptObject.h | 3 +- dom/src/base/nsGlobalWindow.cpp | 23 +- dom/src/base/nsGlobalWindow.h | 6 +- dom/src/base/nsJSBarProp.cpp | 24 +- dom/src/base/nsJSCRMFObject.cpp | 24 +- dom/src/base/nsJSCrypto.cpp | 24 +- dom/src/base/nsJSDOMException.cpp | 30 +- dom/src/base/nsJSHistory.cpp | 30 +- dom/src/base/nsJSLocation.cpp | 36 +-- dom/src/base/nsJSMimeType.cpp | 30 +- dom/src/base/nsJSMimeTypeArray.cpp | 24 +- dom/src/base/nsJSNavigator.cpp | 52 ++-- dom/src/base/nsJSPkcs11.cpp | 22 +- dom/src/base/nsJSPlugin.cpp | 30 +- dom/src/base/nsJSPluginArray.cpp | 24 +- dom/src/base/nsJSScreen.cpp | 42 +-- dom/src/base/nsJSUtils.cpp | 78 ++++- dom/src/base/nsJSUtils.h | 29 +- dom/src/base/nsJSWindow.cpp | 278 +++++++++--------- dom/src/base/nsJSWindowCollection.cpp | 24 +- dom/src/base/nsLocation.cpp | 7 +- dom/src/coreDOM/nsJSAttr.cpp | 30 +- dom/src/coreDOM/nsJSCDATASection.cpp | 22 +- dom/src/coreDOM/nsJSCharacterData.cpp | 26 +- dom/src/coreDOM/nsJSComment.cpp | 22 +- dom/src/coreDOM/nsJSDOMImplementation.cpp | 22 +- dom/src/coreDOM/nsJSDocument.cpp | 38 +-- dom/src/coreDOM/nsJSDocumentFragment.cpp | 22 +- dom/src/coreDOM/nsJSDocumentType.cpp | 34 +-- dom/src/coreDOM/nsJSElement.cpp | 24 +- dom/src/coreDOM/nsJSEntity.cpp | 28 +- dom/src/coreDOM/nsJSEntityReference.cpp | 22 +- dom/src/coreDOM/nsJSMediaList.cpp | 26 +- dom/src/coreDOM/nsJSNamedNodeMap.cpp | 24 +- dom/src/coreDOM/nsJSNode.cpp | 50 ++-- dom/src/coreDOM/nsJSNodeList.cpp | 24 +- dom/src/coreDOM/nsJSNotation.cpp | 26 +- dom/src/coreDOM/nsJSProcessingInstruction.cpp | 28 +- dom/src/coreDOM/nsJSStyleSheet.cpp | 36 +-- dom/src/coreDOM/nsJSStyleSheetList.cpp | 24 +- dom/src/coreDOM/nsJSText.cpp | 22 +- dom/src/css/nsJSCSS2Properties.cpp | 100 +++---- dom/src/css/nsJSCSSFontFaceRule.cpp | 24 +- dom/src/css/nsJSCSSImportRule.cpp | 28 +- dom/src/css/nsJSCSSMediaRule.cpp | 26 +- dom/src/css/nsJSCSSPageRule.cpp | 26 +- dom/src/css/nsJSCSSPrimitiveValue.cpp | 24 +- dom/src/css/nsJSCSSRule.cpp | 30 +- dom/src/css/nsJSCSSRuleList.cpp | 24 +- dom/src/css/nsJSCSSStyleDeclaration.cpp | 28 +- dom/src/css/nsJSCSSStyleRule.cpp | 26 +- dom/src/css/nsJSCSSStyleSheet.cpp | 26 +- dom/src/css/nsJSCSSUnknownRule.cpp | 22 +- dom/src/css/nsJSCSSValue.cpp | 26 +- dom/src/css/nsJSCounter.cpp | 28 +- dom/src/css/nsJSRGBColor.cpp | 28 +- dom/src/css/nsJSRect.cpp | 30 +- dom/src/events/nsJSEvent.cpp | 38 +-- dom/src/events/nsJSKeyEvent.cpp | 4 +- dom/src/events/nsJSUIEvent.cpp | 44 +-- dom/src/html/nsJSHTMLAnchorElement.cpp | 62 ++-- dom/src/html/nsJSHTMLAppletElement.cpp | 44 +-- dom/src/html/nsJSHTMLAreaElement.cpp | 100 +++---- dom/src/html/nsJSHTMLBRElement.cpp | 24 +- dom/src/html/nsJSHTMLBaseElement.cpp | 26 +- dom/src/html/nsJSHTMLBaseFontElement.cpp | 28 +- dom/src/html/nsJSHTMLBodyElement.cpp | 34 +-- dom/src/html/nsJSHTMLButtonElement.cpp | 36 +-- dom/src/html/nsJSHTMLCollection.cpp | 24 +- dom/src/html/nsJSHTMLDListElement.cpp | 24 +- dom/src/html/nsJSHTMLDirectoryElement.cpp | 24 +- dom/src/html/nsJSHTMLDivElement.cpp | 24 +- dom/src/html/nsJSHTMLDocument.cpp | 62 ++-- dom/src/html/nsJSHTMLElement.cpp | 46 +-- dom/src/html/nsJSHTMLEmbedElement.cpp | 34 +-- dom/src/html/nsJSHTMLFieldSetElement.cpp | 24 +- dom/src/html/nsJSHTMLFontElement.cpp | 28 +- dom/src/html/nsJSHTMLFormControlList.cpp | 22 +- dom/src/html/nsJSHTMLFormElement.cpp | 40 +-- dom/src/html/nsJSHTMLFrameElement.cpp | 40 +-- dom/src/html/nsJSHTMLFrameSetElement.cpp | 26 +- dom/src/html/nsJSHTMLHRElement.cpp | 30 +- dom/src/html/nsJSHTMLHeadElement.cpp | 24 +- dom/src/html/nsJSHTMLHeadingElement.cpp | 24 +- dom/src/html/nsJSHTMLHtmlElement.cpp | 24 +- dom/src/html/nsJSHTMLIFrameElement.cpp | 44 +-- dom/src/html/nsJSHTMLImageElement.cpp | 100 +++---- dom/src/html/nsJSHTMLInputElement.cpp | 66 ++--- dom/src/html/nsJSHTMLIsIndexElement.cpp | 26 +- dom/src/html/nsJSHTMLLIElement.cpp | 26 +- dom/src/html/nsJSHTMLLabelElement.cpp | 28 +- dom/src/html/nsJSHTMLLayerElement.cpp | 38 +-- dom/src/html/nsJSHTMLLegendElement.cpp | 28 +- dom/src/html/nsJSHTMLLinkElement.cpp | 42 +-- dom/src/html/nsJSHTMLMapElement.cpp | 26 +- dom/src/html/nsJSHTMLMenuElement.cpp | 24 +- dom/src/html/nsJSHTMLMetaElement.cpp | 30 +- dom/src/html/nsJSHTMLModElement.cpp | 26 +- dom/src/html/nsJSHTMLOListElement.cpp | 28 +- dom/src/html/nsJSHTMLObjectElement.cpp | 100 +++---- dom/src/html/nsJSHTMLOptGroupElement.cpp | 26 +- dom/src/html/nsJSHTMLOptionElement.cpp | 38 +-- dom/src/html/nsJSHTMLParagraphElement.cpp | 24 +- dom/src/html/nsJSHTMLParamElement.cpp | 30 +- dom/src/html/nsJSHTMLPreElement.cpp | 24 +- dom/src/html/nsJSHTMLQuoteElement.cpp | 24 +- dom/src/html/nsJSHTMLScriptElement.cpp | 36 +-- dom/src/html/nsJSHTMLSelectElement.cpp | 44 +-- dom/src/html/nsJSHTMLStyleElement.cpp | 30 +- dom/src/html/nsJSHTMLTableCaptionElement.cpp | 24 +- dom/src/html/nsJSHTMLTableCellElement.cpp | 100 +++---- dom/src/html/nsJSHTMLTableColElement.cpp | 34 +-- dom/src/html/nsJSHTMLTableElement.cpp | 50 ++-- dom/src/html/nsJSHTMLTableRowElement.cpp | 38 +-- dom/src/html/nsJSHTMLTableSectionElement.cpp | 32 +- dom/src/html/nsJSHTMLTextAreaElement.cpp | 46 +-- dom/src/html/nsJSHTMLTitleElement.cpp | 24 +- dom/src/html/nsJSHTMLUListElement.cpp | 26 +- dom/src/html/nsJSNSHTMLOptionCollection.cpp | 26 +- dom/src/range/nsJSRange.cpp | 34 +-- dom/src/xul/nsJSXULCommandDispatcher.cpp | 32 +- dom/src/xul/nsJSXULDocument.cpp | 34 +-- dom/src/xul/nsJSXULElement.cpp | 38 +-- dom/src/xul/nsJSXULTreeElement.cpp | 28 +- dom/tools/JSStubGen.cpp | 134 +++++++-- layout/base/src/nsDocument.cpp | 5 +- layout/base/src/nsDocument.h | 3 +- layout/base/src/nsGenericElement.cpp | 5 +- layout/base/src/nsGenericElement.h | 10 +- .../html/content/src/nsHTMLAppletElement.cpp | 7 +- .../html/content/src/nsHTMLEmbedElement.cpp | 8 +- layout/html/content/src/nsHTMLFormElement.cpp | 10 +- .../html/content/src/nsHTMLImageElement.cpp | 10 +- .../html/content/src/nsHTMLSelectElement.cpp | 22 +- .../html/content/src/nsHTMLSpacerElement.cpp | 8 +- layout/html/document/src/nsHTMLDocument.cpp | 7 +- layout/html/document/src/nsHTMLDocument.h | 3 +- layout/xml/content/src/nsXMLElement.h | 5 +- rdf/content/src/nsJSXULCommandDispatcher.cpp | 32 +- rdf/content/src/nsJSXULDocument.cpp | 34 +-- rdf/content/src/nsJSXULElement.cpp | 38 +-- rdf/content/src/nsJSXULMenuListElement.cpp | 36 +-- rdf/content/src/nsJSXULTreeElement.cpp | 28 +- rdf/content/src/nsXULDocument.cpp | 5 +- rdf/content/src/nsXULDocument.h | 3 +- rdf/content/src/nsXULElement.cpp | 5 +- rdf/content/src/nsXULElement.h | 3 +- xpfe/appshell/src/nsJSXPConnectFactory.cpp | 4 +- 165 files changed, 2555 insertions(+), 2309 deletions(-) diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index bb08ff330ad1..c8597f67ec83 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -3280,8 +3280,11 @@ PRBool nsDocument::EnumerateProperty(JSContext *aContext, JSObject *aObj) return PR_TRUE; } -PRBool nsDocument::Resolve(JSContext *aContext, JSObject *aObj, jsval aID) +PRBool nsDocument::Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty) { + *aDidDefineProperty = PR_FALSE; + return PR_TRUE; } diff --git a/content/base/src/nsDocument.h b/content/base/src/nsDocument.h index e50e6f5efaae..1326212d7b7e 100644 --- a/content/base/src/nsDocument.h +++ b/content/base/src/nsDocument.h @@ -462,7 +462,8 @@ public: virtual PRBool SetProperty(JSContext *aContext, JSObject *aObj, jsval aID, jsval *aVp); virtual PRBool EnumerateProperty(JSContext *aContext, JSObject *aObj); - virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID); + virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty); virtual PRBool Convert(JSContext *aContext, JSObject *aObj, jsval aID); virtual void Finalize(JSContext *aContext, JSObject *aObj); diff --git a/content/base/src/nsGenericElement.cpp b/content/base/src/nsGenericElement.cpp index b8cf5eaf6c42..07a998f01c0a 100644 --- a/content/base/src/nsGenericElement.cpp +++ b/content/base/src/nsGenericElement.cpp @@ -1873,8 +1873,11 @@ nsGenericElement::EnumerateProperty(JSContext *aContext, JSObject *aObj) } PRBool -nsGenericElement::Resolve(JSContext *aContext, JSObject *aObj, jsval aID) +nsGenericElement::Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool* aDidDefineProperty) { + *aDidDefineProperty = PR_FALSE; + return PR_TRUE; } diff --git a/content/base/src/nsGenericElement.h b/content/base/src/nsGenericElement.h index a1f784e5f569..80ff4e99e269 100644 --- a/content/base/src/nsGenericElement.h +++ b/content/base/src/nsGenericElement.h @@ -224,7 +224,8 @@ public: PRBool SetProperty(JSContext *aContext, JSObject *aObj, jsval aID, jsval *aVp); PRBool EnumerateProperty(JSContext *aContext, JSObject *aObj); - PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID); + PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty); PRBool Convert(JSContext *aContext, JSObject *aObj, jsval aID); void Finalize(JSContext *aContext, JSObject *aObj); @@ -1393,11 +1394,12 @@ public: virtual PRBool EnumerateProperty(JSContext *aContext, JSObject *aObj) { \ return _g.EnumerateProperty(aContext, aObj); \ } \ - virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID) { \ - return _g.EnumerateProperty(aContext, aObj); \ + virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID, \ + PRBool *aDidDefineProperty) { \ + return _g.Resolve(aContext, aObj, aID, aDidDefineProperty); \ } \ virtual PRBool Convert(JSContext *aContext, JSObject *aObj, jsval aID) { \ - return _g.EnumerateProperty(aContext, aObj); \ + return _g.Convert(aContext, aObj, aID); \ } \ virtual void Finalize(JSContext *aContext, JSObject *aObj) { \ _g.Finalize(aContext, aObj); \ diff --git a/content/html/content/src/nsHTMLAppletElement.cpp b/content/html/content/src/nsHTMLAppletElement.cpp index 014eb3ec2752..bf2c49e23dc9 100644 --- a/content/html/content/src/nsHTMLAppletElement.cpp +++ b/content/html/content/src/nsHTMLAppletElement.cpp @@ -93,11 +93,12 @@ public: virtual PRBool EnumerateProperty(JSContext *aContext, JSObject *aObj) { return mInner.EnumerateProperty(aContext, aObj); } - virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID) { - return mInner.EnumerateProperty(aContext, aObj); + virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty) { + return mInner.Resolve(aContext, aObj, aID, aDidDefineProperty); } virtual PRBool Convert(JSContext *aContext, JSObject *aObj, jsval aID) { - return mInner.EnumerateProperty(aContext, aObj); + return mInner.Convert(aContext, aObj, aID); } virtual void Finalize(JSContext *aContext, JSObject *aObj) { mInner.Finalize(aContext, aObj); diff --git a/content/html/content/src/nsHTMLEmbedElement.cpp b/content/html/content/src/nsHTMLEmbedElement.cpp index 10eaaacf9df7..ba3a8f665985 100644 --- a/content/html/content/src/nsHTMLEmbedElement.cpp +++ b/content/html/content/src/nsHTMLEmbedElement.cpp @@ -83,7 +83,8 @@ public: virtual PRBool SetProperty(JSContext *aContext, JSObject *aObj, jsval aID, jsval *aVp); virtual PRBool EnumerateProperty(JSContext *aContext, JSObject *aObj); - virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID); + virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool* aDidDefineProperty); virtual PRBool Convert(JSContext *aContext, JSObject *aObj, jsval aID); virtual void Finalize(JSContext *aContext, JSObject *aObj); @@ -486,9 +487,10 @@ nsHTMLEmbedElement::EnumerateProperty(JSContext *aContext, JSObject *aObj) } PRBool -nsHTMLEmbedElement::Resolve(JSContext *aContext, JSObject *aObj, jsval aID) +nsHTMLEmbedElement::Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty) { - return mInner.Resolve(aContext, aObj, aID); + return mInner.Resolve(aContext, aObj, aID, aDidDefineProperty); } PRBool diff --git a/content/html/content/src/nsHTMLFormElement.cpp b/content/html/content/src/nsHTMLFormElement.cpp index 5f5a31e58eb2..bd41beb16b74 100644 --- a/content/html/content/src/nsHTMLFormElement.cpp +++ b/content/html/content/src/nsHTMLFormElement.cpp @@ -98,7 +98,8 @@ public: virtual PRBool SetProperty(JSContext *aContext, JSObject *aObj, jsval aID, jsval *aVp); virtual PRBool EnumerateProperty(JSContext *aContext, JSObject *aObj); - virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID); + virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty); virtual PRBool Convert(JSContext *aContext, JSObject *aObj, jsval aID); virtual void Finalize(JSContext *aContext, JSObject *aObj); @@ -615,7 +616,8 @@ nsHTMLFormElement::EnumerateProperty(JSContext *aContext, JSObject *aObj) PRBool -nsHTMLFormElement::Resolve(JSContext *aContext, JSObject *aObj, jsval aID) +nsHTMLFormElement::Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty) { if (!JSVAL_IS_STRING(aID)) { return PR_TRUE; @@ -675,9 +677,11 @@ nsHTMLFormElement::Resolve(JSContext *aContext, JSObject *aObj, jsval aID) ret = ::JS_DefineProperty(aContext, myObj, str, OBJECT_TO_JSVAL(obj), nsnull, nsnull, 0); + + *aDidDefineProperty = PR_TRUE; } else { - ret = mInner.Resolve(aContext, aObj, aID); + ret = mInner.Resolve(aContext, aObj, aID, aDidDefineProperty); } return ret; diff --git a/content/html/content/src/nsHTMLImageElement.cpp b/content/html/content/src/nsHTMLImageElement.cpp index 6df08b6d9a91..18bd346d0d98 100644 --- a/content/html/content/src/nsHTMLImageElement.cpp +++ b/content/html/content/src/nsHTMLImageElement.cpp @@ -103,7 +103,8 @@ public: virtual PRBool SetProperty(JSContext *aContext, JSObject *aObj, jsval aID, jsval *aVp); virtual PRBool EnumerateProperty(JSContext *aContext, JSObject *aObj); - virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID); + virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty); virtual PRBool Convert(JSContext *aContext, JSObject *aObj, jsval aID); virtual void Finalize(JSContext *aContext, JSObject *aObj); @@ -723,7 +724,8 @@ nsHTMLImageElement::EnumerateProperty(JSContext *aContext, JSObject *aObj) } PRBool -nsHTMLImageElement::Resolve(JSContext *aContext, JSObject *aObj, jsval aID) +nsHTMLImageElement::Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty) { if (JSVAL_IS_STRING(aID) && mInner.mDOMSlots) { JSString *str; @@ -742,11 +744,13 @@ nsHTMLImageElement::Resolve(JSContext *aContext, JSObject *aObj, jsval aID) chars, ::JS_GetStringLength(str), JSVAL_VOID, nsnull, nsnull, 0); + *aDidDefineProperty = PR_TRUE; + return PR_TRUE; } } - return mInner.Resolve(aContext, aObj, aID); + return mInner.Resolve(aContext, aObj, aID, aDidDefineProperty); } PRBool diff --git a/content/html/content/src/nsHTMLSelectElement.cpp b/content/html/content/src/nsHTMLSelectElement.cpp index 93b4da436f47..fa209bc78ffa 100644 --- a/content/html/content/src/nsHTMLSelectElement.cpp +++ b/content/html/content/src/nsHTMLSelectElement.cpp @@ -96,7 +96,8 @@ public: PRBool SetProperty(JSContext *aContext, JSObject *aObj, jsval aID, jsval *aVp); PRBool EnumerateProperty(JSContext *aContext, JSObject *aObj); - PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID); + PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty); PRBool Convert(JSContext *aContext, JSObject *aObj, jsval aID); void Finalize(JSContext *aContext, JSObject *aObj); @@ -294,7 +295,8 @@ public: virtual PRBool SetProperty(JSContext *aContext, JSObject *aObj, jsval aID, jsval *aVp); virtual PRBool EnumerateProperty(JSContext *aContext, JSObject *aObj); - virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID); + virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty); virtual PRBool Convert(JSContext *aContext, JSObject *aObj, jsval aID); virtual void Finalize(JSContext *aContext, JSObject *aObj); @@ -1545,9 +1547,9 @@ nsHTMLSelectElement::GetProperty(JSContext *aContext, PRBool nsHTMLSelectElement::SetProperty(JSContext *aContext, - JSObject *aObj, - jsval aID, - jsval *aVp) + JSObject *aObj, + jsval aID, + jsval *aVp) { nsresult res = NS_OK; // Set options in the options list by indexing into select @@ -1571,8 +1573,11 @@ nsHTMLSelectElement::EnumerateProperty(JSContext *aContext, JSObject *aObj) } PRBool -nsHTMLSelectElement::Resolve(JSContext *aContext, JSObject *aObj, jsval aID) +nsHTMLSelectElement::Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty) { + *aDidDefineProperty = PR_FALSE; + return PR_TRUE; } @@ -1926,8 +1931,11 @@ nsHTMLOptionCollection::EnumerateProperty(JSContext *aContext, JSObject *aObj) } PRBool -nsHTMLOptionCollection::Resolve(JSContext *aContext, JSObject *aObj, jsval aID) +nsHTMLOptionCollection::Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty) { + *aDidDefineProperty = PR_FALSE; + return PR_TRUE; } diff --git a/content/html/content/src/nsHTMLSpacerElement.cpp b/content/html/content/src/nsHTMLSpacerElement.cpp index a0f2e1efc50b..4f68850e4e10 100644 --- a/content/html/content/src/nsHTMLSpacerElement.cpp +++ b/content/html/content/src/nsHTMLSpacerElement.cpp @@ -90,7 +90,8 @@ public: virtual PRBool SetProperty(JSContext *aContext, JSObject *aObj, jsval aID, jsval *aVp); virtual PRBool EnumerateProperty(JSContext *aContext, JSObject *aObj); - virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID); + virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty); virtual PRBool Convert(JSContext *aContext, JSObject *aObj, jsval aID); virtual void Finalize(JSContext *aContext, JSObject *aObj); @@ -353,9 +354,10 @@ nsHTMLSpacerElement::EnumerateProperty(JSContext *aContext, JSObject *aObj) } PRBool -nsHTMLSpacerElement::Resolve(JSContext *aContext, JSObject *aObj, jsval aID) +nsHTMLSpacerElement::Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty) { - return mInner.Resolve(aContext, aObj, aID); + return mInner.Resolve(aContext, aObj, aID, aDidDefineProperty); } PRBool diff --git a/content/html/document/src/nsHTMLDocument.cpp b/content/html/document/src/nsHTMLDocument.cpp index bbd44b13dfbf..afe56a80ab36 100644 --- a/content/html/document/src/nsHTMLDocument.cpp +++ b/content/html/document/src/nsHTMLDocument.cpp @@ -3150,8 +3150,11 @@ nsHTMLDocument::GetScriptObject(nsIScriptContext *aContext, void** aScriptObject } PRBool -nsHTMLDocument::Resolve(JSContext *aContext, JSObject *aObj, jsval aID) +nsHTMLDocument::Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty) { + *aDidDefineProperty = PR_FALSE; + if (!JSVAL_IS_STRING(aID)) { return PR_TRUE; } @@ -3166,6 +3169,8 @@ nsHTMLDocument::Resolve(JSContext *aContext, JSObject *aObj, jsval aID) ret = ::JS_DefineProperty(aContext, aObj, str, val, nsnull, nsnull, 0); + + *aDidDefineProperty = PR_TRUE; } if (NS_FAILED(result)) { ret = PR_FALSE; diff --git a/content/html/document/src/nsHTMLDocument.h b/content/html/document/src/nsHTMLDocument.h index 81f488b15a0e..a88615cc4624 100644 --- a/content/html/document/src/nsHTMLDocument.h +++ b/content/html/document/src/nsHTMLDocument.h @@ -134,7 +134,8 @@ public: NS_IMETHOD GetScriptObject(nsIScriptContext *aContext, void** aScriptObject); // From nsJSScriptObject interface, implemented by nsDocument - virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID); + virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty); /** * Finds text in content diff --git a/content/xml/content/src/nsXMLElement.h b/content/xml/content/src/nsXMLElement.h index fd4fd1610202..23a4272e2bc1 100644 --- a/content/xml/content/src/nsXMLElement.h +++ b/content/xml/content/src/nsXMLElement.h @@ -241,8 +241,9 @@ public: virtual PRBool EnumerateProperty(JSContext *aContext, JSObject *aObj) { return mInner.EnumerateProperty(aContext, aObj); } - virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID) { - return mInner.Resolve(aContext, aObj, aID); + virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty) { + return mInner.Resolve(aContext, aObj, aID, aDidDefineProperty); } virtual PRBool Convert(JSContext *aContext, JSObject *aObj, jsval aID) { return mInner.Convert(aContext, aObj, aID); diff --git a/content/xul/content/src/nsXULElement.cpp b/content/xul/content/src/nsXULElement.cpp index 65717204d2af..5cf5887d8702 100644 --- a/content/xul/content/src/nsXULElement.cpp +++ b/content/xul/content/src/nsXULElement.cpp @@ -2114,8 +2114,11 @@ nsXULElement::EnumerateProperty(JSContext *aContext, JSObject *aObj) PRBool -nsXULElement::Resolve(JSContext *aContext, JSObject *aObj, jsval aID) +nsXULElement::Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty) { + *aDidDefineProperty = PR_FALSE; + return PR_TRUE; } diff --git a/content/xul/content/src/nsXULElement.h b/content/xul/content/src/nsXULElement.h index 87050883a732..a2a7783a5e93 100644 --- a/content/xul/content/src/nsXULElement.h +++ b/content/xul/content/src/nsXULElement.h @@ -461,7 +461,8 @@ public: virtual PRBool SetProperty(JSContext *aContext, JSObject *aObj, jsval aID, jsval *aVp); virtual PRBool EnumerateProperty(JSContext *aContext, JSObject *aObj); - virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID); + virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty); virtual PRBool Convert(JSContext *aContext, JSObject *aObj, jsval aID); virtual void Finalize(JSContext *aContext, JSObject *aObj); diff --git a/content/xul/document/src/nsXULDocument.cpp b/content/xul/document/src/nsXULDocument.cpp index b3eb2f7153a1..dc84eee7b7e0 100644 --- a/content/xul/document/src/nsXULDocument.cpp +++ b/content/xul/document/src/nsXULDocument.cpp @@ -3758,8 +3758,11 @@ nsXULDocument::EnumerateProperty(JSContext *aContext, JSObject *aObj) PRBool -nsXULDocument::Resolve(JSContext *aContext, JSObject *aObj, jsval aID) +nsXULDocument::Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty) { + *aDidDefineProperty = PR_FALSE; + return PR_TRUE; } diff --git a/content/xul/document/src/nsXULDocument.h b/content/xul/document/src/nsXULDocument.h index 69c79d207406..594863adb636 100644 --- a/content/xul/document/src/nsXULDocument.h +++ b/content/xul/document/src/nsXULDocument.h @@ -379,7 +379,8 @@ public: virtual PRBool SetProperty(JSContext *aContext, JSObject *aObj, jsval aID, jsval *aVp); virtual PRBool EnumerateProperty(JSContext *aContext, JSObject *aObj); - virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID); + virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty); virtual PRBool Convert(JSContext *aContext, JSObject *aObj, jsval aID); virtual void Finalize(JSContext *aContext, JSObject *aObj); diff --git a/dom/public/nsIJSScriptObject.h b/dom/public/nsIJSScriptObject.h index ae90850bb8f3..f905fa97f0b7 100644 --- a/dom/public/nsIJSScriptObject.h +++ b/dom/public/nsIJSScriptObject.h @@ -52,7 +52,8 @@ public: virtual PRBool SetProperty(JSContext *aContext, JSObject *aObj, jsval aID, jsval *aVp) = 0; virtual PRBool EnumerateProperty(JSContext *aContext, JSObject *aObj) = 0; - virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID) = 0; + virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, + jsval aID, PRBool *aDidDefineProperty) = 0; virtual PRBool Convert(JSContext *aContext, JSObject *aObj, jsval aID) = 0; virtual void Finalize(JSContext *aContext, JSObject *aObj) = 0; }; diff --git a/dom/src/base/nsGlobalWindow.cpp b/dom/src/base/nsGlobalWindow.cpp index 088f44bb0589..f45b9398d190 100644 --- a/dom/src/base/nsGlobalWindow.cpp +++ b/dom/src/base/nsGlobalWindow.cpp @@ -2329,16 +2329,23 @@ PRBool GlobalWindowImpl::EnumerateProperty(JSContext* aContext, JSObject* aObj) return ::JS_EnumerateStandardClasses(aContext, aObj); } -PRBool GlobalWindowImpl::Resolve(JSContext* aContext, JSObject* aObj, jsval aID) +PRBool GlobalWindowImpl::Resolve(JSContext* aContext, JSObject* aObj, + jsval aID, PRBool* aDidDefineProperty) { + *aDidDefineProperty = PR_FALSE; + if (JSVAL_IS_STRING(aID)) { JSBool resolved; JSString *str; if (!::JS_ResolveStandardClass(aContext, aObj, aID, &resolved)) return PR_FALSE; - if (resolved) + + if (resolved) { + *aDidDefineProperty = PR_TRUE; + return PR_TRUE; + } str = JSVAL_TO_STRING(aID); if (mDocShell) { @@ -2380,10 +2387,14 @@ PRBool GlobalWindowImpl::Resolve(JSContext* aContext, JSObject* aObj, jsval aID) } // Okay, if we now have a childObj, we can define it and proceed. if (childObj) { - ::JS_DefineUCProperty(aContext, (JSObject *) mScriptObject, - chars, ::JS_GetStringLength(str), - OBJECT_TO_JSVAL(childObj), nsnull, nsnull, - 0); + if (!::JS_DefineUCProperty(aContext, (JSObject *) mScriptObject, + chars, ::JS_GetStringLength(str), + OBJECT_TO_JSVAL(childObj), nsnull, + nsnull, 0)) { + return PR_FALSE; + } + + *aDidDefineProperty = PR_TRUE; } } } diff --git a/dom/src/base/nsGlobalWindow.h b/dom/src/base/nsGlobalWindow.h index c076a7107197..aef5b7cc9ad3 100644 --- a/dom/src/base/nsGlobalWindow.h +++ b/dom/src/base/nsGlobalWindow.h @@ -126,7 +126,8 @@ public: virtual PRBool SetProperty(JSContext *aContext, JSObject *aObj, jsval aID, jsval *aVp); virtual PRBool EnumerateProperty(JSContext *aContext, JSObject *aObj); - virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID); + virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty); virtual PRBool Convert(JSContext *aContext, JSObject *aObj, jsval aID); virtual void Finalize(JSContext *aContext, JSObject *aObj); @@ -359,7 +360,8 @@ public: virtual PRBool GetProperty(JSContext *aContext, JSObject *aObj, jsval aID, jsval *aVp); virtual PRBool SetProperty(JSContext *aContext, JSObject *aObj, jsval aID, jsval *aVp); virtual PRBool EnumerateProperty(JSContext *aContext, JSObject *aObj); - virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID); + virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool* aDidDefineProperty); virtual PRBool Convert(JSContext *aContext, JSObject *aObj, jsval aID); virtual void Finalize(JSContext *aContext, JSObject *aObj); diff --git a/dom/src/base/nsJSBarProp.cpp b/dom/src/base/nsJSBarProp.cpp index 488067aaaadb..cfb806cf3673 100644 --- a/dom/src/base/nsJSBarProp.cpp +++ b/dom/src/base/nsJSBarProp.cpp @@ -143,6 +143,16 @@ SetBarPropProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// BarProp class properties +// +static JSPropertySpec BarPropProperties[] = +{ + {"visible", BARPROP_VISIBLE, JSPROP_ENUMERATE}, + {0} +}; + + // // BarProp finalizer // @@ -159,7 +169,7 @@ FinalizeBarProp(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateBarProp(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -169,7 +179,7 @@ EnumerateBarProp(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveBarProp(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -193,16 +203,6 @@ JSClass BarPropClass = { }; -// -// BarProp class properties -// -static JSPropertySpec BarPropProperties[] = -{ - {"visible", BARPROP_VISIBLE, JSPROP_ENUMERATE}, - {0} -}; - - // // BarProp class methods // diff --git a/dom/src/base/nsJSCRMFObject.cpp b/dom/src/base/nsJSCRMFObject.cpp index d6ebe1f01fa4..c9042476d846 100644 --- a/dom/src/base/nsJSCRMFObject.cpp +++ b/dom/src/base/nsJSCRMFObject.cpp @@ -129,6 +129,16 @@ SetCRMFObjectProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// CRMFObject class properties +// +static JSPropertySpec CRMFObjectProperties[] = +{ + {"request", CRMFOBJECT_REQUEST, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // CRMFObject finalizer // @@ -145,7 +155,7 @@ FinalizeCRMFObject(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateCRMFObject(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -155,7 +165,7 @@ EnumerateCRMFObject(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveCRMFObject(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -179,16 +189,6 @@ JSClass CRMFObjectClass = { }; -// -// CRMFObject class properties -// -static JSPropertySpec CRMFObjectProperties[] = -{ - {"request", CRMFOBJECT_REQUEST, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // CRMFObject class methods // diff --git a/dom/src/base/nsJSCrypto.cpp b/dom/src/base/nsJSCrypto.cpp index 559174c9676d..dd669a84c7d5 100644 --- a/dom/src/base/nsJSCrypto.cpp +++ b/dom/src/base/nsJSCrypto.cpp @@ -131,6 +131,16 @@ SetCryptoProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// Crypto class properties +// +static JSPropertySpec CryptoProperties[] = +{ + {"version", CRYPTO_VERSION, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // Crypto finalizer // @@ -147,7 +157,7 @@ FinalizeCrypto(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateCrypto(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -157,7 +167,7 @@ EnumerateCrypto(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveCrypto(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -498,16 +508,6 @@ JSClass CryptoClass = { }; -// -// Crypto class properties -// -static JSPropertySpec CryptoProperties[] = -{ - {"version", CRYPTO_VERSION, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // Crypto class methods // diff --git a/dom/src/base/nsJSDOMException.cpp b/dom/src/base/nsJSDOMException.cpp index 408fe8b4e97f..1d75d344f303 100644 --- a/dom/src/base/nsJSDOMException.cpp +++ b/dom/src/base/nsJSDOMException.cpp @@ -168,6 +168,19 @@ SetDOMExceptionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// DOMException class properties +// +static JSPropertySpec DOMExceptionProperties[] = +{ + {"code", DOMEXCEPTION_CODE, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"result", DOMEXCEPTION_RESULT, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"message", DOMEXCEPTION_MESSAGE, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"name", DOMEXCEPTION_NAME, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // DOMException finalizer // @@ -184,7 +197,7 @@ FinalizeDOMException(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateDOMException(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -194,7 +207,7 @@ EnumerateDOMException(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveDOMException(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -254,19 +267,6 @@ JSClass DOMExceptionClass = { }; -// -// DOMException class properties -// -static JSPropertySpec DOMExceptionProperties[] = -{ - {"code", DOMEXCEPTION_CODE, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"result", DOMEXCEPTION_RESULT, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"message", DOMEXCEPTION_MESSAGE, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"name", DOMEXCEPTION_NAME, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // DOMException class methods // diff --git a/dom/src/base/nsJSHistory.cpp b/dom/src/base/nsJSHistory.cpp index 9dfc2c404aee..ccc04f1edae1 100644 --- a/dom/src/base/nsJSHistory.cpp +++ b/dom/src/base/nsJSHistory.cpp @@ -177,6 +177,19 @@ SetHistoryProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// History class properties +// +static JSPropertySpec HistoryProperties[] = +{ + {"length", HISTORY_LENGTH, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"current", HISTORY_CURRENT, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"previous", HISTORY_PREVIOUS, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"next", HISTORY_NEXT, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // History finalizer // @@ -193,7 +206,7 @@ FinalizeHistory(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHistory(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -203,7 +216,7 @@ EnumerateHistory(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHistory(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -376,19 +389,6 @@ JSClass HistoryClass = { }; -// -// History class properties -// -static JSPropertySpec HistoryProperties[] = -{ - {"length", HISTORY_LENGTH, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"current", HISTORY_CURRENT, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"previous", HISTORY_PREVIOUS, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"next", HISTORY_NEXT, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // History class methods // diff --git a/dom/src/base/nsJSLocation.cpp b/dom/src/base/nsJSLocation.cpp index b9f4a12e7070..0f88ae5bbecb 100644 --- a/dom/src/base/nsJSLocation.cpp +++ b/dom/src/base/nsJSLocation.cpp @@ -292,6 +292,22 @@ SetLocationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// Location class properties +// +static JSPropertySpec LocationProperties[] = +{ + {"hash", LOCATION_HASH, JSPROP_ENUMERATE}, + {"host", LOCATION_HOST, JSPROP_ENUMERATE}, + {"hostname", LOCATION_HOSTNAME, JSPROP_ENUMERATE}, + {"pathname", LOCATION_PATHNAME, JSPROP_ENUMERATE}, + {"port", LOCATION_PORT, JSPROP_ENUMERATE}, + {"protocol", LOCATION_PROTOCOL, JSPROP_ENUMERATE}, + {"search", LOCATION_SEARCH, JSPROP_ENUMERATE}, + {0} +}; + + // // Location finalizer // @@ -308,7 +324,7 @@ FinalizeLocation(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateLocation(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -318,7 +334,7 @@ EnumerateLocation(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveLocation(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -499,22 +515,6 @@ JSClass LocationClass = { }; -// -// Location class properties -// -static JSPropertySpec LocationProperties[] = -{ - {"hash", LOCATION_HASH, JSPROP_ENUMERATE}, - {"host", LOCATION_HOST, JSPROP_ENUMERATE}, - {"hostname", LOCATION_HOSTNAME, JSPROP_ENUMERATE}, - {"pathname", LOCATION_PATHNAME, JSPROP_ENUMERATE}, - {"port", LOCATION_PORT, JSPROP_ENUMERATE}, - {"protocol", LOCATION_PROTOCOL, JSPROP_ENUMERATE}, - {"search", LOCATION_SEARCH, JSPROP_ENUMERATE}, - {0} -}; - - // // Location class methods // diff --git a/dom/src/base/nsJSMimeType.cpp b/dom/src/base/nsJSMimeType.cpp index cb4a7fe76878..a1dd31ebacd6 100644 --- a/dom/src/base/nsJSMimeType.cpp +++ b/dom/src/base/nsJSMimeType.cpp @@ -171,6 +171,19 @@ SetMimeTypeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// MimeType class properties +// +static JSPropertySpec MimeTypeProperties[] = +{ + {"description", MIMETYPE_DESCRIPTION, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"enabledPlugin", MIMETYPE_ENABLEDPLUGIN, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"suffixes", MIMETYPE_SUFFIXES, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"type", MIMETYPE_TYPE, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // MimeType finalizer // @@ -187,7 +200,7 @@ FinalizeMimeType(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateMimeType(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -197,7 +210,7 @@ EnumerateMimeType(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveMimeType(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -221,19 +234,6 @@ JSClass MimeTypeClass = { }; -// -// MimeType class properties -// -static JSPropertySpec MimeTypeProperties[] = -{ - {"description", MIMETYPE_DESCRIPTION, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"enabledPlugin", MIMETYPE_ENABLEDPLUGIN, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"suffixes", MIMETYPE_SUFFIXES, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"type", MIMETYPE_TYPE, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // MimeType class methods // diff --git a/dom/src/base/nsJSMimeTypeArray.cpp b/dom/src/base/nsJSMimeTypeArray.cpp index 8c8e74c6811d..ee109040457e 100644 --- a/dom/src/base/nsJSMimeTypeArray.cpp +++ b/dom/src/base/nsJSMimeTypeArray.cpp @@ -173,6 +173,16 @@ SetMimeTypeArrayProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// MimeTypeArray class properties +// +static JSPropertySpec MimeTypeArrayProperties[] = +{ + {"length", MIMETYPEARRAY_LENGTH, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // MimeTypeArray finalizer // @@ -189,7 +199,7 @@ FinalizeMimeTypeArray(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateMimeTypeArray(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -199,7 +209,7 @@ EnumerateMimeTypeArray(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveMimeTypeArray(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -309,16 +319,6 @@ JSClass MimeTypeArrayClass = { }; -// -// MimeTypeArray class properties -// -static JSPropertySpec MimeTypeArrayProperties[] = -{ - {"length", MIMETYPEARRAY_LENGTH, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // MimeTypeArray class methods // diff --git a/dom/src/base/nsJSNavigator.cpp b/dom/src/base/nsJSNavigator.cpp index 7e16837a5d7f..62bbc76a03a5 100644 --- a/dom/src/base/nsJSNavigator.cpp +++ b/dom/src/base/nsJSNavigator.cpp @@ -317,6 +317,30 @@ SetNavigatorProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// Navigator class properties +// +static JSPropertySpec NavigatorProperties[] = +{ + {"appCodeName", NAVIGATOR_APPCODENAME, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"appName", NAVIGATOR_APPNAME, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"appVersion", NAVIGATOR_APPVERSION, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"language", NAVIGATOR_LANGUAGE, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"mimeTypes", NAVIGATOR_MIMETYPES, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"platform", NAVIGATOR_PLATFORM, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"oscpu", NAVIGATOR_OSCPU, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"vendor", NAVIGATOR_VENDOR, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"vendorSub", NAVIGATOR_VENDORSUB, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"product", NAVIGATOR_PRODUCT, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"productSub", NAVIGATOR_PRODUCTSUB, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"plugins", NAVIGATOR_PLUGINS, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"securityPolicy", NAVIGATOR_SECURITYPOLICY, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"userAgent", NAVIGATOR_USERAGENT, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"cookieEnabled", NAVIGATOR_COOKIEENABLED, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // Navigator finalizer // @@ -333,7 +357,7 @@ FinalizeNavigator(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateNavigator(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -343,7 +367,7 @@ EnumerateNavigator(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveNavigator(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -475,30 +499,6 @@ JSClass NavigatorClass = { }; -// -// Navigator class properties -// -static JSPropertySpec NavigatorProperties[] = -{ - {"appCodeName", NAVIGATOR_APPCODENAME, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"appName", NAVIGATOR_APPNAME, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"appVersion", NAVIGATOR_APPVERSION, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"language", NAVIGATOR_LANGUAGE, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"mimeTypes", NAVIGATOR_MIMETYPES, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"platform", NAVIGATOR_PLATFORM, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"oscpu", NAVIGATOR_OSCPU, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"vendor", NAVIGATOR_VENDOR, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"vendorSub", NAVIGATOR_VENDORSUB, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"product", NAVIGATOR_PRODUCT, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"productSub", NAVIGATOR_PRODUCTSUB, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"plugins", NAVIGATOR_PLUGINS, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"securityPolicy", NAVIGATOR_SECURITYPOLICY, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"userAgent", NAVIGATOR_USERAGENT, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"cookieEnabled", NAVIGATOR_COOKIEENABLED, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // Navigator class methods // diff --git a/dom/src/base/nsJSPkcs11.cpp b/dom/src/base/nsJSPkcs11.cpp index 3e48341c0381..2d66cc8be71f 100644 --- a/dom/src/base/nsJSPkcs11.cpp +++ b/dom/src/base/nsJSPkcs11.cpp @@ -112,6 +112,15 @@ SetPkcs11Property(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// Pkcs11 class properties +// +static JSPropertySpec Pkcs11Properties[] = +{ + {0} +}; + + // // Pkcs11 finalizer // @@ -128,7 +137,7 @@ FinalizePkcs11(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumeratePkcs11(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -138,7 +147,7 @@ EnumeratePkcs11(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolvePkcs11(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -256,15 +265,6 @@ JSClass Pkcs11Class = { }; -// -// Pkcs11 class properties -// -static JSPropertySpec Pkcs11Properties[] = -{ - {0} -}; - - // // Pkcs11 class methods // diff --git a/dom/src/base/nsJSPlugin.cpp b/dom/src/base/nsJSPlugin.cpp index d9881fad4817..3e1c1a6347bc 100644 --- a/dom/src/base/nsJSPlugin.cpp +++ b/dom/src/base/nsJSPlugin.cpp @@ -212,6 +212,19 @@ SetPluginProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// Plugin class properties +// +static JSPropertySpec PluginProperties[] = +{ + {"description", PLUGIN_DESCRIPTION, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"filename", PLUGIN_FILENAME, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"name", PLUGIN_NAME, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"length", PLUGIN_LENGTH, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // Plugin finalizer // @@ -228,7 +241,7 @@ FinalizePlugin(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumeratePlugin(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -238,7 +251,7 @@ EnumeratePlugin(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolvePlugin(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -348,19 +361,6 @@ JSClass PluginClass = { }; -// -// Plugin class properties -// -static JSPropertySpec PluginProperties[] = -{ - {"description", PLUGIN_DESCRIPTION, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"filename", PLUGIN_FILENAME, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"name", PLUGIN_NAME, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"length", PLUGIN_LENGTH, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // Plugin class methods // diff --git a/dom/src/base/nsJSPluginArray.cpp b/dom/src/base/nsJSPluginArray.cpp index 32f0e571f2ed..aa8282246799 100644 --- a/dom/src/base/nsJSPluginArray.cpp +++ b/dom/src/base/nsJSPluginArray.cpp @@ -173,6 +173,16 @@ SetPluginArrayProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// PluginArray class properties +// +static JSPropertySpec PluginArrayProperties[] = +{ + {"length", PLUGINARRAY_LENGTH, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // PluginArray finalizer // @@ -189,7 +199,7 @@ FinalizePluginArray(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumeratePluginArray(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -199,7 +209,7 @@ EnumeratePluginArray(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolvePluginArray(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -352,16 +362,6 @@ JSClass PluginArrayClass = { }; -// -// PluginArray class properties -// -static JSPropertySpec PluginArrayProperties[] = -{ - {"length", PLUGINARRAY_LENGTH, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // PluginArray class methods // diff --git a/dom/src/base/nsJSScreen.cpp b/dom/src/base/nsJSScreen.cpp index 232ab6519715..8358c007c272 100644 --- a/dom/src/base/nsJSScreen.cpp +++ b/dom/src/base/nsJSScreen.cpp @@ -246,6 +246,25 @@ SetScreenProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// Screen class properties +// +static JSPropertySpec ScreenProperties[] = +{ + {"top", SCREEN_TOP, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"left", SCREEN_LEFT, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"width", SCREEN_WIDTH, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"height", SCREEN_HEIGHT, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"pixelDepth", SCREEN_PIXELDEPTH, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"colorDepth", SCREEN_COLORDEPTH, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"availWidth", SCREEN_AVAILWIDTH, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"availHeight", SCREEN_AVAILHEIGHT, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"availLeft", SCREEN_AVAILLEFT, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"availTop", SCREEN_AVAILTOP, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // Screen finalizer // @@ -262,7 +281,7 @@ FinalizeScreen(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateScreen(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -272,7 +291,7 @@ EnumerateScreen(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveScreen(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -296,25 +315,6 @@ JSClass ScreenClass = { }; -// -// Screen class properties -// -static JSPropertySpec ScreenProperties[] = -{ - {"top", SCREEN_TOP, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"left", SCREEN_LEFT, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"width", SCREEN_WIDTH, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"height", SCREEN_HEIGHT, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"pixelDepth", SCREEN_PIXELDEPTH, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"colorDepth", SCREEN_COLORDEPTH, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"availWidth", SCREEN_AVAILWIDTH, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"availHeight", SCREEN_AVAILHEIGHT, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"availLeft", SCREEN_AVAILLEFT, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"availTop", SCREEN_AVAILTOP, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // Screen class methods // diff --git a/dom/src/base/nsJSUtils.cpp b/dom/src/base/nsJSUtils.cpp index 68015ab65377..d72a168a49fe 100644 --- a/dom/src/base/nsJSUtils.cpp +++ b/dom/src/base/nsJSUtils.cpp @@ -439,19 +439,42 @@ nsJSUtils::nsGenericFinalize(JSContext* aContext, NS_EXPORT JSBool nsJSUtils::nsGenericEnumerate(JSContext* aContext, - JSObject* aObj) + JSObject* aObj, + JSPropertySpec* aLazyPropSpec) { nsISupports* nativeThis = (nsISupports*)JS_GetPrivate(aContext, aObj); if (nsnull != nativeThis) { // get the js object - nsIJSScriptObject *object; - if (NS_OK == nativeThis->QueryInterface(kIJSScriptObjectIID, (void**)&object)) { + nsCOMPtr object(do_QueryInterface(nativeThis)); + if (object) { object->EnumerateProperty(aContext, aObj); - NS_RELEASE(object); + } + + if (aLazyPropSpec) { + PRInt32 i = 0; + + while (aLazyPropSpec[i].name) { + jsval v = JSVAL_VOID; + + if (!::JS_LookupProperty(aContext, aObj, aLazyPropSpec[i].name, &v)) + return JS_FALSE; + + if (JSVAL_IS_VOID(v)) { + if (!::JS_DefineProperty(aContext, aObj, aLazyPropSpec[i].name, + JSVAL_VOID, + aLazyPropSpec[i].getter, + aLazyPropSpec[i].setter, + aLazyPropSpec[i].flags)) + return JS_FALSE; + } + + i++; + } } } + return JS_TRUE; } @@ -521,7 +544,8 @@ StubConstructor(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, NS_EXPORT JSBool nsJSUtils::nsGlobalResolve(JSContext* aContext, JSObject* aObj, - jsval aId) + jsval aId, + JSPropertySpec* aLazyPropSpec) { nsresult result; jsval val; @@ -573,25 +597,55 @@ nsJSUtils::nsGlobalResolve(JSContext* aContext, } } } - return nsGenericResolve(aContext, aObj, aId); + return nsGenericResolve(aContext, aObj, aId, aLazyPropSpec); } NS_EXPORT JSBool nsJSUtils::nsGenericResolve(JSContext* aContext, JSObject* aObj, - jsval aId) + jsval aId, + JSPropertySpec* aLazyPropSpec) { nsISupports* nativeThis = (nsISupports*)JS_GetPrivate(aContext, aObj); - + if (nsnull != nativeThis) { // get the js object - nsIJSScriptObject *object; - if (NS_OK == nativeThis->QueryInterface(kIJSScriptObjectIID, (void**)&object)) { - object->Resolve(aContext, aObj, aId); - NS_RELEASE(object); + nsCOMPtr object(do_QueryInterface(nativeThis)); + if (object) { + PRBool didDefineProperty = PR_FALSE; + + if (!object->Resolve(aContext, aObj, aId, &didDefineProperty)) + return JS_FALSE; + + if (!didDefineProperty && JSVAL_IS_STRING(aId) && aLazyPropSpec) { + PRInt32 i; + JSString *str = JSVAL_TO_STRING(aId); + const unsigned char *bytes = (unsigned char *)::JS_GetStringBytes(str); + const jschar *chars = ::JS_GetStringChars(str); + for (i = 0; bytes[i]; i++) { + if (jschar(bytes[i]) != chars[i]) + return JS_TRUE; + } + + if (size_t(i) != ::JS_GetStringLength(str)) + return JS_TRUE; + + for (i = 0; aLazyPropSpec[i].name; i++) { + if (nsCRT::strcmp(aLazyPropSpec[i].name, (const char *)bytes) == 0) { + return ::JS_DefineUCProperty(aContext, aObj, + ::JS_GetStringChars(str), + ::JS_GetStringLength(str), + JSVAL_VOID, + aLazyPropSpec[i].getter, + aLazyPropSpec[i].setter, + aLazyPropSpec[i].flags); + } + } + } } } + return JS_TRUE; } diff --git a/dom/src/base/nsJSUtils.h b/dom/src/base/nsJSUtils.h index 457cb6204e07..56aaaf23f71f 100644 --- a/dom/src/base/nsJSUtils.h +++ b/dom/src/base/nsJSUtils.h @@ -93,35 +93,38 @@ public: jsval aValue); static NS_EXPORT PRBool nsConvertJSValToBool(PRBool* aProp, - JSContext* aContext, - jsval aValue); + JSContext* aContext, + jsval aValue); static NS_EXPORT PRBool nsConvertJSValToUint32(PRUint32* aProp, JSContext* aContext, jsval aValue); static NS_EXPORT PRBool nsConvertJSValToFunc(nsIDOMEventListener** aListener, - JSContext* aContext, - JSObject* aObj, - jsval aValue); + JSContext* aContext, + JSObject* aObj, + jsval aValue); static NS_EXPORT void PR_CALLBACK nsGenericFinalize(JSContext* aContext, - JSObject* aObj); + JSObject* aObj); static NS_EXPORT JSBool nsGenericEnumerate(JSContext* aContext, - JSObject* aObj); + JSObject* aObj, + JSPropertySpec* aLazyPropSpec); static NS_EXPORT JSBool nsGlobalResolve(JSContext* aContext, - JSObject* aObj, - jsval aId); + JSObject* aObj, + jsval aId, + JSPropertySpec* aLazyPropSpec); static NS_EXPORT JSBool nsGenericResolve(JSContext* aContext, - JSObject* aObj, - jsval aId); + JSObject* aObj, + jsval aId, + JSPropertySpec* aLazyPropSpec); static NS_EXPORT nsISupports* nsGetNativeThis(JSContext* aContext, - JSObject* aObj); - + JSObject* aObj); + static NS_EXPORT nsresult nsGetStaticScriptGlobal(JSContext* aContext, JSObject* aObj, nsIScriptGlobalObject** aNativeGlobal); diff --git a/dom/src/base/nsJSWindow.cpp b/dom/src/base/nsJSWindow.cpp index a75b6669450b..7caf12c03f1b 100644 --- a/dom/src/base/nsJSWindow.cpp +++ b/dom/src/base/nsJSWindow.cpp @@ -92,69 +92,60 @@ static NS_DEFINE_IID(kIWindowEventOwnerIID, NS_IDOMWINDOWEVENTOWNER_IID); enum Window_slots { WINDOW_DOCUMENT = -1, WINDOW_PARENT = -2, - WINDOW_TOP = -3, - WINDOW_SCROLLBARS = -4, - WINDOW_FRAMES = -5, - WINDOW_NAME = -6, - WINDOW_SCROLLX = -7, - WINDOW_SCROLLY = -8, - WINDOWINTERNAL_WINDOW = -9, - WINDOWINTERNAL_SELF = -10, - WINDOWINTERNAL_NAVIGATOR = -11, - WINDOWINTERNAL_SCREEN = -12, - WINDOWINTERNAL_HISTORY = -13, - WINDOWINTERNAL__CONTENT = -14, - WINDOWINTERNAL_SIDEBAR = -15, - WINDOWINTERNAL_PROMPTER = -16, - WINDOWINTERNAL_MENUBAR = -17, - WINDOWINTERNAL_TOOLBAR = -18, - WINDOWINTERNAL_LOCATIONBAR = -19, - WINDOWINTERNAL_PERSONALBAR = -20, - WINDOWINTERNAL_STATUSBAR = -21, - WINDOWINTERNAL_DIRECTORIES = -22, - WINDOWINTERNAL_CLOSED = -23, - WINDOWINTERNAL_CRYPTO = -24, - WINDOWINTERNAL_PKCS11 = -25, - WINDOWINTERNAL_CONTROLLERS = -26, - WINDOWINTERNAL_OPENER = -27, - WINDOWINTERNAL_STATUS = -28, - WINDOWINTERNAL_DEFAULTSTATUS = -29, - WINDOWINTERNAL_LOCATION = -30, - WINDOWINTERNAL_TITLE = -31, - WINDOWINTERNAL_INNERWIDTH = -32, - WINDOWINTERNAL_INNERHEIGHT = -33, - WINDOWINTERNAL_OUTERWIDTH = -34, - WINDOWINTERNAL_OUTERHEIGHT = -35, - WINDOWINTERNAL_SCREENX = -36, - WINDOWINTERNAL_SCREENY = -37, - WINDOWINTERNAL_PAGEXOFFSET = -38, - WINDOWINTERNAL_PAGEYOFFSET = -39, - WINDOWINTERNAL_LENGTH = -40, - WINDOWEVENTOWNER_ONMOUSEDOWN = -41, - WINDOWEVENTOWNER_ONMOUSEUP = -42, - WINDOWEVENTOWNER_ONCLICK = -43, - WINDOWEVENTOWNER_ONMOUSEOVER = -44, - WINDOWEVENTOWNER_ONMOUSEOUT = -45, - WINDOWEVENTOWNER_ONKEYDOWN = -46, - WINDOWEVENTOWNER_ONKEYUP = -47, - WINDOWEVENTOWNER_ONKEYPRESS = -48, - WINDOWEVENTOWNER_ONMOUSEMOVE = -49, - WINDOWEVENTOWNER_ONFOCUS = -50, - WINDOWEVENTOWNER_ONBLUR = -51, - WINDOWEVENTOWNER_ONSUBMIT = -52, - WINDOWEVENTOWNER_ONRESET = -53, - WINDOWEVENTOWNER_ONCHANGE = -54, - WINDOWEVENTOWNER_ONSELECT = -55, - WINDOWEVENTOWNER_ONLOAD = -56, - WINDOWEVENTOWNER_ONUNLOAD = -57, - WINDOWEVENTOWNER_ONCLOSE = -58, - WINDOWEVENTOWNER_ONABORT = -59, - WINDOWEVENTOWNER_ONERROR = -60, - WINDOWEVENTOWNER_ONPAINT = -61, - WINDOWEVENTOWNER_ONDRAGDROP = -62, - WINDOWEVENTOWNER_ONRESIZE = -63, - WINDOWEVENTOWNER_ONSCROLL = -64, - ABSTRACTVIEW_DOCUMENT = -65 + WINDOW_SCROLLBARS = -3, + WINDOW_FRAMES = -4, + WINDOW_NAME = -5, + WINDOW_SCROLLX = -6, + WINDOW_SCROLLY = -7, + WINDOWINTERNAL_WINDOW = -8, + WINDOWINTERNAL_SELF = -9, + WINDOWINTERNAL_NAVIGATOR = -10, + WINDOWINTERNAL_SCREEN = -11, + WINDOWINTERNAL_HISTORY = -12, + WINDOWINTERNAL_STATUSBAR = -13, + WINDOWINTERNAL_DIRECTORIES = -14, + WINDOWINTERNAL_CLOSED = -15, + WINDOWINTERNAL_CRYPTO = -16, + WINDOWINTERNAL_PKCS11 = -17, + WINDOWINTERNAL_OPENER = -18, + WINDOWINTERNAL_STATUS = -19, + WINDOWINTERNAL_DEFAULTSTATUS = -20, + WINDOWINTERNAL_LOCATION = -21, + WINDOWINTERNAL_TITLE = -22, + WINDOWINTERNAL_INNERWIDTH = -23, + WINDOWINTERNAL_INNERHEIGHT = -24, + WINDOWINTERNAL_OUTERWIDTH = -25, + WINDOWINTERNAL_OUTERHEIGHT = -26, + WINDOWINTERNAL_SCREENX = -27, + WINDOWINTERNAL_SCREENY = -28, + WINDOWINTERNAL_PAGEXOFFSET = -29, + WINDOWINTERNAL_PAGEYOFFSET = -30, + WINDOWINTERNAL_LENGTH = -31, + WINDOWEVENTOWNER_ONMOUSEDOWN = -32, + WINDOWEVENTOWNER_ONMOUSEUP = -33, + WINDOWEVENTOWNER_ONCLICK = -34, + WINDOWEVENTOWNER_ONMOUSEOVER = -35, + WINDOWEVENTOWNER_ONMOUSEOUT = -36, + WINDOWEVENTOWNER_ONKEYDOWN = -37, + WINDOWEVENTOWNER_ONKEYUP = -38, + WINDOWEVENTOWNER_ONKEYPRESS = -39, + WINDOWEVENTOWNER_ONMOUSEMOVE = -40, + WINDOWEVENTOWNER_ONFOCUS = -41, + WINDOWEVENTOWNER_ONBLUR = -42, + WINDOWEVENTOWNER_ONSUBMIT = -43, + WINDOWEVENTOWNER_ONRESET = -44, + WINDOWEVENTOWNER_ONCHANGE = -45, + WINDOWEVENTOWNER_ONSELECT = -46, + WINDOWEVENTOWNER_ONLOAD = -47, + WINDOWEVENTOWNER_ONUNLOAD = -48, + WINDOWEVENTOWNER_ONCLOSE = -49, + WINDOWEVENTOWNER_ONABORT = -50, + WINDOWEVENTOWNER_ONERROR = -51, + WINDOWEVENTOWNER_ONPAINT = -52, + WINDOWEVENTOWNER_ONDRAGDROP = -53, + WINDOWEVENTOWNER_ONRESIZE = -54, + WINDOWEVENTOWNER_ONSCROLL = -55, + ABSTRACTVIEW_DOCUMENT = -56 }; /***********************************************************************/ @@ -2602,6 +2593,89 @@ WindowInternalcontrollersSetter(JSContext *cx, JSObject *obj, jsval id, jsval *v } +// +// Window class properties +// +static JSPropertySpec WindowProperties[] = +{ + {"document", WINDOW_DOCUMENT, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"parent", WINDOW_PARENT, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"scrollbars", WINDOW_SCROLLBARS, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"frames", WINDOW_FRAMES, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"name", WINDOW_NAME, JSPROP_ENUMERATE}, + {"scrollX", WINDOW_SCROLLX, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"scrollY", WINDOW_SCROLLY, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"window", WINDOWINTERNAL_WINDOW, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"self", WINDOWINTERNAL_SELF, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"navigator", WINDOWINTERNAL_NAVIGATOR, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"screen", WINDOWINTERNAL_SCREEN, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"history", WINDOWINTERNAL_HISTORY, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"statusbar", WINDOWINTERNAL_STATUSBAR, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"directories", WINDOWINTERNAL_DIRECTORIES, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"closed", WINDOWINTERNAL_CLOSED, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"crypto", WINDOWINTERNAL_CRYPTO, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"pkcs11", WINDOWINTERNAL_PKCS11, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"opener", WINDOWINTERNAL_OPENER, JSPROP_ENUMERATE}, + {"status", WINDOWINTERNAL_STATUS, JSPROP_ENUMERATE}, + {"defaultStatus", WINDOWINTERNAL_DEFAULTSTATUS, JSPROP_ENUMERATE}, + {"location", WINDOWINTERNAL_LOCATION, JSPROP_ENUMERATE}, + {"title", WINDOWINTERNAL_TITLE, JSPROP_ENUMERATE}, + {"innerWidth", WINDOWINTERNAL_INNERWIDTH, JSPROP_ENUMERATE}, + {"innerHeight", WINDOWINTERNAL_INNERHEIGHT, JSPROP_ENUMERATE}, + {"outerWidth", WINDOWINTERNAL_OUTERWIDTH, JSPROP_ENUMERATE}, + {"outerHeight", WINDOWINTERNAL_OUTERHEIGHT, JSPROP_ENUMERATE}, + {"screenX", WINDOWINTERNAL_SCREENX, JSPROP_ENUMERATE}, + {"screenY", WINDOWINTERNAL_SCREENY, JSPROP_ENUMERATE}, + {"pageXOffset", WINDOWINTERNAL_PAGEXOFFSET, JSPROP_ENUMERATE}, + {"pageYOffset", WINDOWINTERNAL_PAGEYOFFSET, JSPROP_ENUMERATE}, + {"length", WINDOWINTERNAL_LENGTH, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"onmousedown", WINDOWEVENTOWNER_ONMOUSEDOWN, JSPROP_ENUMERATE}, + {"onmouseup", WINDOWEVENTOWNER_ONMOUSEUP, JSPROP_ENUMERATE}, + {"onclick", WINDOWEVENTOWNER_ONCLICK, JSPROP_ENUMERATE}, + {"onmouseover", WINDOWEVENTOWNER_ONMOUSEOVER, JSPROP_ENUMERATE}, + {"onmouseout", WINDOWEVENTOWNER_ONMOUSEOUT, JSPROP_ENUMERATE}, + {"onkeydown", WINDOWEVENTOWNER_ONKEYDOWN, JSPROP_ENUMERATE}, + {"onkeyup", WINDOWEVENTOWNER_ONKEYUP, JSPROP_ENUMERATE}, + {"onkeypress", WINDOWEVENTOWNER_ONKEYPRESS, JSPROP_ENUMERATE}, + {"onmousemove", WINDOWEVENTOWNER_ONMOUSEMOVE, JSPROP_ENUMERATE}, + {"onfocus", WINDOWEVENTOWNER_ONFOCUS, JSPROP_ENUMERATE}, + {"onblur", WINDOWEVENTOWNER_ONBLUR, JSPROP_ENUMERATE}, + {"onsubmit", WINDOWEVENTOWNER_ONSUBMIT, JSPROP_ENUMERATE}, + {"onreset", WINDOWEVENTOWNER_ONRESET, JSPROP_ENUMERATE}, + {"onchange", WINDOWEVENTOWNER_ONCHANGE, JSPROP_ENUMERATE}, + {"onselect", WINDOWEVENTOWNER_ONSELECT, JSPROP_ENUMERATE}, + {"onload", WINDOWEVENTOWNER_ONLOAD, JSPROP_ENUMERATE}, + {"onunload", WINDOWEVENTOWNER_ONUNLOAD, JSPROP_ENUMERATE}, + {"onclose", WINDOWEVENTOWNER_ONCLOSE, JSPROP_ENUMERATE}, + {"onabort", WINDOWEVENTOWNER_ONABORT, JSPROP_ENUMERATE}, + {"onerror", WINDOWEVENTOWNER_ONERROR, JSPROP_ENUMERATE}, + {"onpaint", WINDOWEVENTOWNER_ONPAINT, JSPROP_ENUMERATE}, + {"ondragdrop", WINDOWEVENTOWNER_ONDRAGDROP, JSPROP_ENUMERATE}, + {"onresize", WINDOWEVENTOWNER_ONRESIZE, JSPROP_ENUMERATE}, + {"onscroll", WINDOWEVENTOWNER_ONSCROLL, JSPROP_ENUMERATE}, + {"document", ABSTRACTVIEW_DOCUMENT, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + +// +// Window class replaceable properties +// +static JSPropertySpec WindowReplaceableProperties[] = +{ + {"top", 0, JSPROP_ENUMERATE, WindowtopGetter, WindowtopSetter}, + {"_content", 0, JSPROP_ENUMERATE, WindowInternal_contentGetter, WindowInternal_contentSetter}, + {"sidebar", 0, JSPROP_ENUMERATE, WindowInternalsidebarGetter, WindowInternalsidebarSetter}, + {"prompter", 0, JSPROP_ENUMERATE, WindowInternalprompterGetter, WindowInternalprompterSetter}, + {"menubar", 0, JSPROP_ENUMERATE, WindowInternalmenubarGetter, WindowInternalmenubarSetter}, + {"toolbar", 0, JSPROP_ENUMERATE, WindowInternaltoolbarGetter, WindowInternaltoolbarSetter}, + {"locationbar", 0, JSPROP_ENUMERATE, WindowInternallocationbarGetter, WindowInternallocationbarSetter}, + {"personalbar", 0, JSPROP_ENUMERATE, WindowInternalpersonalbarGetter, WindowInternalpersonalbarSetter}, + {"controllers", 0, JSPROP_ENUMERATE, WindowInternalcontrollersGetter, WindowInternalcontrollersSetter}, + {0} +}; + + // // Window finalizer // @@ -2618,7 +2692,7 @@ FinalizeWindow(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateWindow(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, WindowReplaceableProperties); } @@ -2628,7 +2702,7 @@ EnumerateWindow(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveWindow(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGlobalResolve(cx, obj, id); + return nsJSUtils::nsGlobalResolve(cx, obj, id, WindowReplaceableProperties); } @@ -4592,80 +4666,6 @@ JSClass WindowClass = { }; -// -// Window class properties -// -static JSPropertySpec WindowProperties[] = -{ - {"document", WINDOW_DOCUMENT, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"parent", WINDOW_PARENT, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"top", WINDOW_TOP, JSPROP_ENUMERATE, WindowtopGetter, WindowtopSetter}, - {"scrollbars", WINDOW_SCROLLBARS, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"frames", WINDOW_FRAMES, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"name", WINDOW_NAME, JSPROP_ENUMERATE}, - {"scrollX", WINDOW_SCROLLX, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"scrollY", WINDOW_SCROLLY, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"window", WINDOWINTERNAL_WINDOW, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"self", WINDOWINTERNAL_SELF, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"navigator", WINDOWINTERNAL_NAVIGATOR, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"screen", WINDOWINTERNAL_SCREEN, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"history", WINDOWINTERNAL_HISTORY, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"_content", WINDOWINTERNAL__CONTENT, JSPROP_ENUMERATE, WindowInternal_contentGetter, WindowInternal_contentSetter}, - {"sidebar", WINDOWINTERNAL_SIDEBAR, JSPROP_ENUMERATE, WindowInternalsidebarGetter, WindowInternalsidebarSetter}, - {"prompter", WINDOWINTERNAL_PROMPTER, JSPROP_ENUMERATE, WindowInternalprompterGetter, WindowInternalprompterSetter}, - {"menubar", WINDOWINTERNAL_MENUBAR, JSPROP_ENUMERATE, WindowInternalmenubarGetter, WindowInternalmenubarSetter}, - {"toolbar", WINDOWINTERNAL_TOOLBAR, JSPROP_ENUMERATE, WindowInternaltoolbarGetter, WindowInternaltoolbarSetter}, - {"locationbar", WINDOWINTERNAL_LOCATIONBAR, JSPROP_ENUMERATE, WindowInternallocationbarGetter, WindowInternallocationbarSetter}, - {"personalbar", WINDOWINTERNAL_PERSONALBAR, JSPROP_ENUMERATE, WindowInternalpersonalbarGetter, WindowInternalpersonalbarSetter}, - {"statusbar", WINDOWINTERNAL_STATUSBAR, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"directories", WINDOWINTERNAL_DIRECTORIES, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"closed", WINDOWINTERNAL_CLOSED, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"crypto", WINDOWINTERNAL_CRYPTO, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"pkcs11", WINDOWINTERNAL_PKCS11, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"controllers", WINDOWINTERNAL_CONTROLLERS, JSPROP_ENUMERATE, WindowInternalcontrollersGetter, WindowInternalcontrollersSetter}, - {"opener", WINDOWINTERNAL_OPENER, JSPROP_ENUMERATE}, - {"status", WINDOWINTERNAL_STATUS, JSPROP_ENUMERATE}, - {"defaultStatus", WINDOWINTERNAL_DEFAULTSTATUS, JSPROP_ENUMERATE}, - {"location", WINDOWINTERNAL_LOCATION, JSPROP_ENUMERATE}, - {"title", WINDOWINTERNAL_TITLE, JSPROP_ENUMERATE}, - {"innerWidth", WINDOWINTERNAL_INNERWIDTH, JSPROP_ENUMERATE}, - {"innerHeight", WINDOWINTERNAL_INNERHEIGHT, JSPROP_ENUMERATE}, - {"outerWidth", WINDOWINTERNAL_OUTERWIDTH, JSPROP_ENUMERATE}, - {"outerHeight", WINDOWINTERNAL_OUTERHEIGHT, JSPROP_ENUMERATE}, - {"screenX", WINDOWINTERNAL_SCREENX, JSPROP_ENUMERATE}, - {"screenY", WINDOWINTERNAL_SCREENY, JSPROP_ENUMERATE}, - {"pageXOffset", WINDOWINTERNAL_PAGEXOFFSET, JSPROP_ENUMERATE}, - {"pageYOffset", WINDOWINTERNAL_PAGEYOFFSET, JSPROP_ENUMERATE}, - {"length", WINDOWINTERNAL_LENGTH, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"onmousedown", WINDOWEVENTOWNER_ONMOUSEDOWN, JSPROP_ENUMERATE}, - {"onmouseup", WINDOWEVENTOWNER_ONMOUSEUP, JSPROP_ENUMERATE}, - {"onclick", WINDOWEVENTOWNER_ONCLICK, JSPROP_ENUMERATE}, - {"onmouseover", WINDOWEVENTOWNER_ONMOUSEOVER, JSPROP_ENUMERATE}, - {"onmouseout", WINDOWEVENTOWNER_ONMOUSEOUT, JSPROP_ENUMERATE}, - {"onkeydown", WINDOWEVENTOWNER_ONKEYDOWN, JSPROP_ENUMERATE}, - {"onkeyup", WINDOWEVENTOWNER_ONKEYUP, JSPROP_ENUMERATE}, - {"onkeypress", WINDOWEVENTOWNER_ONKEYPRESS, JSPROP_ENUMERATE}, - {"onmousemove", WINDOWEVENTOWNER_ONMOUSEMOVE, JSPROP_ENUMERATE}, - {"onfocus", WINDOWEVENTOWNER_ONFOCUS, JSPROP_ENUMERATE}, - {"onblur", WINDOWEVENTOWNER_ONBLUR, JSPROP_ENUMERATE}, - {"onsubmit", WINDOWEVENTOWNER_ONSUBMIT, JSPROP_ENUMERATE}, - {"onreset", WINDOWEVENTOWNER_ONRESET, JSPROP_ENUMERATE}, - {"onchange", WINDOWEVENTOWNER_ONCHANGE, JSPROP_ENUMERATE}, - {"onselect", WINDOWEVENTOWNER_ONSELECT, JSPROP_ENUMERATE}, - {"onload", WINDOWEVENTOWNER_ONLOAD, JSPROP_ENUMERATE}, - {"onunload", WINDOWEVENTOWNER_ONUNLOAD, JSPROP_ENUMERATE}, - {"onclose", WINDOWEVENTOWNER_ONCLOSE, JSPROP_ENUMERATE}, - {"onabort", WINDOWEVENTOWNER_ONABORT, JSPROP_ENUMERATE}, - {"onerror", WINDOWEVENTOWNER_ONERROR, JSPROP_ENUMERATE}, - {"onpaint", WINDOWEVENTOWNER_ONPAINT, JSPROP_ENUMERATE}, - {"ondragdrop", WINDOWEVENTOWNER_ONDRAGDROP, JSPROP_ENUMERATE}, - {"onresize", WINDOWEVENTOWNER_ONRESIZE, JSPROP_ENUMERATE}, - {"onscroll", WINDOWEVENTOWNER_ONSCROLL, JSPROP_ENUMERATE}, - {"document", ABSTRACTVIEW_DOCUMENT, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // Window class methods // diff --git a/dom/src/base/nsJSWindowCollection.cpp b/dom/src/base/nsJSWindowCollection.cpp index 98473561ce07..a925803c6d7b 100644 --- a/dom/src/base/nsJSWindowCollection.cpp +++ b/dom/src/base/nsJSWindowCollection.cpp @@ -173,6 +173,16 @@ SetWindowCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// WindowCollection class properties +// +static JSPropertySpec WindowCollectionProperties[] = +{ + {"length", WINDOWCOLLECTION_LENGTH, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // WindowCollection finalizer // @@ -189,7 +199,7 @@ FinalizeWindowCollection(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateWindowCollection(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -199,7 +209,7 @@ EnumerateWindowCollection(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveWindowCollection(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -309,16 +319,6 @@ JSClass WindowCollectionClass = { }; -// -// WindowCollection class properties -// -static JSPropertySpec WindowCollectionProperties[] = -{ - {"length", WINDOWCOLLECTION_LENGTH, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // WindowCollection class methods // diff --git a/dom/src/base/nsLocation.cpp b/dom/src/base/nsLocation.cpp index db4e57adb8c3..5f536b5b4288 100644 --- a/dom/src/base/nsLocation.cpp +++ b/dom/src/base/nsLocation.cpp @@ -847,8 +847,11 @@ LocationImpl::EnumerateProperty(JSContext *aContext, JSObject *aObj) } PRBool -LocationImpl::Resolve(JSContext *aContext, JSObject *aObj, jsval aID) +LocationImpl::Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool* aDidDefineProperty) { + *aDidDefineProperty = PR_FALSE; + if (JSVAL_IS_STRING(aID)) { JSString *str; @@ -863,6 +866,8 @@ LocationImpl::Resolve(JSContext *aContext, JSObject *aObj, jsval aID) ::JS_DefineUCProperty(aContext, (JSObject *)mScriptObject, chars, ::JS_GetStringLength(str), JSVAL_VOID, nsnull, nsnull, 0); + + *aDidDefineProperty = PR_TRUE; } } diff --git a/dom/src/coreDOM/nsJSAttr.cpp b/dom/src/coreDOM/nsJSAttr.cpp index 2a554559f7b5..4c75c5a3f0cb 100644 --- a/dom/src/coreDOM/nsJSAttr.cpp +++ b/dom/src/coreDOM/nsJSAttr.cpp @@ -182,6 +182,19 @@ SetAttrProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// Attr class properties +// +static JSPropertySpec AttrProperties[] = +{ + {"name", ATTR_NAME, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"specified", ATTR_SPECIFIED, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"value", ATTR_VALUE, JSPROP_ENUMERATE}, + {"ownerElement", ATTR_OWNERELEMENT, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // Attr finalizer // @@ -198,7 +211,7 @@ FinalizeAttr(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateAttr(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -208,7 +221,7 @@ EnumerateAttr(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveAttr(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -232,19 +245,6 @@ JSClass AttrClass = { }; -// -// Attr class properties -// -static JSPropertySpec AttrProperties[] = -{ - {"name", ATTR_NAME, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"specified", ATTR_SPECIFIED, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"value", ATTR_VALUE, JSPROP_ENUMERATE}, - {"ownerElement", ATTR_OWNERELEMENT, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // Attr class methods // diff --git a/dom/src/coreDOM/nsJSCDATASection.cpp b/dom/src/coreDOM/nsJSCDATASection.cpp index 3943b6446dbe..18bebaed2783 100644 --- a/dom/src/coreDOM/nsJSCDATASection.cpp +++ b/dom/src/coreDOM/nsJSCDATASection.cpp @@ -112,6 +112,15 @@ SetCDATASectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// CDATASection class properties +// +static JSPropertySpec CDATASectionProperties[] = +{ + {0} +}; + + // // CDATASection finalizer // @@ -128,7 +137,7 @@ FinalizeCDATASection(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateCDATASection(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -138,7 +147,7 @@ EnumerateCDATASection(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveCDATASection(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -162,15 +171,6 @@ JSClass CDATASectionClass = { }; -// -// CDATASection class properties -// -static JSPropertySpec CDATASectionProperties[] = -{ - {0} -}; - - // // CDATASection class methods // diff --git a/dom/src/coreDOM/nsJSCharacterData.cpp b/dom/src/coreDOM/nsJSCharacterData.cpp index 2290f71c45e9..242a4c6573fd 100644 --- a/dom/src/coreDOM/nsJSCharacterData.cpp +++ b/dom/src/coreDOM/nsJSCharacterData.cpp @@ -153,6 +153,17 @@ SetCharacterDataProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// CharacterData class properties +// +static JSPropertySpec CharacterDataProperties[] = +{ + {"data", CHARACTERDATA_DATA, JSPROP_ENUMERATE}, + {"length", CHARACTERDATA_LENGTH, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // CharacterData finalizer // @@ -169,7 +180,7 @@ FinalizeCharacterData(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateCharacterData(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -179,7 +190,7 @@ EnumerateCharacterData(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveCharacterData(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -433,17 +444,6 @@ JSClass CharacterDataClass = { }; -// -// CharacterData class properties -// -static JSPropertySpec CharacterDataProperties[] = -{ - {"data", CHARACTERDATA_DATA, JSPROP_ENUMERATE}, - {"length", CHARACTERDATA_LENGTH, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // CharacterData class methods // diff --git a/dom/src/coreDOM/nsJSComment.cpp b/dom/src/coreDOM/nsJSComment.cpp index b22ed1b6128a..4d92585c1df4 100644 --- a/dom/src/coreDOM/nsJSComment.cpp +++ b/dom/src/coreDOM/nsJSComment.cpp @@ -112,6 +112,15 @@ SetCommentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// Comment class properties +// +static JSPropertySpec CommentProperties[] = +{ + {0} +}; + + // // Comment finalizer // @@ -128,7 +137,7 @@ FinalizeComment(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateComment(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -138,7 +147,7 @@ EnumerateComment(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveComment(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -162,15 +171,6 @@ JSClass CommentClass = { }; -// -// Comment class properties -// -static JSPropertySpec CommentProperties[] = -{ - {0} -}; - - // // Comment class methods // diff --git a/dom/src/coreDOM/nsJSDOMImplementation.cpp b/dom/src/coreDOM/nsJSDOMImplementation.cpp index eeefbae6005e..b76d88b57a6c 100644 --- a/dom/src/coreDOM/nsJSDOMImplementation.cpp +++ b/dom/src/coreDOM/nsJSDOMImplementation.cpp @@ -116,6 +116,15 @@ SetDOMImplementationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// DOMImplementation class properties +// +static JSPropertySpec DOMImplementationProperties[] = +{ + {0} +}; + + // // DOMImplementation finalizer // @@ -132,7 +141,7 @@ FinalizeDOMImplementation(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateDOMImplementation(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -142,7 +151,7 @@ EnumerateDOMImplementation(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveDOMImplementation(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -308,15 +317,6 @@ JSClass DOMImplementationClass = { }; -// -// DOMImplementation class properties -// -static JSPropertySpec DOMImplementationProperties[] = -{ - {0} -}; - - // // DOMImplementation class methods // diff --git a/dom/src/coreDOM/nsJSDocument.cpp b/dom/src/coreDOM/nsJSDocument.cpp index 9cabf5f33193..b240747898f9 100644 --- a/dom/src/coreDOM/nsJSDocument.cpp +++ b/dom/src/coreDOM/nsJSDocument.cpp @@ -324,6 +324,23 @@ SetDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// Document class properties +// +static JSPropertySpec DocumentProperties[] = +{ + {"doctype", DOCUMENT_DOCTYPE, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"implementation", DOCUMENT_IMPLEMENTATION, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"documentElement", DOCUMENT_DOCUMENTELEMENT, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"styleSheets", DOCUMENTSTYLE_STYLESHEETS, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"defaultView", DOCUMENTVIEW_DEFAULTVIEW, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"characterSet", NSDOCUMENT_CHARACTERSET, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"plugins", NSDOCUMENT_PLUGINS, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"location", NSDOCUMENT_LOCATION, JSPROP_ENUMERATE}, + {0} +}; + + // // Document finalizer // @@ -340,7 +357,7 @@ FinalizeDocument(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateDocument(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -350,7 +367,7 @@ EnumerateDocument(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveDocument(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -1424,23 +1441,6 @@ JSClass DocumentClass = { }; -// -// Document class properties -// -static JSPropertySpec DocumentProperties[] = -{ - {"doctype", DOCUMENT_DOCTYPE, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"implementation", DOCUMENT_IMPLEMENTATION, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"documentElement", DOCUMENT_DOCUMENTELEMENT, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"styleSheets", DOCUMENTSTYLE_STYLESHEETS, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"defaultView", DOCUMENTVIEW_DEFAULTVIEW, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"characterSet", NSDOCUMENT_CHARACTERSET, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"plugins", NSDOCUMENT_PLUGINS, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"location", NSDOCUMENT_LOCATION, JSPROP_ENUMERATE}, - {0} -}; - - // // Document class methods // diff --git a/dom/src/coreDOM/nsJSDocumentFragment.cpp b/dom/src/coreDOM/nsJSDocumentFragment.cpp index 3048bfde4a3f..adf9db7ce74d 100644 --- a/dom/src/coreDOM/nsJSDocumentFragment.cpp +++ b/dom/src/coreDOM/nsJSDocumentFragment.cpp @@ -112,6 +112,15 @@ SetDocumentFragmentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// DocumentFragment class properties +// +static JSPropertySpec DocumentFragmentProperties[] = +{ + {0} +}; + + // // DocumentFragment finalizer // @@ -128,7 +137,7 @@ FinalizeDocumentFragment(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateDocumentFragment(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -138,7 +147,7 @@ EnumerateDocumentFragment(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveDocumentFragment(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -162,15 +171,6 @@ JSClass DocumentFragmentClass = { }; -// -// DocumentFragment class properties -// -static JSPropertySpec DocumentFragmentProperties[] = -{ - {0} -}; - - // // DocumentFragment class methods // diff --git a/dom/src/coreDOM/nsJSDocumentType.cpp b/dom/src/coreDOM/nsJSDocumentType.cpp index 85719f381b75..e4d88816b5c7 100644 --- a/dom/src/coreDOM/nsJSDocumentType.cpp +++ b/dom/src/coreDOM/nsJSDocumentType.cpp @@ -198,6 +198,21 @@ SetDocumentTypeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// DocumentType class properties +// +static JSPropertySpec DocumentTypeProperties[] = +{ + {"name", DOCUMENTTYPE_NAME, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"entities", DOCUMENTTYPE_ENTITIES, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"notations", DOCUMENTTYPE_NOTATIONS, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"publicId", DOCUMENTTYPE_PUBLICID, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"systemId", DOCUMENTTYPE_SYSTEMID, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"internalSubset", DOCUMENTTYPE_INTERNALSUBSET, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // DocumentType finalizer // @@ -214,7 +229,7 @@ FinalizeDocumentType(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateDocumentType(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -224,7 +239,7 @@ EnumerateDocumentType(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveDocumentType(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -248,21 +263,6 @@ JSClass DocumentTypeClass = { }; -// -// DocumentType class properties -// -static JSPropertySpec DocumentTypeProperties[] = -{ - {"name", DOCUMENTTYPE_NAME, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"entities", DOCUMENTTYPE_ENTITIES, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"notations", DOCUMENTTYPE_NOTATIONS, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"publicId", DOCUMENTTYPE_PUBLICID, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"systemId", DOCUMENTTYPE_SYSTEMID, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"internalSubset", DOCUMENTTYPE_INTERNALSUBSET, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // DocumentType class methods // diff --git a/dom/src/coreDOM/nsJSElement.cpp b/dom/src/coreDOM/nsJSElement.cpp index 5e734429033f..bedafc441525 100644 --- a/dom/src/coreDOM/nsJSElement.cpp +++ b/dom/src/coreDOM/nsJSElement.cpp @@ -133,6 +133,16 @@ SetElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// Element class properties +// +static JSPropertySpec ElementProperties[] = +{ + {"tagName", ELEMENT_TAGNAME, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // Element finalizer // @@ -149,7 +159,7 @@ FinalizeElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -159,7 +169,7 @@ EnumerateElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -843,16 +853,6 @@ JSClass ElementClass = { }; -// -// Element class properties -// -static JSPropertySpec ElementProperties[] = -{ - {"tagName", ELEMENT_TAGNAME, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // Element class methods // diff --git a/dom/src/coreDOM/nsJSEntity.cpp b/dom/src/coreDOM/nsJSEntity.cpp index 54016d4b20bf..ad3b53087470 100644 --- a/dom/src/coreDOM/nsJSEntity.cpp +++ b/dom/src/coreDOM/nsJSEntity.cpp @@ -155,6 +155,18 @@ SetEntityProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// Entity class properties +// +static JSPropertySpec EntityProperties[] = +{ + {"publicId", ENTITY_PUBLICID, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"systemId", ENTITY_SYSTEMID, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"notationName", ENTITY_NOTATIONNAME, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // Entity finalizer // @@ -171,7 +183,7 @@ FinalizeEntity(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateEntity(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -181,7 +193,7 @@ EnumerateEntity(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveEntity(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -205,18 +217,6 @@ JSClass EntityClass = { }; -// -// Entity class properties -// -static JSPropertySpec EntityProperties[] = -{ - {"publicId", ENTITY_PUBLICID, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"systemId", ENTITY_SYSTEMID, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"notationName", ENTITY_NOTATIONNAME, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // Entity class methods // diff --git a/dom/src/coreDOM/nsJSEntityReference.cpp b/dom/src/coreDOM/nsJSEntityReference.cpp index bfa1fc421605..bdeb8dd2b247 100644 --- a/dom/src/coreDOM/nsJSEntityReference.cpp +++ b/dom/src/coreDOM/nsJSEntityReference.cpp @@ -112,6 +112,15 @@ SetEntityReferenceProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// EntityReference class properties +// +static JSPropertySpec EntityReferenceProperties[] = +{ + {0} +}; + + // // EntityReference finalizer // @@ -128,7 +137,7 @@ FinalizeEntityReference(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateEntityReference(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -138,7 +147,7 @@ EnumerateEntityReference(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveEntityReference(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -162,15 +171,6 @@ JSClass EntityReferenceClass = { }; -// -// EntityReference class properties -// -static JSPropertySpec EntityReferenceProperties[] = -{ - {0} -}; - - // // EntityReference class methods // diff --git a/dom/src/coreDOM/nsJSMediaList.cpp b/dom/src/coreDOM/nsJSMediaList.cpp index c3aa92f3ea92..058e57a878fb 100644 --- a/dom/src/coreDOM/nsJSMediaList.cpp +++ b/dom/src/coreDOM/nsJSMediaList.cpp @@ -162,6 +162,17 @@ SetMediaListProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// MediaList class properties +// +static JSPropertySpec MediaListProperties[] = +{ + {"mediaText", MEDIALIST_MEDIATEXT, JSPROP_ENUMERATE}, + {"length", MEDIALIST_LENGTH, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // MediaList finalizer // @@ -178,7 +189,7 @@ FinalizeMediaList(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateMediaList(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -188,7 +199,7 @@ EnumerateMediaList(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveMediaList(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -338,17 +349,6 @@ JSClass MediaListClass = { }; -// -// MediaList class properties -// -static JSPropertySpec MediaListProperties[] = -{ - {"mediaText", MEDIALIST_MEDIATEXT, JSPROP_ENUMERATE}, - {"length", MEDIALIST_LENGTH, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // MediaList class methods // diff --git a/dom/src/coreDOM/nsJSNamedNodeMap.cpp b/dom/src/coreDOM/nsJSNamedNodeMap.cpp index 13b1d5ad19fb..fefac0168252 100644 --- a/dom/src/coreDOM/nsJSNamedNodeMap.cpp +++ b/dom/src/coreDOM/nsJSNamedNodeMap.cpp @@ -141,6 +141,16 @@ SetNamedNodeMapProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// NamedNodeMap class properties +// +static JSPropertySpec NamedNodeMapProperties[] = +{ + {"length", NAMEDNODEMAP_LENGTH, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // NamedNodeMap finalizer // @@ -157,7 +167,7 @@ FinalizeNamedNodeMap(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateNamedNodeMap(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -167,7 +177,7 @@ EnumerateNamedNodeMap(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveNamedNodeMap(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -503,16 +513,6 @@ JSClass NamedNodeMapClass = { }; -// -// NamedNodeMap class properties -// -static JSPropertySpec NamedNodeMapProperties[] = -{ - {"length", NAMEDNODEMAP_LENGTH, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // NamedNodeMap class methods // diff --git a/dom/src/coreDOM/nsJSNode.cpp b/dom/src/coreDOM/nsJSNode.cpp index 5898c6c72f9b..d0ff576ef2e9 100644 --- a/dom/src/coreDOM/nsJSNode.cpp +++ b/dom/src/coreDOM/nsJSNode.cpp @@ -341,6 +341,29 @@ SetNodeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// Node class properties +// +static JSPropertySpec NodeProperties[] = +{ + {"nodeName", NODE_NODENAME, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"nodeValue", NODE_NODEVALUE, JSPROP_ENUMERATE}, + {"nodeType", NODE_NODETYPE, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"parentNode", NODE_PARENTNODE, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"childNodes", NODE_CHILDNODES, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"firstChild", NODE_FIRSTCHILD, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"lastChild", NODE_LASTCHILD, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"previousSibling", NODE_PREVIOUSSIBLING, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"nextSibling", NODE_NEXTSIBLING, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"attributes", NODE_ATTRIBUTES, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"ownerDocument", NODE_OWNERDOCUMENT, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"namespaceURI", NODE_NAMESPACEURI, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"prefix", NODE_PREFIX, JSPROP_ENUMERATE}, + {"localName", NODE_LOCALNAME, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // Node finalizer // @@ -357,7 +380,7 @@ FinalizeNode(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateNode(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -367,7 +390,7 @@ EnumerateNode(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveNode(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -960,29 +983,6 @@ JSClass NodeClass = { }; -// -// Node class properties -// -static JSPropertySpec NodeProperties[] = -{ - {"nodeName", NODE_NODENAME, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"nodeValue", NODE_NODEVALUE, JSPROP_ENUMERATE}, - {"nodeType", NODE_NODETYPE, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"parentNode", NODE_PARENTNODE, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"childNodes", NODE_CHILDNODES, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"firstChild", NODE_FIRSTCHILD, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"lastChild", NODE_LASTCHILD, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"previousSibling", NODE_PREVIOUSSIBLING, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"nextSibling", NODE_NEXTSIBLING, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"attributes", NODE_ATTRIBUTES, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"ownerDocument", NODE_OWNERDOCUMENT, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"namespaceURI", NODE_NAMESPACEURI, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"prefix", NODE_PREFIX, JSPROP_ENUMERATE}, - {"localName", NODE_LOCALNAME, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // Node class methods // diff --git a/dom/src/coreDOM/nsJSNodeList.cpp b/dom/src/coreDOM/nsJSNodeList.cpp index b5796e0bb1e6..86dc4e9edc3c 100644 --- a/dom/src/coreDOM/nsJSNodeList.cpp +++ b/dom/src/coreDOM/nsJSNodeList.cpp @@ -141,6 +141,16 @@ SetNodeListProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// NodeList class properties +// +static JSPropertySpec NodeListProperties[] = +{ + {"length", NODELIST_LENGTH, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // NodeList finalizer // @@ -157,7 +167,7 @@ FinalizeNodeList(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateNodeList(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -167,7 +177,7 @@ EnumerateNodeList(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveNodeList(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -235,16 +245,6 @@ JSClass NodeListClass = { }; -// -// NodeList class properties -// -static JSPropertySpec NodeListProperties[] = -{ - {"length", NODELIST_LENGTH, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // NodeList class methods // diff --git a/dom/src/coreDOM/nsJSNotation.cpp b/dom/src/coreDOM/nsJSNotation.cpp index 4ada8c442333..c78b1fafb42d 100644 --- a/dom/src/coreDOM/nsJSNotation.cpp +++ b/dom/src/coreDOM/nsJSNotation.cpp @@ -142,6 +142,17 @@ SetNotationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// Notation class properties +// +static JSPropertySpec NotationProperties[] = +{ + {"publicId", NOTATION_PUBLICID, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"systemId", NOTATION_SYSTEMID, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // Notation finalizer // @@ -158,7 +169,7 @@ FinalizeNotation(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateNotation(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -168,7 +179,7 @@ EnumerateNotation(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveNotation(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -192,17 +203,6 @@ JSClass NotationClass = { }; -// -// Notation class properties -// -static JSPropertySpec NotationProperties[] = -{ - {"publicId", NOTATION_PUBLICID, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"systemId", NOTATION_SYSTEMID, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // Notation class methods // diff --git a/dom/src/coreDOM/nsJSProcessingInstruction.cpp b/dom/src/coreDOM/nsJSProcessingInstruction.cpp index fd526612211d..4acab9c9ab72 100644 --- a/dom/src/coreDOM/nsJSProcessingInstruction.cpp +++ b/dom/src/coreDOM/nsJSProcessingInstruction.cpp @@ -178,6 +178,18 @@ SetProcessingInstructionProperty(JSContext *cx, JSObject *obj, jsval id, jsval * } +// +// ProcessingInstruction class properties +// +static JSPropertySpec ProcessingInstructionProperties[] = +{ + {"target", PROCESSINGINSTRUCTION_TARGET, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"data", PROCESSINGINSTRUCTION_DATA, JSPROP_ENUMERATE}, + {"sheet", LINKSTYLE_SHEET, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // ProcessingInstruction finalizer // @@ -194,7 +206,7 @@ FinalizeProcessingInstruction(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateProcessingInstruction(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -204,7 +216,7 @@ EnumerateProcessingInstruction(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveProcessingInstruction(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -228,18 +240,6 @@ JSClass ProcessingInstructionClass = { }; -// -// ProcessingInstruction class properties -// -static JSPropertySpec ProcessingInstructionProperties[] = -{ - {"target", PROCESSINGINSTRUCTION_TARGET, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"data", PROCESSINGINSTRUCTION_DATA, JSPROP_ENUMERATE}, - {"sheet", LINKSTYLE_SHEET, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // ProcessingInstruction class methods // diff --git a/dom/src/coreDOM/nsJSStyleSheet.cpp b/dom/src/coreDOM/nsJSStyleSheet.cpp index 6eb51d6bf110..ff9b85ecf8b6 100644 --- a/dom/src/coreDOM/nsJSStyleSheet.cpp +++ b/dom/src/coreDOM/nsJSStyleSheet.cpp @@ -228,6 +228,22 @@ SetStyleSheetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// StyleSheet class properties +// +static JSPropertySpec StyleSheetProperties[] = +{ + {"type", STYLESHEET_TYPE, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"disabled", STYLESHEET_DISABLED, JSPROP_ENUMERATE}, + {"ownerNode", STYLESHEET_OWNERNODE, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"parentStyleSheet", STYLESHEET_PARENTSTYLESHEET, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"href", STYLESHEET_HREF, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"title", STYLESHEET_TITLE, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"media", STYLESHEET_MEDIA, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // StyleSheet finalizer // @@ -244,7 +260,7 @@ FinalizeStyleSheet(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateStyleSheet(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -254,7 +270,7 @@ EnumerateStyleSheet(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveStyleSheet(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -278,22 +294,6 @@ JSClass StyleSheetClass = { }; -// -// StyleSheet class properties -// -static JSPropertySpec StyleSheetProperties[] = -{ - {"type", STYLESHEET_TYPE, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"disabled", STYLESHEET_DISABLED, JSPROP_ENUMERATE}, - {"ownerNode", STYLESHEET_OWNERNODE, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"parentStyleSheet", STYLESHEET_PARENTSTYLESHEET, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"href", STYLESHEET_HREF, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"title", STYLESHEET_TITLE, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"media", STYLESHEET_MEDIA, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // StyleSheet class methods // diff --git a/dom/src/coreDOM/nsJSStyleSheetList.cpp b/dom/src/coreDOM/nsJSStyleSheetList.cpp index be75dd45789f..808fe7e2cecb 100644 --- a/dom/src/coreDOM/nsJSStyleSheetList.cpp +++ b/dom/src/coreDOM/nsJSStyleSheetList.cpp @@ -141,6 +141,16 @@ SetStyleSheetListProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// StyleSheetList class properties +// +static JSPropertySpec StyleSheetListProperties[] = +{ + {"length", STYLESHEETLIST_LENGTH, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // StyleSheetList finalizer // @@ -157,7 +167,7 @@ FinalizeStyleSheetList(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateStyleSheetList(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -167,7 +177,7 @@ EnumerateStyleSheetList(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveStyleSheetList(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -235,16 +245,6 @@ JSClass StyleSheetListClass = { }; -// -// StyleSheetList class properties -// -static JSPropertySpec StyleSheetListProperties[] = -{ - {"length", STYLESHEETLIST_LENGTH, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // StyleSheetList class methods // diff --git a/dom/src/coreDOM/nsJSText.cpp b/dom/src/coreDOM/nsJSText.cpp index 5ac12102a570..58b3cd7e6d10 100644 --- a/dom/src/coreDOM/nsJSText.cpp +++ b/dom/src/coreDOM/nsJSText.cpp @@ -112,6 +112,15 @@ SetTextProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// Text class properties +// +static JSPropertySpec TextProperties[] = +{ + {0} +}; + + // // Text finalizer // @@ -128,7 +137,7 @@ FinalizeText(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateText(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -138,7 +147,7 @@ EnumerateText(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveText(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -206,15 +215,6 @@ JSClass TextClass = { }; -// -// Text class properties -// -static JSPropertySpec TextProperties[] = -{ - {0} -}; - - // // Text class methods // diff --git a/dom/src/css/nsJSCSS2Properties.cpp b/dom/src/css/nsJSCSS2Properties.cpp index a6d5c6868261..62f8e81a94d2 100644 --- a/dom/src/css/nsJSCSS2Properties.cpp +++ b/dom/src/css/nsJSCSS2Properties.cpp @@ -3215,56 +3215,6 @@ SetCSS2PropertiesProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } -// -// CSS2Properties finalizer -// -PR_STATIC_CALLBACK(void) -FinalizeCSS2Properties(JSContext *cx, JSObject *obj) -{ - nsJSUtils::nsGenericFinalize(cx, obj); -} - - -// -// CSS2Properties enumerate -// -PR_STATIC_CALLBACK(JSBool) -EnumerateCSS2Properties(JSContext *cx, JSObject *obj) -{ - return nsJSUtils::nsGenericEnumerate(cx, obj); -} - - -// -// CSS2Properties resolve -// -PR_STATIC_CALLBACK(JSBool) -ResolveCSS2Properties(JSContext *cx, JSObject *obj, jsval id) -{ - return nsJSUtils::nsGenericResolve(cx, obj, id); -} - - -/***********************************************************************/ -// -// class for CSS2Properties -// -JSClass CSS2PropertiesClass = { - "CSS2Properties", - JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS, - JS_PropertyStub, - JS_PropertyStub, - GetCSS2PropertiesProperty, - SetCSS2PropertiesProperty, - EnumerateCSS2Properties, - ResolveCSS2Properties, - JS_ConvertStub, - FinalizeCSS2Properties, - nsnull, - nsJSUtils::nsCheckAccess -}; - - // // CSS2Properties class properties // @@ -3398,6 +3348,56 @@ static JSPropertySpec CSS2PropertiesProperties[] = }; +// +// CSS2Properties finalizer +// +PR_STATIC_CALLBACK(void) +FinalizeCSS2Properties(JSContext *cx, JSObject *obj) +{ + nsJSUtils::nsGenericFinalize(cx, obj); +} + + +// +// CSS2Properties enumerate +// +PR_STATIC_CALLBACK(JSBool) +EnumerateCSS2Properties(JSContext *cx, JSObject *obj) +{ + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); +} + + +// +// CSS2Properties resolve +// +PR_STATIC_CALLBACK(JSBool) +ResolveCSS2Properties(JSContext *cx, JSObject *obj, jsval id) +{ + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); +} + + +/***********************************************************************/ +// +// class for CSS2Properties +// +JSClass CSS2PropertiesClass = { + "CSS2Properties", + JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS, + JS_PropertyStub, + JS_PropertyStub, + GetCSS2PropertiesProperty, + SetCSS2PropertiesProperty, + EnumerateCSS2Properties, + ResolveCSS2Properties, + JS_ConvertStub, + FinalizeCSS2Properties, + nsnull, + nsJSUtils::nsCheckAccess +}; + + // // CSS2Properties class methods // diff --git a/dom/src/css/nsJSCSSFontFaceRule.cpp b/dom/src/css/nsJSCSSFontFaceRule.cpp index 37775b9faa68..9b1cbe817686 100644 --- a/dom/src/css/nsJSCSSFontFaceRule.cpp +++ b/dom/src/css/nsJSCSSFontFaceRule.cpp @@ -132,6 +132,16 @@ SetCSSFontFaceRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// CSSFontFaceRule class properties +// +static JSPropertySpec CSSFontFaceRuleProperties[] = +{ + {"style", CSSFONTFACERULE_STYLE, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // CSSFontFaceRule finalizer // @@ -148,7 +158,7 @@ FinalizeCSSFontFaceRule(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateCSSFontFaceRule(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -158,7 +168,7 @@ EnumerateCSSFontFaceRule(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveCSSFontFaceRule(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -182,16 +192,6 @@ JSClass CSSFontFaceRuleClass = { }; -// -// CSSFontFaceRule class properties -// -static JSPropertySpec CSSFontFaceRuleProperties[] = -{ - {"style", CSSFONTFACERULE_STYLE, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // CSSFontFaceRule class methods // diff --git a/dom/src/css/nsJSCSSImportRule.cpp b/dom/src/css/nsJSCSSImportRule.cpp index 12e0035d851b..a08a04501e3f 100644 --- a/dom/src/css/nsJSCSSImportRule.cpp +++ b/dom/src/css/nsJSCSSImportRule.cpp @@ -161,6 +161,18 @@ SetCSSImportRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// CSSImportRule class properties +// +static JSPropertySpec CSSImportRuleProperties[] = +{ + {"href", CSSIMPORTRULE_HREF, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"media", CSSIMPORTRULE_MEDIA, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"styleSheet", CSSIMPORTRULE_STYLESHEET, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // CSSImportRule finalizer // @@ -177,7 +189,7 @@ FinalizeCSSImportRule(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateCSSImportRule(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -187,7 +199,7 @@ EnumerateCSSImportRule(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveCSSImportRule(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -211,18 +223,6 @@ JSClass CSSImportRuleClass = { }; -// -// CSSImportRule class properties -// -static JSPropertySpec CSSImportRuleProperties[] = -{ - {"href", CSSIMPORTRULE_HREF, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"media", CSSIMPORTRULE_MEDIA, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"styleSheet", CSSIMPORTRULE_STYLESHEET, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // CSSImportRule class methods // diff --git a/dom/src/css/nsJSCSSMediaRule.cpp b/dom/src/css/nsJSCSSMediaRule.cpp index 7b6a154e6184..6468dcaa5902 100644 --- a/dom/src/css/nsJSCSSMediaRule.cpp +++ b/dom/src/css/nsJSCSSMediaRule.cpp @@ -148,6 +148,17 @@ SetCSSMediaRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// CSSMediaRule class properties +// +static JSPropertySpec CSSMediaRuleProperties[] = +{ + {"media", CSSMEDIARULE_MEDIA, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"cssRules", CSSMEDIARULE_CSSRULES, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // CSSMediaRule finalizer // @@ -164,7 +175,7 @@ FinalizeCSSMediaRule(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateCSSMediaRule(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -174,7 +185,7 @@ EnumerateCSSMediaRule(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveCSSMediaRule(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -287,17 +298,6 @@ JSClass CSSMediaRuleClass = { }; -// -// CSSMediaRule class properties -// -static JSPropertySpec CSSMediaRuleProperties[] = -{ - {"media", CSSMEDIARULE_MEDIA, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"cssRules", CSSMEDIARULE_CSSRULES, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // CSSMediaRule class methods // diff --git a/dom/src/css/nsJSCSSPageRule.cpp b/dom/src/css/nsJSCSSPageRule.cpp index 451c2b9df763..a9adc74b86b4 100644 --- a/dom/src/css/nsJSCSSPageRule.cpp +++ b/dom/src/css/nsJSCSSPageRule.cpp @@ -156,6 +156,17 @@ SetCSSPageRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// CSSPageRule class properties +// +static JSPropertySpec CSSPageRuleProperties[] = +{ + {"selectorText", CSSPAGERULE_SELECTORTEXT, JSPROP_ENUMERATE}, + {"style", CSSPAGERULE_STYLE, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // CSSPageRule finalizer // @@ -172,7 +183,7 @@ FinalizeCSSPageRule(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateCSSPageRule(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -182,7 +193,7 @@ EnumerateCSSPageRule(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveCSSPageRule(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -206,17 +217,6 @@ JSClass CSSPageRuleClass = { }; -// -// CSSPageRule class properties -// -static JSPropertySpec CSSPageRuleProperties[] = -{ - {"selectorText", CSSPAGERULE_SELECTORTEXT, JSPROP_ENUMERATE}, - {"style", CSSPAGERULE_STYLE, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // CSSPageRule class methods // diff --git a/dom/src/css/nsJSCSSPrimitiveValue.cpp b/dom/src/css/nsJSCSSPrimitiveValue.cpp index 8c9fb668c475..0d1d9c526427 100644 --- a/dom/src/css/nsJSCSSPrimitiveValue.cpp +++ b/dom/src/css/nsJSCSSPrimitiveValue.cpp @@ -135,6 +135,16 @@ SetCSSPrimitiveValueProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// CSSPrimitiveValue class properties +// +static JSPropertySpec CSSPrimitiveValueProperties[] = +{ + {"primitiveType", CSSPRIMITIVEVALUE_PRIMITIVETYPE, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // CSSPrimitiveValue finalizer // @@ -151,7 +161,7 @@ FinalizeCSSPrimitiveValue(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateCSSPrimitiveValue(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -161,7 +171,7 @@ EnumerateCSSPrimitiveValue(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveCSSPrimitiveValue(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -465,16 +475,6 @@ JSClass CSSPrimitiveValueClass = { }; -// -// CSSPrimitiveValue class properties -// -static JSPropertySpec CSSPrimitiveValueProperties[] = -{ - {"primitiveType", CSSPRIMITIVEVALUE_PRIMITIVETYPE, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // CSSPrimitiveValue class methods // diff --git a/dom/src/css/nsJSCSSRule.cpp b/dom/src/css/nsJSCSSRule.cpp index 8bae5f5160cd..8455db86edcb 100644 --- a/dom/src/css/nsJSCSSRule.cpp +++ b/dom/src/css/nsJSCSSRule.cpp @@ -183,6 +183,19 @@ SetCSSRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// CSSRule class properties +// +static JSPropertySpec CSSRuleProperties[] = +{ + {"type", CSSRULE_TYPE, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"cssText", CSSRULE_CSSTEXT, JSPROP_ENUMERATE}, + {"parentStyleSheet", CSSRULE_PARENTSTYLESHEET, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"parentRule", CSSRULE_PARENTRULE, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // CSSRule finalizer // @@ -199,7 +212,7 @@ FinalizeCSSRule(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateCSSRule(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -209,7 +222,7 @@ EnumerateCSSRule(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveCSSRule(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -233,19 +246,6 @@ JSClass CSSRuleClass = { }; -// -// CSSRule class properties -// -static JSPropertySpec CSSRuleProperties[] = -{ - {"type", CSSRULE_TYPE, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"cssText", CSSRULE_CSSTEXT, JSPROP_ENUMERATE}, - {"parentStyleSheet", CSSRULE_PARENTSTYLESHEET, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"parentRule", CSSRULE_PARENTRULE, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // CSSRule class methods // diff --git a/dom/src/css/nsJSCSSRuleList.cpp b/dom/src/css/nsJSCSSRuleList.cpp index 04fa9937cddd..8590355b344e 100644 --- a/dom/src/css/nsJSCSSRuleList.cpp +++ b/dom/src/css/nsJSCSSRuleList.cpp @@ -141,6 +141,16 @@ SetCSSRuleListProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// CSSRuleList class properties +// +static JSPropertySpec CSSRuleListProperties[] = +{ + {"length", CSSRULELIST_LENGTH, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // CSSRuleList finalizer // @@ -157,7 +167,7 @@ FinalizeCSSRuleList(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateCSSRuleList(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -167,7 +177,7 @@ EnumerateCSSRuleList(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveCSSRuleList(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -235,16 +245,6 @@ JSClass CSSRuleListClass = { }; -// -// CSSRuleList class properties -// -static JSPropertySpec CSSRuleListProperties[] = -{ - {"length", CSSRULELIST_LENGTH, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // CSSRuleList class methods // diff --git a/dom/src/css/nsJSCSSStyleDeclaration.cpp b/dom/src/css/nsJSCSSStyleDeclaration.cpp index 1dc53ac248c9..3980c6456431 100644 --- a/dom/src/css/nsJSCSSStyleDeclaration.cpp +++ b/dom/src/css/nsJSCSSStyleDeclaration.cpp @@ -180,6 +180,18 @@ SetCSSStyleDeclarationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp } +// +// CSSStyleDeclaration class properties +// +static JSPropertySpec CSSStyleDeclarationProperties[] = +{ + {"cssText", CSSSTYLEDECLARATION_CSSTEXT, JSPROP_ENUMERATE}, + {"length", CSSSTYLEDECLARATION_LENGTH, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"parentRule", CSSSTYLEDECLARATION_PARENTRULE, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // CSSStyleDeclaration finalizer // @@ -196,7 +208,7 @@ FinalizeCSSStyleDeclaration(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateCSSStyleDeclaration(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -206,7 +218,7 @@ EnumerateCSSStyleDeclaration(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveCSSStyleDeclaration(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -487,18 +499,6 @@ JSClass CSSStyleDeclarationClass = { }; -// -// CSSStyleDeclaration class properties -// -static JSPropertySpec CSSStyleDeclarationProperties[] = -{ - {"cssText", CSSSTYLEDECLARATION_CSSTEXT, JSPROP_ENUMERATE}, - {"length", CSSSTYLEDECLARATION_LENGTH, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"parentRule", CSSSTYLEDECLARATION_PARENTRULE, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // CSSStyleDeclaration class methods // diff --git a/dom/src/css/nsJSCSSStyleRule.cpp b/dom/src/css/nsJSCSSStyleRule.cpp index 289909f4137d..43c8329b9dcd 100644 --- a/dom/src/css/nsJSCSSStyleRule.cpp +++ b/dom/src/css/nsJSCSSStyleRule.cpp @@ -156,6 +156,17 @@ SetCSSStyleRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// CSSStyleRule class properties +// +static JSPropertySpec CSSStyleRuleProperties[] = +{ + {"selectorText", CSSSTYLERULE_SELECTORTEXT, JSPROP_ENUMERATE}, + {"style", CSSSTYLERULE_STYLE, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // CSSStyleRule finalizer // @@ -172,7 +183,7 @@ FinalizeCSSStyleRule(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateCSSStyleRule(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -182,7 +193,7 @@ EnumerateCSSStyleRule(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveCSSStyleRule(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -206,17 +217,6 @@ JSClass CSSStyleRuleClass = { }; -// -// CSSStyleRule class properties -// -static JSPropertySpec CSSStyleRuleProperties[] = -{ - {"selectorText", CSSSTYLERULE_SELECTORTEXT, JSPROP_ENUMERATE}, - {"style", CSSSTYLERULE_STYLE, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // CSSStyleRule class methods // diff --git a/dom/src/css/nsJSCSSStyleSheet.cpp b/dom/src/css/nsJSCSSStyleSheet.cpp index 9cd26dac2a88..81ddcbabc95e 100644 --- a/dom/src/css/nsJSCSSStyleSheet.cpp +++ b/dom/src/css/nsJSCSSStyleSheet.cpp @@ -148,6 +148,17 @@ SetCSSStyleSheetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// CSSStyleSheet class properties +// +static JSPropertySpec CSSStyleSheetProperties[] = +{ + {"ownerRule", CSSSTYLESHEET_OWNERRULE, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"cssRules", CSSSTYLESHEET_CSSRULES, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // CSSStyleSheet finalizer // @@ -164,7 +175,7 @@ FinalizeCSSStyleSheet(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateCSSStyleSheet(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -174,7 +185,7 @@ EnumerateCSSStyleSheet(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveCSSStyleSheet(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -287,17 +298,6 @@ JSClass CSSStyleSheetClass = { }; -// -// CSSStyleSheet class properties -// -static JSPropertySpec CSSStyleSheetProperties[] = -{ - {"ownerRule", CSSSTYLESHEET_OWNERRULE, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"cssRules", CSSSTYLESHEET_CSSRULES, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // CSSStyleSheet class methods // diff --git a/dom/src/css/nsJSCSSUnknownRule.cpp b/dom/src/css/nsJSCSSUnknownRule.cpp index 65f91339c11f..8f7edeb2f736 100644 --- a/dom/src/css/nsJSCSSUnknownRule.cpp +++ b/dom/src/css/nsJSCSSUnknownRule.cpp @@ -112,6 +112,15 @@ SetCSSUnknownRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// CSSUnknownRule class properties +// +static JSPropertySpec CSSUnknownRuleProperties[] = +{ + {0} +}; + + // // CSSUnknownRule finalizer // @@ -128,7 +137,7 @@ FinalizeCSSUnknownRule(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateCSSUnknownRule(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -138,7 +147,7 @@ EnumerateCSSUnknownRule(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveCSSUnknownRule(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -162,15 +171,6 @@ JSClass CSSUnknownRuleClass = { }; -// -// CSSUnknownRule class properties -// -static JSPropertySpec CSSUnknownRuleProperties[] = -{ - {0} -}; - - // // CSSUnknownRule class methods // diff --git a/dom/src/css/nsJSCSSValue.cpp b/dom/src/css/nsJSCSSValue.cpp index 148730989b8a..e61909bdafc6 100644 --- a/dom/src/css/nsJSCSSValue.cpp +++ b/dom/src/css/nsJSCSSValue.cpp @@ -153,6 +153,17 @@ SetCSSValueProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// CSSValue class properties +// +static JSPropertySpec CSSValueProperties[] = +{ + {"cssText", CSSVALUE_CSSTEXT, JSPROP_ENUMERATE}, + {"cssValueType", CSSVALUE_CSSVALUETYPE, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // CSSValue finalizer // @@ -169,7 +180,7 @@ FinalizeCSSValue(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateCSSValue(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -179,7 +190,7 @@ EnumerateCSSValue(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveCSSValue(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -203,17 +214,6 @@ JSClass CSSValueClass = { }; -// -// CSSValue class properties -// -static JSPropertySpec CSSValueProperties[] = -{ - {"cssText", CSSVALUE_CSSTEXT, JSPROP_ENUMERATE}, - {"cssValueType", CSSVALUE_CSSVALUETYPE, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // CSSValue class methods // diff --git a/dom/src/css/nsJSCounter.cpp b/dom/src/css/nsJSCounter.cpp index ab009b39fb62..938a82636447 100644 --- a/dom/src/css/nsJSCounter.cpp +++ b/dom/src/css/nsJSCounter.cpp @@ -155,6 +155,18 @@ SetCounterProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// Counter class properties +// +static JSPropertySpec CounterProperties[] = +{ + {"identifier", COUNTER_IDENTIFIER, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"listStyle", COUNTER_LISTSTYLE, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"separator", COUNTER_SEPARATOR, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // Counter finalizer // @@ -171,7 +183,7 @@ FinalizeCounter(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateCounter(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -181,7 +193,7 @@ EnumerateCounter(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveCounter(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -205,18 +217,6 @@ JSClass CounterClass = { }; -// -// Counter class properties -// -static JSPropertySpec CounterProperties[] = -{ - {"identifier", COUNTER_IDENTIFIER, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"listStyle", COUNTER_LISTSTYLE, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"separator", COUNTER_SEPARATOR, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // Counter class methods // diff --git a/dom/src/css/nsJSRGBColor.cpp b/dom/src/css/nsJSRGBColor.cpp index 23db461dd1dd..04600e36cf89 100644 --- a/dom/src/css/nsJSRGBColor.cpp +++ b/dom/src/css/nsJSRGBColor.cpp @@ -160,6 +160,18 @@ SetRGBColorProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// RGBColor class properties +// +static JSPropertySpec RGBColorProperties[] = +{ + {"red", RGBCOLOR_RED, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"green", RGBCOLOR_GREEN, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"blue", RGBCOLOR_BLUE, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // RGBColor finalizer // @@ -176,7 +188,7 @@ FinalizeRGBColor(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateRGBColor(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -186,7 +198,7 @@ EnumerateRGBColor(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveRGBColor(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -210,18 +222,6 @@ JSClass RGBColorClass = { }; -// -// RGBColor class properties -// -static JSPropertySpec RGBColorProperties[] = -{ - {"red", RGBCOLOR_RED, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"green", RGBCOLOR_GREEN, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"blue", RGBCOLOR_BLUE, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // RGBColor class methods // diff --git a/dom/src/css/nsJSRect.cpp b/dom/src/css/nsJSRect.cpp index f3b2390fc8e1..31e934c06978 100644 --- a/dom/src/css/nsJSRect.cpp +++ b/dom/src/css/nsJSRect.cpp @@ -174,6 +174,19 @@ SetRectProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// Rect class properties +// +static JSPropertySpec RectProperties[] = +{ + {"top", RECT_TOP, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"right", RECT_RIGHT, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"bottom", RECT_BOTTOM, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"left", RECT_LEFT, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // Rect finalizer // @@ -190,7 +203,7 @@ FinalizeRect(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateRect(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -200,7 +213,7 @@ EnumerateRect(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveRect(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -224,19 +237,6 @@ JSClass RectClass = { }; -// -// Rect class properties -// -static JSPropertySpec RectProperties[] = -{ - {"top", RECT_TOP, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"right", RECT_RIGHT, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"bottom", RECT_BOTTOM, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"left", RECT_LEFT, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // Rect class methods // diff --git a/dom/src/events/nsJSEvent.cpp b/dom/src/events/nsJSEvent.cpp index 4d38f76607eb..8c05d743baae 100644 --- a/dom/src/events/nsJSEvent.cpp +++ b/dom/src/events/nsJSEvent.cpp @@ -231,6 +231,23 @@ SetEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// Event class properties +// +static JSPropertySpec EventProperties[] = +{ + {"type", EVENT_TYPE, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"target", EVENT_TARGET, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"currentTarget", EVENT_CURRENTTARGET, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"originalTarget", EVENT_ORIGINALTARGET, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"eventPhase", EVENT_EVENTPHASE, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"bubbles", EVENT_BUBBLES, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"cancelable", EVENT_CANCELABLE, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"timeStamp", EVENT_TIMESTAMP, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // Event finalizer // @@ -247,7 +264,7 @@ FinalizeEvent(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateEvent(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -257,7 +274,7 @@ EnumerateEvent(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveEvent(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -470,23 +487,6 @@ JSClass EventClass = { }; -// -// Event class properties -// -static JSPropertySpec EventProperties[] = -{ - {"type", EVENT_TYPE, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"target", EVENT_TARGET, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"currentTarget", EVENT_CURRENTTARGET, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"originalTarget", EVENT_ORIGINALTARGET, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"eventPhase", EVENT_EVENTPHASE, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"bubbles", EVENT_BUBBLES, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"cancelable", EVENT_CANCELABLE, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"timeStamp", EVENT_TIMESTAMP, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // Event class methods // diff --git a/dom/src/events/nsJSKeyEvent.cpp b/dom/src/events/nsJSKeyEvent.cpp index b4341814a01e..6973d140bf72 100644 --- a/dom/src/events/nsJSKeyEvent.cpp +++ b/dom/src/events/nsJSKeyEvent.cpp @@ -337,7 +337,7 @@ FinalizeKeyEvent(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateKeyEvent(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -347,7 +347,7 @@ EnumerateKeyEvent(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveKeyEvent(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } diff --git a/dom/src/events/nsJSUIEvent.cpp b/dom/src/events/nsJSUIEvent.cpp index 3464eb2797a1..f10c286f612b 100644 --- a/dom/src/events/nsJSUIEvent.cpp +++ b/dom/src/events/nsJSUIEvent.cpp @@ -352,6 +352,26 @@ SetUIEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// UIEvent class properties +// +static JSPropertySpec UIEventProperties[] = +{ + {"view", UIEVENT_VIEW, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"detail", UIEVENT_DETAIL, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"layerX", NSUIEVENT_LAYERX, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"layerY", NSUIEVENT_LAYERY, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"pageX", NSUIEVENT_PAGEX, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"pageY", NSUIEVENT_PAGEY, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"which", NSUIEVENT_WHICH, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"rangeParent", NSUIEVENT_RANGEPARENT, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"rangeOffset", NSUIEVENT_RANGEOFFSET, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"cancelBubble", NSUIEVENT_CANCELBUBBLE, JSPROP_ENUMERATE}, + {"isChar", NSUIEVENT_ISCHAR, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // UIEvent finalizer // @@ -368,7 +388,7 @@ FinalizeUIEvent(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateUIEvent(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -378,7 +398,7 @@ EnumerateUIEvent(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveUIEvent(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -504,26 +524,6 @@ JSClass UIEventClass = { }; -// -// UIEvent class properties -// -static JSPropertySpec UIEventProperties[] = -{ - {"view", UIEVENT_VIEW, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"detail", UIEVENT_DETAIL, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"layerX", NSUIEVENT_LAYERX, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"layerY", NSUIEVENT_LAYERY, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"pageX", NSUIEVENT_PAGEX, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"pageY", NSUIEVENT_PAGEY, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"which", NSUIEVENT_WHICH, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"rangeParent", NSUIEVENT_RANGEPARENT, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"rangeOffset", NSUIEVENT_RANGEOFFSET, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"cancelBubble", NSUIEVENT_CANCELBUBBLE, JSPROP_ENUMERATE}, - {"isChar", NSUIEVENT_ISCHAR, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // UIEvent class methods // diff --git a/dom/src/html/nsJSHTMLAnchorElement.cpp b/dom/src/html/nsJSHTMLAnchorElement.cpp index 64eec7c0e927..a18b8b69a6cd 100644 --- a/dom/src/html/nsJSHTMLAnchorElement.cpp +++ b/dom/src/html/nsJSHTMLAnchorElement.cpp @@ -584,6 +584,35 @@ SetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLAnchorElement class properties +// +static JSPropertySpec HTMLAnchorElementProperties[] = +{ + {"accessKey", HTMLANCHORELEMENT_ACCESSKEY, JSPROP_ENUMERATE}, + {"charset", HTMLANCHORELEMENT_CHARSET, JSPROP_ENUMERATE}, + {"coords", HTMLANCHORELEMENT_COORDS, JSPROP_ENUMERATE}, + {"href", HTMLANCHORELEMENT_HREF, JSPROP_ENUMERATE}, + {"hreflang", HTMLANCHORELEMENT_HREFLANG, JSPROP_ENUMERATE}, + {"name", HTMLANCHORELEMENT_NAME, JSPROP_ENUMERATE}, + {"rel", HTMLANCHORELEMENT_REL, JSPROP_ENUMERATE}, + {"rev", HTMLANCHORELEMENT_REV, JSPROP_ENUMERATE}, + {"shape", HTMLANCHORELEMENT_SHAPE, JSPROP_ENUMERATE}, + {"tabIndex", HTMLANCHORELEMENT_TABINDEX, JSPROP_ENUMERATE}, + {"target", HTMLANCHORELEMENT_TARGET, JSPROP_ENUMERATE}, + {"type", HTMLANCHORELEMENT_TYPE, JSPROP_ENUMERATE}, + {"protocol", NSHTMLANCHORELEMENT_PROTOCOL, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"host", NSHTMLANCHORELEMENT_HOST, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"hostname", NSHTMLANCHORELEMENT_HOSTNAME, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"pathname", NSHTMLANCHORELEMENT_PATHNAME, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"search", NSHTMLANCHORELEMENT_SEARCH, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"port", NSHTMLANCHORELEMENT_PORT, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"hash", NSHTMLANCHORELEMENT_HASH, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"text", NSHTMLANCHORELEMENT_TEXT, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // HTMLAnchorElement finalizer // @@ -600,7 +629,7 @@ FinalizeHTMLAnchorElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLAnchorElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -610,7 +639,7 @@ EnumerateHTMLAnchorElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLAnchorElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -704,35 +733,6 @@ JSClass HTMLAnchorElementClass = { }; -// -// HTMLAnchorElement class properties -// -static JSPropertySpec HTMLAnchorElementProperties[] = -{ - {"accessKey", HTMLANCHORELEMENT_ACCESSKEY, JSPROP_ENUMERATE}, - {"charset", HTMLANCHORELEMENT_CHARSET, JSPROP_ENUMERATE}, - {"coords", HTMLANCHORELEMENT_COORDS, JSPROP_ENUMERATE}, - {"href", HTMLANCHORELEMENT_HREF, JSPROP_ENUMERATE}, - {"hreflang", HTMLANCHORELEMENT_HREFLANG, JSPROP_ENUMERATE}, - {"name", HTMLANCHORELEMENT_NAME, JSPROP_ENUMERATE}, - {"rel", HTMLANCHORELEMENT_REL, JSPROP_ENUMERATE}, - {"rev", HTMLANCHORELEMENT_REV, JSPROP_ENUMERATE}, - {"shape", HTMLANCHORELEMENT_SHAPE, JSPROP_ENUMERATE}, - {"tabIndex", HTMLANCHORELEMENT_TABINDEX, JSPROP_ENUMERATE}, - {"target", HTMLANCHORELEMENT_TARGET, JSPROP_ENUMERATE}, - {"type", HTMLANCHORELEMENT_TYPE, JSPROP_ENUMERATE}, - {"protocol", NSHTMLANCHORELEMENT_PROTOCOL, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"host", NSHTMLANCHORELEMENT_HOST, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"hostname", NSHTMLANCHORELEMENT_HOSTNAME, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"pathname", NSHTMLANCHORELEMENT_PATHNAME, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"search", NSHTMLANCHORELEMENT_SEARCH, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"port", NSHTMLANCHORELEMENT_PORT, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"hash", NSHTMLANCHORELEMENT_HASH, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"text", NSHTMLANCHORELEMENT_TEXT, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // HTMLAnchorElement class methods // diff --git a/dom/src/html/nsJSHTMLAppletElement.cpp b/dom/src/html/nsJSHTMLAppletElement.cpp index 0636e45f0027..c9c89f6db062 100644 --- a/dom/src/html/nsJSHTMLAppletElement.cpp +++ b/dom/src/html/nsJSHTMLAppletElement.cpp @@ -390,6 +390,26 @@ SetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLAppletElement class properties +// +static JSPropertySpec HTMLAppletElementProperties[] = +{ + {"align", HTMLAPPLETELEMENT_ALIGN, JSPROP_ENUMERATE}, + {"alt", HTMLAPPLETELEMENT_ALT, JSPROP_ENUMERATE}, + {"archive", HTMLAPPLETELEMENT_ARCHIVE, JSPROP_ENUMERATE}, + {"code", HTMLAPPLETELEMENT_CODE, JSPROP_ENUMERATE}, + {"codeBase", HTMLAPPLETELEMENT_CODEBASE, JSPROP_ENUMERATE}, + {"height", HTMLAPPLETELEMENT_HEIGHT, JSPROP_ENUMERATE}, + {"hspace", HTMLAPPLETELEMENT_HSPACE, JSPROP_ENUMERATE}, + {"name", HTMLAPPLETELEMENT_NAME, JSPROP_ENUMERATE}, + {"object", HTMLAPPLETELEMENT_OBJECT, JSPROP_ENUMERATE}, + {"vspace", HTMLAPPLETELEMENT_VSPACE, JSPROP_ENUMERATE}, + {"width", HTMLAPPLETELEMENT_WIDTH, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLAppletElement finalizer // @@ -406,7 +426,7 @@ FinalizeHTMLAppletElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLAppletElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -416,7 +436,7 @@ EnumerateHTMLAppletElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLAppletElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -440,26 +460,6 @@ JSClass HTMLAppletElementClass = { }; -// -// HTMLAppletElement class properties -// -static JSPropertySpec HTMLAppletElementProperties[] = -{ - {"align", HTMLAPPLETELEMENT_ALIGN, JSPROP_ENUMERATE}, - {"alt", HTMLAPPLETELEMENT_ALT, JSPROP_ENUMERATE}, - {"archive", HTMLAPPLETELEMENT_ARCHIVE, JSPROP_ENUMERATE}, - {"code", HTMLAPPLETELEMENT_CODE, JSPROP_ENUMERATE}, - {"codeBase", HTMLAPPLETELEMENT_CODEBASE, JSPROP_ENUMERATE}, - {"height", HTMLAPPLETELEMENT_HEIGHT, JSPROP_ENUMERATE}, - {"hspace", HTMLAPPLETELEMENT_HSPACE, JSPROP_ENUMERATE}, - {"name", HTMLAPPLETELEMENT_NAME, JSPROP_ENUMERATE}, - {"object", HTMLAPPLETELEMENT_OBJECT, JSPROP_ENUMERATE}, - {"vspace", HTMLAPPLETELEMENT_VSPACE, JSPROP_ENUMERATE}, - {"width", HTMLAPPLETELEMENT_WIDTH, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLAppletElement class methods // diff --git a/dom/src/html/nsJSHTMLAreaElement.cpp b/dom/src/html/nsJSHTMLAreaElement.cpp index def6b4347128..63cf6873015b 100644 --- a/dom/src/html/nsJSHTMLAreaElement.cpp +++ b/dom/src/html/nsJSHTMLAreaElement.cpp @@ -467,56 +467,6 @@ SetHTMLAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } -// -// HTMLAreaElement finalizer -// -PR_STATIC_CALLBACK(void) -FinalizeHTMLAreaElement(JSContext *cx, JSObject *obj) -{ - nsJSUtils::nsGenericFinalize(cx, obj); -} - - -// -// HTMLAreaElement enumerate -// -PR_STATIC_CALLBACK(JSBool) -EnumerateHTMLAreaElement(JSContext *cx, JSObject *obj) -{ - return nsJSUtils::nsGenericEnumerate(cx, obj); -} - - -// -// HTMLAreaElement resolve -// -PR_STATIC_CALLBACK(JSBool) -ResolveHTMLAreaElement(JSContext *cx, JSObject *obj, jsval id) -{ - return nsJSUtils::nsGenericResolve(cx, obj, id); -} - - -/***********************************************************************/ -// -// class for HTMLAreaElement -// -JSClass HTMLAreaElementClass = { - "HTMLAreaElement", - JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS, - JS_PropertyStub, - JS_PropertyStub, - GetHTMLAreaElementProperty, - SetHTMLAreaElementProperty, - EnumerateHTMLAreaElement, - ResolveHTMLAreaElement, - JS_ConvertStub, - FinalizeHTMLAreaElement, - nsnull, - nsJSUtils::nsCheckAccess -}; - - // // HTMLAreaElement class properties // @@ -541,6 +491,56 @@ static JSPropertySpec HTMLAreaElementProperties[] = }; +// +// HTMLAreaElement finalizer +// +PR_STATIC_CALLBACK(void) +FinalizeHTMLAreaElement(JSContext *cx, JSObject *obj) +{ + nsJSUtils::nsGenericFinalize(cx, obj); +} + + +// +// HTMLAreaElement enumerate +// +PR_STATIC_CALLBACK(JSBool) +EnumerateHTMLAreaElement(JSContext *cx, JSObject *obj) +{ + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); +} + + +// +// HTMLAreaElement resolve +// +PR_STATIC_CALLBACK(JSBool) +ResolveHTMLAreaElement(JSContext *cx, JSObject *obj, jsval id) +{ + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); +} + + +/***********************************************************************/ +// +// class for HTMLAreaElement +// +JSClass HTMLAreaElementClass = { + "HTMLAreaElement", + JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS, + JS_PropertyStub, + JS_PropertyStub, + GetHTMLAreaElementProperty, + SetHTMLAreaElementProperty, + EnumerateHTMLAreaElement, + ResolveHTMLAreaElement, + JS_ConvertStub, + FinalizeHTMLAreaElement, + nsnull, + nsJSUtils::nsCheckAccess +}; + + // // HTMLAreaElement class methods // diff --git a/dom/src/html/nsJSHTMLBRElement.cpp b/dom/src/html/nsJSHTMLBRElement.cpp index 3d4aa99fe97d..65b8f8fd6288 100644 --- a/dom/src/html/nsJSHTMLBRElement.cpp +++ b/dom/src/html/nsJSHTMLBRElement.cpp @@ -140,6 +140,16 @@ SetHTMLBRElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLBRElement class properties +// +static JSPropertySpec HTMLBRElementProperties[] = +{ + {"clear", HTMLBRELEMENT_CLEAR, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLBRElement finalizer // @@ -156,7 +166,7 @@ FinalizeHTMLBRElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLBRElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -166,7 +176,7 @@ EnumerateHTMLBRElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLBRElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -190,16 +200,6 @@ JSClass HTMLBRElementClass = { }; -// -// HTMLBRElement class properties -// -static JSPropertySpec HTMLBRElementProperties[] = -{ - {"clear", HTMLBRELEMENT_CLEAR, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLBRElement class methods // diff --git a/dom/src/html/nsJSHTMLBaseElement.cpp b/dom/src/html/nsJSHTMLBaseElement.cpp index 1eea45896781..380d83da8407 100644 --- a/dom/src/html/nsJSHTMLBaseElement.cpp +++ b/dom/src/html/nsJSHTMLBaseElement.cpp @@ -165,6 +165,17 @@ SetHTMLBaseElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLBaseElement class properties +// +static JSPropertySpec HTMLBaseElementProperties[] = +{ + {"href", HTMLBASEELEMENT_HREF, JSPROP_ENUMERATE}, + {"target", HTMLBASEELEMENT_TARGET, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLBaseElement finalizer // @@ -181,7 +192,7 @@ FinalizeHTMLBaseElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLBaseElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -191,7 +202,7 @@ EnumerateHTMLBaseElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLBaseElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -215,17 +226,6 @@ JSClass HTMLBaseElementClass = { }; -// -// HTMLBaseElement class properties -// -static JSPropertySpec HTMLBaseElementProperties[] = -{ - {"href", HTMLBASEELEMENT_HREF, JSPROP_ENUMERATE}, - {"target", HTMLBASEELEMENT_TARGET, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLBaseElement class methods // diff --git a/dom/src/html/nsJSHTMLBaseFontElement.cpp b/dom/src/html/nsJSHTMLBaseFontElement.cpp index 3c16531f7fcd..89b8e2a7c200 100644 --- a/dom/src/html/nsJSHTMLBaseFontElement.cpp +++ b/dom/src/html/nsJSHTMLBaseFontElement.cpp @@ -190,6 +190,18 @@ SetHTMLBaseFontElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp } +// +// HTMLBaseFontElement class properties +// +static JSPropertySpec HTMLBaseFontElementProperties[] = +{ + {"color", HTMLBASEFONTELEMENT_COLOR, JSPROP_ENUMERATE}, + {"face", HTMLBASEFONTELEMENT_FACE, JSPROP_ENUMERATE}, + {"size", HTMLBASEFONTELEMENT_SIZE, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLBaseFontElement finalizer // @@ -206,7 +218,7 @@ FinalizeHTMLBaseFontElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLBaseFontElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -216,7 +228,7 @@ EnumerateHTMLBaseFontElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLBaseFontElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -240,18 +252,6 @@ JSClass HTMLBaseFontElementClass = { }; -// -// HTMLBaseFontElement class properties -// -static JSPropertySpec HTMLBaseFontElementProperties[] = -{ - {"color", HTMLBASEFONTELEMENT_COLOR, JSPROP_ENUMERATE}, - {"face", HTMLBASEFONTELEMENT_FACE, JSPROP_ENUMERATE}, - {"size", HTMLBASEFONTELEMENT_SIZE, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLBaseFontElement class methods // diff --git a/dom/src/html/nsJSHTMLBodyElement.cpp b/dom/src/html/nsJSHTMLBodyElement.cpp index aa2a2296cf3e..1a557dc2edfc 100644 --- a/dom/src/html/nsJSHTMLBodyElement.cpp +++ b/dom/src/html/nsJSHTMLBodyElement.cpp @@ -265,6 +265,21 @@ SetHTMLBodyElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLBodyElement class properties +// +static JSPropertySpec HTMLBodyElementProperties[] = +{ + {"aLink", HTMLBODYELEMENT_ALINK, JSPROP_ENUMERATE}, + {"background", HTMLBODYELEMENT_BACKGROUND, JSPROP_ENUMERATE}, + {"bgColor", HTMLBODYELEMENT_BGCOLOR, JSPROP_ENUMERATE}, + {"link", HTMLBODYELEMENT_LINK, JSPROP_ENUMERATE}, + {"text", HTMLBODYELEMENT_TEXT, JSPROP_ENUMERATE}, + {"vLink", HTMLBODYELEMENT_VLINK, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLBodyElement finalizer // @@ -281,7 +296,7 @@ FinalizeHTMLBodyElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLBodyElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -291,7 +306,7 @@ EnumerateHTMLBodyElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLBodyElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -315,21 +330,6 @@ JSClass HTMLBodyElementClass = { }; -// -// HTMLBodyElement class properties -// -static JSPropertySpec HTMLBodyElementProperties[] = -{ - {"aLink", HTMLBODYELEMENT_ALINK, JSPROP_ENUMERATE}, - {"background", HTMLBODYELEMENT_BACKGROUND, JSPROP_ENUMERATE}, - {"bgColor", HTMLBODYELEMENT_BGCOLOR, JSPROP_ENUMERATE}, - {"link", HTMLBODYELEMENT_LINK, JSPROP_ENUMERATE}, - {"text", HTMLBODYELEMENT_TEXT, JSPROP_ENUMERATE}, - {"vLink", HTMLBODYELEMENT_VLINK, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLBodyElement class methods // diff --git a/dom/src/html/nsJSHTMLButtonElement.cpp b/dom/src/html/nsJSHTMLButtonElement.cpp index 42227554ebc0..0e4bc8aca718 100644 --- a/dom/src/html/nsJSHTMLButtonElement.cpp +++ b/dom/src/html/nsJSHTMLButtonElement.cpp @@ -281,6 +281,22 @@ SetHTMLButtonElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLButtonElement class properties +// +static JSPropertySpec HTMLButtonElementProperties[] = +{ + {"form", HTMLBUTTONELEMENT_FORM, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"accessKey", HTMLBUTTONELEMENT_ACCESSKEY, JSPROP_ENUMERATE}, + {"disabled", HTMLBUTTONELEMENT_DISABLED, JSPROP_ENUMERATE}, + {"name", HTMLBUTTONELEMENT_NAME, JSPROP_ENUMERATE}, + {"tabIndex", HTMLBUTTONELEMENT_TABINDEX, JSPROP_ENUMERATE}, + {"type", HTMLBUTTONELEMENT_TYPE, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"value", HTMLBUTTONELEMENT_VALUE, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLButtonElement finalizer // @@ -297,7 +313,7 @@ FinalizeHTMLButtonElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLButtonElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -307,7 +323,7 @@ EnumerateHTMLButtonElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLButtonElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -411,22 +427,6 @@ JSClass HTMLButtonElementClass = { }; -// -// HTMLButtonElement class properties -// -static JSPropertySpec HTMLButtonElementProperties[] = -{ - {"form", HTMLBUTTONELEMENT_FORM, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"accessKey", HTMLBUTTONELEMENT_ACCESSKEY, JSPROP_ENUMERATE}, - {"disabled", HTMLBUTTONELEMENT_DISABLED, JSPROP_ENUMERATE}, - {"name", HTMLBUTTONELEMENT_NAME, JSPROP_ENUMERATE}, - {"tabIndex", HTMLBUTTONELEMENT_TABINDEX, JSPROP_ENUMERATE}, - {"type", HTMLBUTTONELEMENT_TYPE, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"value", HTMLBUTTONELEMENT_VALUE, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLButtonElement class methods // diff --git a/dom/src/html/nsJSHTMLCollection.cpp b/dom/src/html/nsJSHTMLCollection.cpp index 8b37d7cd1142..04036a994c23 100644 --- a/dom/src/html/nsJSHTMLCollection.cpp +++ b/dom/src/html/nsJSHTMLCollection.cpp @@ -173,6 +173,16 @@ SetHTMLCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLCollection class properties +// +static JSPropertySpec HTMLCollectionProperties[] = +{ + {"length", HTMLCOLLECTION_LENGTH, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // HTMLCollection finalizer // @@ -189,7 +199,7 @@ FinalizeHTMLCollection(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLCollection(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -199,7 +209,7 @@ EnumerateHTMLCollection(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLCollection(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -309,16 +319,6 @@ JSClass HTMLCollectionClass = { }; -// -// HTMLCollection class properties -// -static JSPropertySpec HTMLCollectionProperties[] = -{ - {"length", HTMLCOLLECTION_LENGTH, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // HTMLCollection class methods // diff --git a/dom/src/html/nsJSHTMLDListElement.cpp b/dom/src/html/nsJSHTMLDListElement.cpp index 442a430320ab..51194c5d42e7 100644 --- a/dom/src/html/nsJSHTMLDListElement.cpp +++ b/dom/src/html/nsJSHTMLDListElement.cpp @@ -143,6 +143,16 @@ SetHTMLDListElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLDListElement class properties +// +static JSPropertySpec HTMLDListElementProperties[] = +{ + {"compact", HTMLDLISTELEMENT_COMPACT, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLDListElement finalizer // @@ -159,7 +169,7 @@ FinalizeHTMLDListElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLDListElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -169,7 +179,7 @@ EnumerateHTMLDListElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLDListElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -193,16 +203,6 @@ JSClass HTMLDListElementClass = { }; -// -// HTMLDListElement class properties -// -static JSPropertySpec HTMLDListElementProperties[] = -{ - {"compact", HTMLDLISTELEMENT_COMPACT, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLDListElement class methods // diff --git a/dom/src/html/nsJSHTMLDirectoryElement.cpp b/dom/src/html/nsJSHTMLDirectoryElement.cpp index 8d2b72b55d0a..200064743de1 100644 --- a/dom/src/html/nsJSHTMLDirectoryElement.cpp +++ b/dom/src/html/nsJSHTMLDirectoryElement.cpp @@ -143,6 +143,16 @@ SetHTMLDirectoryElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v } +// +// HTMLDirectoryElement class properties +// +static JSPropertySpec HTMLDirectoryElementProperties[] = +{ + {"compact", HTMLDIRECTORYELEMENT_COMPACT, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLDirectoryElement finalizer // @@ -159,7 +169,7 @@ FinalizeHTMLDirectoryElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLDirectoryElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -169,7 +179,7 @@ EnumerateHTMLDirectoryElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLDirectoryElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -193,16 +203,6 @@ JSClass HTMLDirectoryElementClass = { }; -// -// HTMLDirectoryElement class properties -// -static JSPropertySpec HTMLDirectoryElementProperties[] = -{ - {"compact", HTMLDIRECTORYELEMENT_COMPACT, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLDirectoryElement class methods // diff --git a/dom/src/html/nsJSHTMLDivElement.cpp b/dom/src/html/nsJSHTMLDivElement.cpp index 1395b465c5f5..76650d1ae773 100644 --- a/dom/src/html/nsJSHTMLDivElement.cpp +++ b/dom/src/html/nsJSHTMLDivElement.cpp @@ -140,6 +140,16 @@ SetHTMLDivElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLDivElement class properties +// +static JSPropertySpec HTMLDivElementProperties[] = +{ + {"align", HTMLDIVELEMENT_ALIGN, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLDivElement finalizer // @@ -156,7 +166,7 @@ FinalizeHTMLDivElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLDivElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -166,7 +176,7 @@ EnumerateHTMLDivElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLDivElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -190,16 +200,6 @@ JSClass HTMLDivElementClass = { }; -// -// HTMLDivElement class properties -// -static JSPropertySpec HTMLDivElementProperties[] = -{ - {"align", HTMLDIVELEMENT_ALIGN, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLDivElement class methods // diff --git a/dom/src/html/nsJSHTMLDocument.cpp b/dom/src/html/nsJSHTMLDocument.cpp index f1662287474d..fbfff0a7e816 100644 --- a/dom/src/html/nsJSHTMLDocument.cpp +++ b/dom/src/html/nsJSHTMLDocument.cpp @@ -627,6 +627,35 @@ SetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLDocument class properties +// +static JSPropertySpec HTMLDocumentProperties[] = +{ + {"title", HTMLDOCUMENT_TITLE, JSPROP_ENUMERATE}, + {"referrer", HTMLDOCUMENT_REFERRER, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"domain", HTMLDOCUMENT_DOMAIN, JSPROP_ENUMERATE}, + {"URL", HTMLDOCUMENT_URL, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"body", HTMLDOCUMENT_BODY, JSPROP_ENUMERATE}, + {"images", HTMLDOCUMENT_IMAGES, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"applets", HTMLDOCUMENT_APPLETS, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"links", HTMLDOCUMENT_LINKS, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"forms", HTMLDOCUMENT_FORMS, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"anchors", HTMLDOCUMENT_ANCHORS, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"cookie", HTMLDOCUMENT_COOKIE, JSPROP_ENUMERATE}, + {"width", NSHTMLDOCUMENT_WIDTH, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"height", NSHTMLDOCUMENT_HEIGHT, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"alinkColor", NSHTMLDOCUMENT_ALINKCOLOR, JSPROP_ENUMERATE}, + {"linkColor", NSHTMLDOCUMENT_LINKCOLOR, JSPROP_ENUMERATE}, + {"vlinkColor", NSHTMLDOCUMENT_VLINKCOLOR, JSPROP_ENUMERATE}, + {"bgColor", NSHTMLDOCUMENT_BGCOLOR, JSPROP_ENUMERATE}, + {"fgColor", NSHTMLDOCUMENT_FGCOLOR, JSPROP_ENUMERATE}, + {"lastModified", NSHTMLDOCUMENT_LASTMODIFIED, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"embeds", NSHTMLDOCUMENT_EMBEDS, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // HTMLDocument finalizer // @@ -643,7 +672,7 @@ FinalizeHTMLDocument(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLDocument(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -653,7 +682,7 @@ EnumerateHTMLDocument(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLDocument(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -1144,35 +1173,6 @@ JSClass HTMLDocumentClass = { }; -// -// HTMLDocument class properties -// -static JSPropertySpec HTMLDocumentProperties[] = -{ - {"title", HTMLDOCUMENT_TITLE, JSPROP_ENUMERATE}, - {"referrer", HTMLDOCUMENT_REFERRER, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"domain", HTMLDOCUMENT_DOMAIN, JSPROP_ENUMERATE}, - {"URL", HTMLDOCUMENT_URL, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"body", HTMLDOCUMENT_BODY, JSPROP_ENUMERATE}, - {"images", HTMLDOCUMENT_IMAGES, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"applets", HTMLDOCUMENT_APPLETS, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"links", HTMLDOCUMENT_LINKS, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"forms", HTMLDOCUMENT_FORMS, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"anchors", HTMLDOCUMENT_ANCHORS, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"cookie", HTMLDOCUMENT_COOKIE, JSPROP_ENUMERATE}, - {"width", NSHTMLDOCUMENT_WIDTH, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"height", NSHTMLDOCUMENT_HEIGHT, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"alinkColor", NSHTMLDOCUMENT_ALINKCOLOR, JSPROP_ENUMERATE}, - {"linkColor", NSHTMLDOCUMENT_LINKCOLOR, JSPROP_ENUMERATE}, - {"vlinkColor", NSHTMLDOCUMENT_VLINKCOLOR, JSPROP_ENUMERATE}, - {"bgColor", NSHTMLDOCUMENT_BGCOLOR, JSPROP_ENUMERATE}, - {"fgColor", NSHTMLDOCUMENT_FGCOLOR, JSPROP_ENUMERATE}, - {"lastModified", NSHTMLDOCUMENT_LASTMODIFIED, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"embeds", NSHTMLDOCUMENT_EMBEDS, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // HTMLDocument class methods // diff --git a/dom/src/html/nsJSHTMLElement.cpp b/dom/src/html/nsJSHTMLElement.cpp index 3da9e8b8a397..2609651d1f8f 100644 --- a/dom/src/html/nsJSHTMLElement.cpp +++ b/dom/src/html/nsJSHTMLElement.cpp @@ -349,6 +349,27 @@ SetHTMLElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLElement class properties +// +static JSPropertySpec HTMLElementProperties[] = +{ + {"id", HTMLELEMENT_ID, JSPROP_ENUMERATE}, + {"title", HTMLELEMENT_TITLE, JSPROP_ENUMERATE}, + {"lang", HTMLELEMENT_LANG, JSPROP_ENUMERATE}, + {"dir", HTMLELEMENT_DIR, JSPROP_ENUMERATE}, + {"className", HTMLELEMENT_CLASSNAME, JSPROP_ENUMERATE}, + {"style", HTMLELEMENT_STYLE, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"offsetTop", HTMLELEMENT_OFFSETTOP, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"offsetLeft", HTMLELEMENT_OFFSETLEFT, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"offsetWidth", HTMLELEMENT_OFFSETWIDTH, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"offsetHeight", HTMLELEMENT_OFFSETHEIGHT, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"offsetParent", HTMLELEMENT_OFFSETPARENT, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"innerHTML", HTMLELEMENT_INNERHTML, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLElement finalizer // @@ -365,7 +386,7 @@ FinalizeHTMLElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -375,7 +396,7 @@ EnumerateHTMLElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -399,27 +420,6 @@ JSClass HTMLElementClass = { }; -// -// HTMLElement class properties -// -static JSPropertySpec HTMLElementProperties[] = -{ - {"id", HTMLELEMENT_ID, JSPROP_ENUMERATE}, - {"title", HTMLELEMENT_TITLE, JSPROP_ENUMERATE}, - {"lang", HTMLELEMENT_LANG, JSPROP_ENUMERATE}, - {"dir", HTMLELEMENT_DIR, JSPROP_ENUMERATE}, - {"className", HTMLELEMENT_CLASSNAME, JSPROP_ENUMERATE}, - {"style", HTMLELEMENT_STYLE, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"offsetTop", HTMLELEMENT_OFFSETTOP, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"offsetLeft", HTMLELEMENT_OFFSETLEFT, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"offsetWidth", HTMLELEMENT_OFFSETWIDTH, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"offsetHeight", HTMLELEMENT_OFFSETHEIGHT, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"offsetParent", HTMLELEMENT_OFFSETPARENT, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"innerHTML", HTMLELEMENT_INNERHTML, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLElement class methods // diff --git a/dom/src/html/nsJSHTMLEmbedElement.cpp b/dom/src/html/nsJSHTMLEmbedElement.cpp index ba8458a95500..08ec92384f2e 100644 --- a/dom/src/html/nsJSHTMLEmbedElement.cpp +++ b/dom/src/html/nsJSHTMLEmbedElement.cpp @@ -271,6 +271,21 @@ SetHTMLEmbedElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLEmbedElement class properties +// +static JSPropertySpec HTMLEmbedElementProperties[] = +{ + {"align", HTMLEMBEDELEMENT_ALIGN, JSPROP_ENUMERATE}, + {"height", HTMLEMBEDELEMENT_HEIGHT, JSPROP_ENUMERATE}, + {"name", HTMLEMBEDELEMENT_NAME, JSPROP_ENUMERATE}, + {"src", HTMLEMBEDELEMENT_SRC, JSPROP_ENUMERATE}, + {"type", HTMLEMBEDELEMENT_TYPE, JSPROP_ENUMERATE}, + {"width", HTMLEMBEDELEMENT_WIDTH, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLEmbedElement finalizer // @@ -287,7 +302,7 @@ FinalizeHTMLEmbedElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLEmbedElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -297,7 +312,7 @@ EnumerateHTMLEmbedElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLEmbedElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -321,21 +336,6 @@ JSClass HTMLEmbedElementClass = { }; -// -// HTMLEmbedElement class properties -// -static JSPropertySpec HTMLEmbedElementProperties[] = -{ - {"align", HTMLEMBEDELEMENT_ALIGN, JSPROP_ENUMERATE}, - {"height", HTMLEMBEDELEMENT_HEIGHT, JSPROP_ENUMERATE}, - {"name", HTMLEMBEDELEMENT_NAME, JSPROP_ENUMERATE}, - {"src", HTMLEMBEDELEMENT_SRC, JSPROP_ENUMERATE}, - {"type", HTMLEMBEDELEMENT_TYPE, JSPROP_ENUMERATE}, - {"width", HTMLEMBEDELEMENT_WIDTH, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLEmbedElement class methods // diff --git a/dom/src/html/nsJSHTMLFieldSetElement.cpp b/dom/src/html/nsJSHTMLFieldSetElement.cpp index 903a2f83f124..6066f2a8ba9a 100644 --- a/dom/src/html/nsJSHTMLFieldSetElement.cpp +++ b/dom/src/html/nsJSHTMLFieldSetElement.cpp @@ -132,6 +132,16 @@ SetHTMLFieldSetElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp } +// +// HTMLFieldSetElement class properties +// +static JSPropertySpec HTMLFieldSetElementProperties[] = +{ + {"form", HTMLFIELDSETELEMENT_FORM, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // HTMLFieldSetElement finalizer // @@ -148,7 +158,7 @@ FinalizeHTMLFieldSetElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLFieldSetElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -158,7 +168,7 @@ EnumerateHTMLFieldSetElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLFieldSetElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -182,16 +192,6 @@ JSClass HTMLFieldSetElementClass = { }; -// -// HTMLFieldSetElement class properties -// -static JSPropertySpec HTMLFieldSetElementProperties[] = -{ - {"form", HTMLFIELDSETELEMENT_FORM, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // HTMLFieldSetElement class methods // diff --git a/dom/src/html/nsJSHTMLFontElement.cpp b/dom/src/html/nsJSHTMLFontElement.cpp index c292a7b50e43..fe9c970b50c6 100644 --- a/dom/src/html/nsJSHTMLFontElement.cpp +++ b/dom/src/html/nsJSHTMLFontElement.cpp @@ -190,6 +190,18 @@ SetHTMLFontElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLFontElement class properties +// +static JSPropertySpec HTMLFontElementProperties[] = +{ + {"color", HTMLFONTELEMENT_COLOR, JSPROP_ENUMERATE}, + {"face", HTMLFONTELEMENT_FACE, JSPROP_ENUMERATE}, + {"size", HTMLFONTELEMENT_SIZE, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLFontElement finalizer // @@ -206,7 +218,7 @@ FinalizeHTMLFontElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLFontElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -216,7 +228,7 @@ EnumerateHTMLFontElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLFontElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -240,18 +252,6 @@ JSClass HTMLFontElementClass = { }; -// -// HTMLFontElement class properties -// -static JSPropertySpec HTMLFontElementProperties[] = -{ - {"color", HTMLFONTELEMENT_COLOR, JSPROP_ENUMERATE}, - {"face", HTMLFONTELEMENT_FACE, JSPROP_ENUMERATE}, - {"size", HTMLFONTELEMENT_SIZE, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLFontElement class methods // diff --git a/dom/src/html/nsJSHTMLFormControlList.cpp b/dom/src/html/nsJSHTMLFormControlList.cpp index f026d69ac799..a52677162934 100644 --- a/dom/src/html/nsJSHTMLFormControlList.cpp +++ b/dom/src/html/nsJSHTMLFormControlList.cpp @@ -122,6 +122,15 @@ SetHTMLFormControlListProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp } +// +// HTMLFormControlList class properties +// +static JSPropertySpec HTMLFormControlListProperties[] = +{ + {0} +}; + + // // HTMLFormControlList finalizer // @@ -138,7 +147,7 @@ FinalizeHTMLFormControlList(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLFormControlList(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -148,7 +157,7 @@ EnumerateHTMLFormControlList(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLFormControlList(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -244,15 +253,6 @@ JSClass HTMLFormControlListClass = { }; -// -// HTMLFormControlList class properties -// -static JSPropertySpec HTMLFormControlListProperties[] = -{ - {0} -}; - - // // HTMLFormControlList class methods // diff --git a/dom/src/html/nsJSHTMLFormElement.cpp b/dom/src/html/nsJSHTMLFormElement.cpp index 26f598d060c4..fb9eac298380 100644 --- a/dom/src/html/nsJSHTMLFormElement.cpp +++ b/dom/src/html/nsJSHTMLFormElement.cpp @@ -352,6 +352,24 @@ SetHTMLFormElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLFormElement class properties +// +static JSPropertySpec HTMLFormElementProperties[] = +{ + {"elements", HTMLFORMELEMENT_ELEMENTS, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"length", HTMLFORMELEMENT_LENGTH, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"name", HTMLFORMELEMENT_NAME, JSPROP_ENUMERATE}, + {"acceptCharset", HTMLFORMELEMENT_ACCEPTCHARSET, JSPROP_ENUMERATE}, + {"action", HTMLFORMELEMENT_ACTION, JSPROP_ENUMERATE}, + {"enctype", HTMLFORMELEMENT_ENCTYPE, JSPROP_ENUMERATE}, + {"method", HTMLFORMELEMENT_METHOD, JSPROP_ENUMERATE}, + {"target", HTMLFORMELEMENT_TARGET, JSPROP_ENUMERATE}, + {"encoding", NSHTMLFORMELEMENT_ENCODING, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // HTMLFormElement finalizer // @@ -368,7 +386,7 @@ FinalizeHTMLFormElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLFormElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -378,7 +396,7 @@ EnumerateHTMLFormElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLFormElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -562,24 +580,6 @@ JSClass HTMLFormElementClass = { }; -// -// HTMLFormElement class properties -// -static JSPropertySpec HTMLFormElementProperties[] = -{ - {"elements", HTMLFORMELEMENT_ELEMENTS, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"length", HTMLFORMELEMENT_LENGTH, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"name", HTMLFORMELEMENT_NAME, JSPROP_ENUMERATE}, - {"acceptCharset", HTMLFORMELEMENT_ACCEPTCHARSET, JSPROP_ENUMERATE}, - {"action", HTMLFORMELEMENT_ACTION, JSPROP_ENUMERATE}, - {"enctype", HTMLFORMELEMENT_ENCTYPE, JSPROP_ENUMERATE}, - {"method", HTMLFORMELEMENT_METHOD, JSPROP_ENUMERATE}, - {"target", HTMLFORMELEMENT_TARGET, JSPROP_ENUMERATE}, - {"encoding", NSHTMLFORMELEMENT_ENCODING, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // HTMLFormElement class methods // diff --git a/dom/src/html/nsJSHTMLFrameElement.cpp b/dom/src/html/nsJSHTMLFrameElement.cpp index 38ab5c2e91e8..9efc26461c19 100644 --- a/dom/src/html/nsJSHTMLFrameElement.cpp +++ b/dom/src/html/nsJSHTMLFrameElement.cpp @@ -351,6 +351,24 @@ SetHTMLFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLFrameElement class properties +// +static JSPropertySpec HTMLFrameElementProperties[] = +{ + {"frameBorder", HTMLFRAMEELEMENT_FRAMEBORDER, JSPROP_ENUMERATE}, + {"longDesc", HTMLFRAMEELEMENT_LONGDESC, JSPROP_ENUMERATE}, + {"marginHeight", HTMLFRAMEELEMENT_MARGINHEIGHT, JSPROP_ENUMERATE}, + {"marginWidth", HTMLFRAMEELEMENT_MARGINWIDTH, JSPROP_ENUMERATE}, + {"name", HTMLFRAMEELEMENT_NAME, JSPROP_ENUMERATE}, + {"noResize", HTMLFRAMEELEMENT_NORESIZE, JSPROP_ENUMERATE}, + {"scrolling", HTMLFRAMEELEMENT_SCROLLING, JSPROP_ENUMERATE}, + {"src", HTMLFRAMEELEMENT_SRC, JSPROP_ENUMERATE}, + {"contentDocument", HTMLFRAMEELEMENT_CONTENTDOCUMENT, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLFrameElement finalizer // @@ -367,7 +385,7 @@ FinalizeHTMLFrameElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLFrameElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -377,7 +395,7 @@ EnumerateHTMLFrameElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLFrameElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -401,24 +419,6 @@ JSClass HTMLFrameElementClass = { }; -// -// HTMLFrameElement class properties -// -static JSPropertySpec HTMLFrameElementProperties[] = -{ - {"frameBorder", HTMLFRAMEELEMENT_FRAMEBORDER, JSPROP_ENUMERATE}, - {"longDesc", HTMLFRAMEELEMENT_LONGDESC, JSPROP_ENUMERATE}, - {"marginHeight", HTMLFRAMEELEMENT_MARGINHEIGHT, JSPROP_ENUMERATE}, - {"marginWidth", HTMLFRAMEELEMENT_MARGINWIDTH, JSPROP_ENUMERATE}, - {"name", HTMLFRAMEELEMENT_NAME, JSPROP_ENUMERATE}, - {"noResize", HTMLFRAMEELEMENT_NORESIZE, JSPROP_ENUMERATE}, - {"scrolling", HTMLFRAMEELEMENT_SCROLLING, JSPROP_ENUMERATE}, - {"src", HTMLFRAMEELEMENT_SRC, JSPROP_ENUMERATE}, - {"contentDocument", HTMLFRAMEELEMENT_CONTENTDOCUMENT, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLFrameElement class methods // diff --git a/dom/src/html/nsJSHTMLFrameSetElement.cpp b/dom/src/html/nsJSHTMLFrameSetElement.cpp index 253cd5a1d099..96ff244ae650 100644 --- a/dom/src/html/nsJSHTMLFrameSetElement.cpp +++ b/dom/src/html/nsJSHTMLFrameSetElement.cpp @@ -165,6 +165,17 @@ SetHTMLFrameSetElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp } +// +// HTMLFrameSetElement class properties +// +static JSPropertySpec HTMLFrameSetElementProperties[] = +{ + {"cols", HTMLFRAMESETELEMENT_COLS, JSPROP_ENUMERATE}, + {"rows", HTMLFRAMESETELEMENT_ROWS, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLFrameSetElement finalizer // @@ -181,7 +192,7 @@ FinalizeHTMLFrameSetElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLFrameSetElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -191,7 +202,7 @@ EnumerateHTMLFrameSetElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLFrameSetElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -215,17 +226,6 @@ JSClass HTMLFrameSetElementClass = { }; -// -// HTMLFrameSetElement class properties -// -static JSPropertySpec HTMLFrameSetElementProperties[] = -{ - {"cols", HTMLFRAMESETELEMENT_COLS, JSPROP_ENUMERATE}, - {"rows", HTMLFRAMESETELEMENT_ROWS, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLFrameSetElement class methods // diff --git a/dom/src/html/nsJSHTMLHRElement.cpp b/dom/src/html/nsJSHTMLHRElement.cpp index 00e098680f73..c1032c076696 100644 --- a/dom/src/html/nsJSHTMLHRElement.cpp +++ b/dom/src/html/nsJSHTMLHRElement.cpp @@ -218,6 +218,19 @@ SetHTMLHRElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLHRElement class properties +// +static JSPropertySpec HTMLHRElementProperties[] = +{ + {"align", HTMLHRELEMENT_ALIGN, JSPROP_ENUMERATE}, + {"noShade", HTMLHRELEMENT_NOSHADE, JSPROP_ENUMERATE}, + {"size", HTMLHRELEMENT_SIZE, JSPROP_ENUMERATE}, + {"width", HTMLHRELEMENT_WIDTH, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLHRElement finalizer // @@ -234,7 +247,7 @@ FinalizeHTMLHRElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLHRElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -244,7 +257,7 @@ EnumerateHTMLHRElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLHRElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -268,19 +281,6 @@ JSClass HTMLHRElementClass = { }; -// -// HTMLHRElement class properties -// -static JSPropertySpec HTMLHRElementProperties[] = -{ - {"align", HTMLHRELEMENT_ALIGN, JSPROP_ENUMERATE}, - {"noShade", HTMLHRELEMENT_NOSHADE, JSPROP_ENUMERATE}, - {"size", HTMLHRELEMENT_SIZE, JSPROP_ENUMERATE}, - {"width", HTMLHRELEMENT_WIDTH, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLHRElement class methods // diff --git a/dom/src/html/nsJSHTMLHeadElement.cpp b/dom/src/html/nsJSHTMLHeadElement.cpp index e4d8ce32f02c..02c355c6b44b 100644 --- a/dom/src/html/nsJSHTMLHeadElement.cpp +++ b/dom/src/html/nsJSHTMLHeadElement.cpp @@ -140,6 +140,16 @@ SetHTMLHeadElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLHeadElement class properties +// +static JSPropertySpec HTMLHeadElementProperties[] = +{ + {"profile", HTMLHEADELEMENT_PROFILE, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLHeadElement finalizer // @@ -156,7 +166,7 @@ FinalizeHTMLHeadElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLHeadElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -166,7 +176,7 @@ EnumerateHTMLHeadElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLHeadElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -190,16 +200,6 @@ JSClass HTMLHeadElementClass = { }; -// -// HTMLHeadElement class properties -// -static JSPropertySpec HTMLHeadElementProperties[] = -{ - {"profile", HTMLHEADELEMENT_PROFILE, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLHeadElement class methods // diff --git a/dom/src/html/nsJSHTMLHeadingElement.cpp b/dom/src/html/nsJSHTMLHeadingElement.cpp index 1443f4199956..7318430a6df6 100644 --- a/dom/src/html/nsJSHTMLHeadingElement.cpp +++ b/dom/src/html/nsJSHTMLHeadingElement.cpp @@ -140,6 +140,16 @@ SetHTMLHeadingElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLHeadingElement class properties +// +static JSPropertySpec HTMLHeadingElementProperties[] = +{ + {"align", HTMLHEADINGELEMENT_ALIGN, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLHeadingElement finalizer // @@ -156,7 +166,7 @@ FinalizeHTMLHeadingElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLHeadingElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -166,7 +176,7 @@ EnumerateHTMLHeadingElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLHeadingElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -190,16 +200,6 @@ JSClass HTMLHeadingElementClass = { }; -// -// HTMLHeadingElement class properties -// -static JSPropertySpec HTMLHeadingElementProperties[] = -{ - {"align", HTMLHEADINGELEMENT_ALIGN, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLHeadingElement class methods // diff --git a/dom/src/html/nsJSHTMLHtmlElement.cpp b/dom/src/html/nsJSHTMLHtmlElement.cpp index 86e2e01e08d2..19cd208234fc 100644 --- a/dom/src/html/nsJSHTMLHtmlElement.cpp +++ b/dom/src/html/nsJSHTMLHtmlElement.cpp @@ -140,6 +140,16 @@ SetHTMLHtmlElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLHtmlElement class properties +// +static JSPropertySpec HTMLHtmlElementProperties[] = +{ + {"version", HTMLHTMLELEMENT_VERSION, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLHtmlElement finalizer // @@ -156,7 +166,7 @@ FinalizeHTMLHtmlElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLHtmlElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -166,7 +176,7 @@ EnumerateHTMLHtmlElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLHtmlElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -190,16 +200,6 @@ JSClass HTMLHtmlElementClass = { }; -// -// HTMLHtmlElement class properties -// -static JSPropertySpec HTMLHtmlElementProperties[] = -{ - {"version", HTMLHTMLELEMENT_VERSION, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLHtmlElement class methods // diff --git a/dom/src/html/nsJSHTMLIFrameElement.cpp b/dom/src/html/nsJSHTMLIFrameElement.cpp index 455639d1e3d3..598285e7805e 100644 --- a/dom/src/html/nsJSHTMLIFrameElement.cpp +++ b/dom/src/html/nsJSHTMLIFrameElement.cpp @@ -398,6 +398,26 @@ SetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLIFrameElement class properties +// +static JSPropertySpec HTMLIFrameElementProperties[] = +{ + {"align", HTMLIFRAMEELEMENT_ALIGN, JSPROP_ENUMERATE}, + {"frameBorder", HTMLIFRAMEELEMENT_FRAMEBORDER, JSPROP_ENUMERATE}, + {"height", HTMLIFRAMEELEMENT_HEIGHT, JSPROP_ENUMERATE}, + {"longDesc", HTMLIFRAMEELEMENT_LONGDESC, JSPROP_ENUMERATE}, + {"marginHeight", HTMLIFRAMEELEMENT_MARGINHEIGHT, JSPROP_ENUMERATE}, + {"marginWidth", HTMLIFRAMEELEMENT_MARGINWIDTH, JSPROP_ENUMERATE}, + {"name", HTMLIFRAMEELEMENT_NAME, JSPROP_ENUMERATE}, + {"scrolling", HTMLIFRAMEELEMENT_SCROLLING, JSPROP_ENUMERATE}, + {"src", HTMLIFRAMEELEMENT_SRC, JSPROP_ENUMERATE}, + {"width", HTMLIFRAMEELEMENT_WIDTH, JSPROP_ENUMERATE}, + {"contentDocument", HTMLIFRAMEELEMENT_CONTENTDOCUMENT, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLIFrameElement finalizer // @@ -414,7 +434,7 @@ FinalizeHTMLIFrameElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLIFrameElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -424,7 +444,7 @@ EnumerateHTMLIFrameElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLIFrameElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -448,26 +468,6 @@ JSClass HTMLIFrameElementClass = { }; -// -// HTMLIFrameElement class properties -// -static JSPropertySpec HTMLIFrameElementProperties[] = -{ - {"align", HTMLIFRAMEELEMENT_ALIGN, JSPROP_ENUMERATE}, - {"frameBorder", HTMLIFRAMEELEMENT_FRAMEBORDER, JSPROP_ENUMERATE}, - {"height", HTMLIFRAMEELEMENT_HEIGHT, JSPROP_ENUMERATE}, - {"longDesc", HTMLIFRAMEELEMENT_LONGDESC, JSPROP_ENUMERATE}, - {"marginHeight", HTMLIFRAMEELEMENT_MARGINHEIGHT, JSPROP_ENUMERATE}, - {"marginWidth", HTMLIFRAMEELEMENT_MARGINWIDTH, JSPROP_ENUMERATE}, - {"name", HTMLIFRAMEELEMENT_NAME, JSPROP_ENUMERATE}, - {"scrolling", HTMLIFRAMEELEMENT_SCROLLING, JSPROP_ENUMERATE}, - {"src", HTMLIFRAMEELEMENT_SRC, JSPROP_ENUMERATE}, - {"width", HTMLIFRAMEELEMENT_WIDTH, JSPROP_ENUMERATE}, - {"contentDocument", HTMLIFRAMEELEMENT_CONTENTDOCUMENT, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLIFrameElement class methods // diff --git a/dom/src/html/nsJSHTMLImageElement.cpp b/dom/src/html/nsJSHTMLImageElement.cpp index caec5d6587d7..46fe0f0c69fc 100644 --- a/dom/src/html/nsJSHTMLImageElement.cpp +++ b/dom/src/html/nsJSHTMLImageElement.cpp @@ -634,56 +634,6 @@ SetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } -// -// HTMLImageElement finalizer -// -PR_STATIC_CALLBACK(void) -FinalizeHTMLImageElement(JSContext *cx, JSObject *obj) -{ - nsJSUtils::nsGenericFinalize(cx, obj); -} - - -// -// HTMLImageElement enumerate -// -PR_STATIC_CALLBACK(JSBool) -EnumerateHTMLImageElement(JSContext *cx, JSObject *obj) -{ - return nsJSUtils::nsGenericEnumerate(cx, obj); -} - - -// -// HTMLImageElement resolve -// -PR_STATIC_CALLBACK(JSBool) -ResolveHTMLImageElement(JSContext *cx, JSObject *obj, jsval id) -{ - return nsJSUtils::nsGenericResolve(cx, obj, id); -} - - -/***********************************************************************/ -// -// class for HTMLImageElement -// -JSClass HTMLImageElementClass = { - "HTMLImageElement", - JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS, - JS_PropertyStub, - JS_PropertyStub, - GetHTMLImageElementProperty, - SetHTMLImageElementProperty, - EnumerateHTMLImageElement, - ResolveHTMLImageElement, - JS_ConvertStub, - FinalizeHTMLImageElement, - nsnull, - nsJSUtils::nsCheckAccess -}; - - // // HTMLImageElement class properties // @@ -709,6 +659,56 @@ static JSPropertySpec HTMLImageElementProperties[] = }; +// +// HTMLImageElement finalizer +// +PR_STATIC_CALLBACK(void) +FinalizeHTMLImageElement(JSContext *cx, JSObject *obj) +{ + nsJSUtils::nsGenericFinalize(cx, obj); +} + + +// +// HTMLImageElement enumerate +// +PR_STATIC_CALLBACK(JSBool) +EnumerateHTMLImageElement(JSContext *cx, JSObject *obj) +{ + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); +} + + +// +// HTMLImageElement resolve +// +PR_STATIC_CALLBACK(JSBool) +ResolveHTMLImageElement(JSContext *cx, JSObject *obj, jsval id) +{ + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); +} + + +/***********************************************************************/ +// +// class for HTMLImageElement +// +JSClass HTMLImageElementClass = { + "HTMLImageElement", + JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS, + JS_PropertyStub, + JS_PropertyStub, + GetHTMLImageElementProperty, + SetHTMLImageElementProperty, + EnumerateHTMLImageElement, + ResolveHTMLImageElement, + JS_ConvertStub, + FinalizeHTMLImageElement, + nsnull, + nsJSUtils::nsCheckAccess +}; + + // // HTMLImageElement class methods // diff --git a/dom/src/html/nsJSHTMLInputElement.cpp b/dom/src/html/nsJSHTMLInputElement.cpp index 6fce7c22c1f2..692b3fde7465 100644 --- a/dom/src/html/nsJSHTMLInputElement.cpp +++ b/dom/src/html/nsJSHTMLInputElement.cpp @@ -721,6 +721,37 @@ SetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLInputElement class properties +// +static JSPropertySpec HTMLInputElementProperties[] = +{ + {"defaultValue", HTMLINPUTELEMENT_DEFAULTVALUE, JSPROP_ENUMERATE}, + {"defaultChecked", HTMLINPUTELEMENT_DEFAULTCHECKED, JSPROP_ENUMERATE}, + {"form", HTMLINPUTELEMENT_FORM, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"accept", HTMLINPUTELEMENT_ACCEPT, JSPROP_ENUMERATE}, + {"accessKey", HTMLINPUTELEMENT_ACCESSKEY, JSPROP_ENUMERATE}, + {"align", HTMLINPUTELEMENT_ALIGN, JSPROP_ENUMERATE}, + {"alt", HTMLINPUTELEMENT_ALT, JSPROP_ENUMERATE}, + {"checked", HTMLINPUTELEMENT_CHECKED, JSPROP_ENUMERATE}, + {"disabled", HTMLINPUTELEMENT_DISABLED, JSPROP_ENUMERATE}, + {"maxLength", HTMLINPUTELEMENT_MAXLENGTH, JSPROP_ENUMERATE}, + {"name", HTMLINPUTELEMENT_NAME, JSPROP_ENUMERATE}, + {"readOnly", HTMLINPUTELEMENT_READONLY, JSPROP_ENUMERATE}, + {"size", HTMLINPUTELEMENT_SIZE, JSPROP_ENUMERATE}, + {"src", HTMLINPUTELEMENT_SRC, JSPROP_ENUMERATE}, + {"tabIndex", HTMLINPUTELEMENT_TABINDEX, JSPROP_ENUMERATE}, + {"type", HTMLINPUTELEMENT_TYPE, JSPROP_ENUMERATE}, + {"useMap", HTMLINPUTELEMENT_USEMAP, JSPROP_ENUMERATE}, + {"value", HTMLINPUTELEMENT_VALUE, JSPROP_ENUMERATE}, + {"controllers", NSHTMLINPUTELEMENT_CONTROLLERS, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"textLength", NSHTMLINPUTELEMENT_TEXTLENGTH, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"selectionStart", NSHTMLINPUTELEMENT_SELECTIONSTART, JSPROP_ENUMERATE}, + {"selectionEnd", NSHTMLINPUTELEMENT_SELECTIONEND, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLInputElement finalizer // @@ -737,7 +768,7 @@ FinalizeHTMLInputElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLInputElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -747,7 +778,7 @@ EnumerateHTMLInputElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLInputElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -963,37 +994,6 @@ JSClass HTMLInputElementClass = { }; -// -// HTMLInputElement class properties -// -static JSPropertySpec HTMLInputElementProperties[] = -{ - {"defaultValue", HTMLINPUTELEMENT_DEFAULTVALUE, JSPROP_ENUMERATE}, - {"defaultChecked", HTMLINPUTELEMENT_DEFAULTCHECKED, JSPROP_ENUMERATE}, - {"form", HTMLINPUTELEMENT_FORM, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"accept", HTMLINPUTELEMENT_ACCEPT, JSPROP_ENUMERATE}, - {"accessKey", HTMLINPUTELEMENT_ACCESSKEY, JSPROP_ENUMERATE}, - {"align", HTMLINPUTELEMENT_ALIGN, JSPROP_ENUMERATE}, - {"alt", HTMLINPUTELEMENT_ALT, JSPROP_ENUMERATE}, - {"checked", HTMLINPUTELEMENT_CHECKED, JSPROP_ENUMERATE}, - {"disabled", HTMLINPUTELEMENT_DISABLED, JSPROP_ENUMERATE}, - {"maxLength", HTMLINPUTELEMENT_MAXLENGTH, JSPROP_ENUMERATE}, - {"name", HTMLINPUTELEMENT_NAME, JSPROP_ENUMERATE}, - {"readOnly", HTMLINPUTELEMENT_READONLY, JSPROP_ENUMERATE}, - {"size", HTMLINPUTELEMENT_SIZE, JSPROP_ENUMERATE}, - {"src", HTMLINPUTELEMENT_SRC, JSPROP_ENUMERATE}, - {"tabIndex", HTMLINPUTELEMENT_TABINDEX, JSPROP_ENUMERATE}, - {"type", HTMLINPUTELEMENT_TYPE, JSPROP_ENUMERATE}, - {"useMap", HTMLINPUTELEMENT_USEMAP, JSPROP_ENUMERATE}, - {"value", HTMLINPUTELEMENT_VALUE, JSPROP_ENUMERATE}, - {"controllers", NSHTMLINPUTELEMENT_CONTROLLERS, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"textLength", NSHTMLINPUTELEMENT_TEXTLENGTH, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"selectionStart", NSHTMLINPUTELEMENT_SELECTIONSTART, JSPROP_ENUMERATE}, - {"selectionEnd", NSHTMLINPUTELEMENT_SELECTIONEND, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLInputElement class methods // diff --git a/dom/src/html/nsJSHTMLIsIndexElement.cpp b/dom/src/html/nsJSHTMLIsIndexElement.cpp index 2bc193ea41cc..5018754977b9 100644 --- a/dom/src/html/nsJSHTMLIsIndexElement.cpp +++ b/dom/src/html/nsJSHTMLIsIndexElement.cpp @@ -156,6 +156,17 @@ SetHTMLIsIndexElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLIsIndexElement class properties +// +static JSPropertySpec HTMLIsIndexElementProperties[] = +{ + {"form", HTMLISINDEXELEMENT_FORM, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"prompt", HTMLISINDEXELEMENT_PROMPT, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLIsIndexElement finalizer // @@ -172,7 +183,7 @@ FinalizeHTMLIsIndexElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLIsIndexElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -182,7 +193,7 @@ EnumerateHTMLIsIndexElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLIsIndexElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -206,17 +217,6 @@ JSClass HTMLIsIndexElementClass = { }; -// -// HTMLIsIndexElement class properties -// -static JSPropertySpec HTMLIsIndexElementProperties[] = -{ - {"form", HTMLISINDEXELEMENT_FORM, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"prompt", HTMLISINDEXELEMENT_PROMPT, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLIsIndexElement class methods // diff --git a/dom/src/html/nsJSHTMLLIElement.cpp b/dom/src/html/nsJSHTMLLIElement.cpp index 72f35ebcef4b..9b24afe00887 100644 --- a/dom/src/html/nsJSHTMLLIElement.cpp +++ b/dom/src/html/nsJSHTMLLIElement.cpp @@ -172,6 +172,17 @@ SetHTMLLIElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLLIElement class properties +// +static JSPropertySpec HTMLLIElementProperties[] = +{ + {"type", HTMLLIELEMENT_TYPE, JSPROP_ENUMERATE}, + {"value", HTMLLIELEMENT_VALUE, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLLIElement finalizer // @@ -188,7 +199,7 @@ FinalizeHTMLLIElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLLIElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -198,7 +209,7 @@ EnumerateHTMLLIElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLLIElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -222,17 +233,6 @@ JSClass HTMLLIElementClass = { }; -// -// HTMLLIElement class properties -// -static JSPropertySpec HTMLLIElementProperties[] = -{ - {"type", HTMLLIELEMENT_TYPE, JSPROP_ENUMERATE}, - {"value", HTMLLIELEMENT_VALUE, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLLIElement class methods // diff --git a/dom/src/html/nsJSHTMLLabelElement.cpp b/dom/src/html/nsJSHTMLLabelElement.cpp index 9abeb00dd285..be17e76fed2a 100644 --- a/dom/src/html/nsJSHTMLLabelElement.cpp +++ b/dom/src/html/nsJSHTMLLabelElement.cpp @@ -181,6 +181,18 @@ SetHTMLLabelElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLLabelElement class properties +// +static JSPropertySpec HTMLLabelElementProperties[] = +{ + {"form", HTMLLABELELEMENT_FORM, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"accessKey", HTMLLABELELEMENT_ACCESSKEY, JSPROP_ENUMERATE}, + {"htmlFor", HTMLLABELELEMENT_HTMLFOR, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLLabelElement finalizer // @@ -197,7 +209,7 @@ FinalizeHTMLLabelElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLLabelElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -207,7 +219,7 @@ EnumerateHTMLLabelElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLLabelElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -231,18 +243,6 @@ JSClass HTMLLabelElementClass = { }; -// -// HTMLLabelElement class properties -// -static JSPropertySpec HTMLLabelElementProperties[] = -{ - {"form", HTMLLABELELEMENT_FORM, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"accessKey", HTMLLABELELEMENT_ACCESSKEY, JSPROP_ENUMERATE}, - {"htmlFor", HTMLLABELELEMENT_HTMLFOR, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLLabelElement class methods // diff --git a/dom/src/html/nsJSHTMLLayerElement.cpp b/dom/src/html/nsJSHTMLLayerElement.cpp index c8dde1a5ecde..30d63d5e0e1d 100644 --- a/dom/src/html/nsJSHTMLLayerElement.cpp +++ b/dom/src/html/nsJSHTMLLayerElement.cpp @@ -327,6 +327,23 @@ SetHTMLLayerElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLLayerElement class properties +// +static JSPropertySpec HTMLLayerElementProperties[] = +{ + {"top", HTMLLAYERELEMENT_TOP, JSPROP_ENUMERATE}, + {"left", HTMLLAYERELEMENT_LEFT, JSPROP_ENUMERATE}, + {"visibility", HTMLLAYERELEMENT_VISIBILITY, JSPROP_ENUMERATE}, + {"background", HTMLLAYERELEMENT_BACKGROUND, JSPROP_ENUMERATE}, + {"bgColor", HTMLLAYERELEMENT_BGCOLOR, JSPROP_ENUMERATE}, + {"name", HTMLLAYERELEMENT_NAME, JSPROP_ENUMERATE}, + {"zIndex", HTMLLAYERELEMENT_ZINDEX, JSPROP_ENUMERATE}, + {"document", HTMLLAYERELEMENT_DOCUMENT, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // HTMLLayerElement finalizer // @@ -343,7 +360,7 @@ FinalizeHTMLLayerElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLLayerElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -353,7 +370,7 @@ EnumerateHTMLLayerElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLLayerElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -377,23 +394,6 @@ JSClass HTMLLayerElementClass = { }; -// -// HTMLLayerElement class properties -// -static JSPropertySpec HTMLLayerElementProperties[] = -{ - {"top", HTMLLAYERELEMENT_TOP, JSPROP_ENUMERATE}, - {"left", HTMLLAYERELEMENT_LEFT, JSPROP_ENUMERATE}, - {"visibility", HTMLLAYERELEMENT_VISIBILITY, JSPROP_ENUMERATE}, - {"background", HTMLLAYERELEMENT_BACKGROUND, JSPROP_ENUMERATE}, - {"bgColor", HTMLLAYERELEMENT_BGCOLOR, JSPROP_ENUMERATE}, - {"name", HTMLLAYERELEMENT_NAME, JSPROP_ENUMERATE}, - {"zIndex", HTMLLAYERELEMENT_ZINDEX, JSPROP_ENUMERATE}, - {"document", HTMLLAYERELEMENT_DOCUMENT, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // HTMLLayerElement class methods // diff --git a/dom/src/html/nsJSHTMLLegendElement.cpp b/dom/src/html/nsJSHTMLLegendElement.cpp index 7a4b9bae4fb5..5ba5ef686105 100644 --- a/dom/src/html/nsJSHTMLLegendElement.cpp +++ b/dom/src/html/nsJSHTMLLegendElement.cpp @@ -181,6 +181,18 @@ SetHTMLLegendElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLLegendElement class properties +// +static JSPropertySpec HTMLLegendElementProperties[] = +{ + {"form", HTMLLEGENDELEMENT_FORM, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"accessKey", HTMLLEGENDELEMENT_ACCESSKEY, JSPROP_ENUMERATE}, + {"align", HTMLLEGENDELEMENT_ALIGN, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLLegendElement finalizer // @@ -197,7 +209,7 @@ FinalizeHTMLLegendElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLLegendElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -207,7 +219,7 @@ EnumerateHTMLLegendElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLLegendElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -231,18 +243,6 @@ JSClass HTMLLegendElementClass = { }; -// -// HTMLLegendElement class properties -// -static JSPropertySpec HTMLLegendElementProperties[] = -{ - {"form", HTMLLEGENDELEMENT_FORM, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"accessKey", HTMLLEGENDELEMENT_ACCESSKEY, JSPROP_ENUMERATE}, - {"align", HTMLLEGENDELEMENT_ALIGN, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLLegendElement class methods // diff --git a/dom/src/html/nsJSHTMLLinkElement.cpp b/dom/src/html/nsJSHTMLLinkElement.cpp index f655a27117eb..e1c3ba189d83 100644 --- a/dom/src/html/nsJSHTMLLinkElement.cpp +++ b/dom/src/html/nsJSHTMLLinkElement.cpp @@ -368,6 +368,25 @@ SetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLLinkElement class properties +// +static JSPropertySpec HTMLLinkElementProperties[] = +{ + {"disabled", HTMLLINKELEMENT_DISABLED, JSPROP_ENUMERATE}, + {"charset", HTMLLINKELEMENT_CHARSET, JSPROP_ENUMERATE}, + {"href", HTMLLINKELEMENT_HREF, JSPROP_ENUMERATE}, + {"hreflang", HTMLLINKELEMENT_HREFLANG, JSPROP_ENUMERATE}, + {"media", HTMLLINKELEMENT_MEDIA, JSPROP_ENUMERATE}, + {"rel", HTMLLINKELEMENT_REL, JSPROP_ENUMERATE}, + {"rev", HTMLLINKELEMENT_REV, JSPROP_ENUMERATE}, + {"target", HTMLLINKELEMENT_TARGET, JSPROP_ENUMERATE}, + {"type", HTMLLINKELEMENT_TYPE, JSPROP_ENUMERATE}, + {"sheet", LINKSTYLE_SHEET, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // HTMLLinkElement finalizer // @@ -384,7 +403,7 @@ FinalizeHTMLLinkElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLLinkElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -394,7 +413,7 @@ EnumerateHTMLLinkElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLLinkElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -418,25 +437,6 @@ JSClass HTMLLinkElementClass = { }; -// -// HTMLLinkElement class properties -// -static JSPropertySpec HTMLLinkElementProperties[] = -{ - {"disabled", HTMLLINKELEMENT_DISABLED, JSPROP_ENUMERATE}, - {"charset", HTMLLINKELEMENT_CHARSET, JSPROP_ENUMERATE}, - {"href", HTMLLINKELEMENT_HREF, JSPROP_ENUMERATE}, - {"hreflang", HTMLLINKELEMENT_HREFLANG, JSPROP_ENUMERATE}, - {"media", HTMLLINKELEMENT_MEDIA, JSPROP_ENUMERATE}, - {"rel", HTMLLINKELEMENT_REL, JSPROP_ENUMERATE}, - {"rev", HTMLLINKELEMENT_REV, JSPROP_ENUMERATE}, - {"target", HTMLLINKELEMENT_TARGET, JSPROP_ENUMERATE}, - {"type", HTMLLINKELEMENT_TYPE, JSPROP_ENUMERATE}, - {"sheet", LINKSTYLE_SHEET, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // HTMLLinkElement class methods // diff --git a/dom/src/html/nsJSHTMLMapElement.cpp b/dom/src/html/nsJSHTMLMapElement.cpp index cbbf82e43705..c994f8589df5 100644 --- a/dom/src/html/nsJSHTMLMapElement.cpp +++ b/dom/src/html/nsJSHTMLMapElement.cpp @@ -156,6 +156,17 @@ SetHTMLMapElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLMapElement class properties +// +static JSPropertySpec HTMLMapElementProperties[] = +{ + {"areas", HTMLMAPELEMENT_AREAS, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"name", HTMLMAPELEMENT_NAME, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLMapElement finalizer // @@ -172,7 +183,7 @@ FinalizeHTMLMapElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLMapElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -182,7 +193,7 @@ EnumerateHTMLMapElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLMapElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -206,17 +217,6 @@ JSClass HTMLMapElementClass = { }; -// -// HTMLMapElement class properties -// -static JSPropertySpec HTMLMapElementProperties[] = -{ - {"areas", HTMLMAPELEMENT_AREAS, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"name", HTMLMAPELEMENT_NAME, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLMapElement class methods // diff --git a/dom/src/html/nsJSHTMLMenuElement.cpp b/dom/src/html/nsJSHTMLMenuElement.cpp index ec89cda7da66..64004ab248d3 100644 --- a/dom/src/html/nsJSHTMLMenuElement.cpp +++ b/dom/src/html/nsJSHTMLMenuElement.cpp @@ -143,6 +143,16 @@ SetHTMLMenuElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLMenuElement class properties +// +static JSPropertySpec HTMLMenuElementProperties[] = +{ + {"compact", HTMLMENUELEMENT_COMPACT, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLMenuElement finalizer // @@ -159,7 +169,7 @@ FinalizeHTMLMenuElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLMenuElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -169,7 +179,7 @@ EnumerateHTMLMenuElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLMenuElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -193,16 +203,6 @@ JSClass HTMLMenuElementClass = { }; -// -// HTMLMenuElement class properties -// -static JSPropertySpec HTMLMenuElementProperties[] = -{ - {"compact", HTMLMENUELEMENT_COMPACT, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLMenuElement class methods // diff --git a/dom/src/html/nsJSHTMLMetaElement.cpp b/dom/src/html/nsJSHTMLMetaElement.cpp index 0c97681b0021..c3cc3930ea0a 100644 --- a/dom/src/html/nsJSHTMLMetaElement.cpp +++ b/dom/src/html/nsJSHTMLMetaElement.cpp @@ -215,6 +215,19 @@ SetHTMLMetaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLMetaElement class properties +// +static JSPropertySpec HTMLMetaElementProperties[] = +{ + {"content", HTMLMETAELEMENT_CONTENT, JSPROP_ENUMERATE}, + {"httpEquiv", HTMLMETAELEMENT_HTTPEQUIV, JSPROP_ENUMERATE}, + {"name", HTMLMETAELEMENT_NAME, JSPROP_ENUMERATE}, + {"scheme", HTMLMETAELEMENT_SCHEME, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLMetaElement finalizer // @@ -231,7 +244,7 @@ FinalizeHTMLMetaElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLMetaElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -241,7 +254,7 @@ EnumerateHTMLMetaElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLMetaElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -265,19 +278,6 @@ JSClass HTMLMetaElementClass = { }; -// -// HTMLMetaElement class properties -// -static JSPropertySpec HTMLMetaElementProperties[] = -{ - {"content", HTMLMETAELEMENT_CONTENT, JSPROP_ENUMERATE}, - {"httpEquiv", HTMLMETAELEMENT_HTTPEQUIV, JSPROP_ENUMERATE}, - {"name", HTMLMETAELEMENT_NAME, JSPROP_ENUMERATE}, - {"scheme", HTMLMETAELEMENT_SCHEME, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLMetaElement class methods // diff --git a/dom/src/html/nsJSHTMLModElement.cpp b/dom/src/html/nsJSHTMLModElement.cpp index 27e63fc91f29..2c949329798a 100644 --- a/dom/src/html/nsJSHTMLModElement.cpp +++ b/dom/src/html/nsJSHTMLModElement.cpp @@ -165,6 +165,17 @@ SetHTMLModElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLModElement class properties +// +static JSPropertySpec HTMLModElementProperties[] = +{ + {"cite", HTMLMODELEMENT_CITE, JSPROP_ENUMERATE}, + {"dateTime", HTMLMODELEMENT_DATETIME, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLModElement finalizer // @@ -181,7 +192,7 @@ FinalizeHTMLModElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLModElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -191,7 +202,7 @@ EnumerateHTMLModElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLModElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -215,17 +226,6 @@ JSClass HTMLModElementClass = { }; -// -// HTMLModElement class properties -// -static JSPropertySpec HTMLModElementProperties[] = -{ - {"cite", HTMLMODELEMENT_CITE, JSPROP_ENUMERATE}, - {"dateTime", HTMLMODELEMENT_DATETIME, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLModElement class methods // diff --git a/dom/src/html/nsJSHTMLOListElement.cpp b/dom/src/html/nsJSHTMLOListElement.cpp index 006cdec74dbc..9d4f2ee92b27 100644 --- a/dom/src/html/nsJSHTMLOListElement.cpp +++ b/dom/src/html/nsJSHTMLOListElement.cpp @@ -200,6 +200,18 @@ SetHTMLOListElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLOListElement class properties +// +static JSPropertySpec HTMLOListElementProperties[] = +{ + {"compact", HTMLOLISTELEMENT_COMPACT, JSPROP_ENUMERATE}, + {"start", HTMLOLISTELEMENT_START, JSPROP_ENUMERATE}, + {"type", HTMLOLISTELEMENT_TYPE, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLOListElement finalizer // @@ -216,7 +228,7 @@ FinalizeHTMLOListElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLOListElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -226,7 +238,7 @@ EnumerateHTMLOListElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLOListElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -250,18 +262,6 @@ JSClass HTMLOListElementClass = { }; -// -// HTMLOListElement class properties -// -static JSPropertySpec HTMLOListElementProperties[] = -{ - {"compact", HTMLOLISTELEMENT_COMPACT, JSPROP_ENUMERATE}, - {"start", HTMLOLISTELEMENT_START, JSPROP_ENUMERATE}, - {"type", HTMLOLISTELEMENT_TYPE, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLOListElement class methods // diff --git a/dom/src/html/nsJSHTMLObjectElement.cpp b/dom/src/html/nsJSHTMLObjectElement.cpp index e2fb317112db..1f3785ac6dc1 100644 --- a/dom/src/html/nsJSHTMLObjectElement.cpp +++ b/dom/src/html/nsJSHTMLObjectElement.cpp @@ -599,56 +599,6 @@ SetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } -// -// HTMLObjectElement finalizer -// -PR_STATIC_CALLBACK(void) -FinalizeHTMLObjectElement(JSContext *cx, JSObject *obj) -{ - nsJSUtils::nsGenericFinalize(cx, obj); -} - - -// -// HTMLObjectElement enumerate -// -PR_STATIC_CALLBACK(JSBool) -EnumerateHTMLObjectElement(JSContext *cx, JSObject *obj) -{ - return nsJSUtils::nsGenericEnumerate(cx, obj); -} - - -// -// HTMLObjectElement resolve -// -PR_STATIC_CALLBACK(JSBool) -ResolveHTMLObjectElement(JSContext *cx, JSObject *obj, jsval id) -{ - return nsJSUtils::nsGenericResolve(cx, obj, id); -} - - -/***********************************************************************/ -// -// class for HTMLObjectElement -// -JSClass HTMLObjectElementClass = { - "HTMLObjectElement", - JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS, - JS_PropertyStub, - JS_PropertyStub, - GetHTMLObjectElementProperty, - SetHTMLObjectElementProperty, - EnumerateHTMLObjectElement, - ResolveHTMLObjectElement, - JS_ConvertStub, - FinalizeHTMLObjectElement, - nsnull, - nsJSUtils::nsCheckAccess -}; - - // // HTMLObjectElement class properties // @@ -677,6 +627,56 @@ static JSPropertySpec HTMLObjectElementProperties[] = }; +// +// HTMLObjectElement finalizer +// +PR_STATIC_CALLBACK(void) +FinalizeHTMLObjectElement(JSContext *cx, JSObject *obj) +{ + nsJSUtils::nsGenericFinalize(cx, obj); +} + + +// +// HTMLObjectElement enumerate +// +PR_STATIC_CALLBACK(JSBool) +EnumerateHTMLObjectElement(JSContext *cx, JSObject *obj) +{ + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); +} + + +// +// HTMLObjectElement resolve +// +PR_STATIC_CALLBACK(JSBool) +ResolveHTMLObjectElement(JSContext *cx, JSObject *obj, jsval id) +{ + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); +} + + +/***********************************************************************/ +// +// class for HTMLObjectElement +// +JSClass HTMLObjectElementClass = { + "HTMLObjectElement", + JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS, + JS_PropertyStub, + JS_PropertyStub, + GetHTMLObjectElementProperty, + SetHTMLObjectElementProperty, + EnumerateHTMLObjectElement, + ResolveHTMLObjectElement, + JS_ConvertStub, + FinalizeHTMLObjectElement, + nsnull, + nsJSUtils::nsCheckAccess +}; + + // // HTMLObjectElement class methods // diff --git a/dom/src/html/nsJSHTMLOptGroupElement.cpp b/dom/src/html/nsJSHTMLOptGroupElement.cpp index 0dfce5f27492..b05ad9d968e9 100644 --- a/dom/src/html/nsJSHTMLOptGroupElement.cpp +++ b/dom/src/html/nsJSHTMLOptGroupElement.cpp @@ -168,6 +168,17 @@ SetHTMLOptGroupElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp } +// +// HTMLOptGroupElement class properties +// +static JSPropertySpec HTMLOptGroupElementProperties[] = +{ + {"disabled", HTMLOPTGROUPELEMENT_DISABLED, JSPROP_ENUMERATE}, + {"label", HTMLOPTGROUPELEMENT_LABEL, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLOptGroupElement finalizer // @@ -184,7 +195,7 @@ FinalizeHTMLOptGroupElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLOptGroupElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -194,7 +205,7 @@ EnumerateHTMLOptGroupElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLOptGroupElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -218,17 +229,6 @@ JSClass HTMLOptGroupElementClass = { }; -// -// HTMLOptGroupElement class properties -// -static JSPropertySpec HTMLOptGroupElementProperties[] = -{ - {"disabled", HTMLOPTGROUPELEMENT_DISABLED, JSPROP_ENUMERATE}, - {"label", HTMLOPTGROUPELEMENT_LABEL, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLOptGroupElement class methods // diff --git a/dom/src/html/nsJSHTMLOptionElement.cpp b/dom/src/html/nsJSHTMLOptionElement.cpp index 6f38c9580cf4..481c6d96725b 100644 --- a/dom/src/html/nsJSHTMLOptionElement.cpp +++ b/dom/src/html/nsJSHTMLOptionElement.cpp @@ -309,6 +309,23 @@ SetHTMLOptionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLOptionElement class properties +// +static JSPropertySpec HTMLOptionElementProperties[] = +{ + {"form", HTMLOPTIONELEMENT_FORM, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"defaultSelected", HTMLOPTIONELEMENT_DEFAULTSELECTED, JSPROP_ENUMERATE}, + {"text", HTMLOPTIONELEMENT_TEXT, JSPROP_ENUMERATE}, + {"index", HTMLOPTIONELEMENT_INDEX, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"disabled", HTMLOPTIONELEMENT_DISABLED, JSPROP_ENUMERATE}, + {"label", HTMLOPTIONELEMENT_LABEL, JSPROP_ENUMERATE}, + {"selected", HTMLOPTIONELEMENT_SELECTED, JSPROP_ENUMERATE}, + {"value", HTMLOPTIONELEMENT_VALUE, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLOptionElement finalizer // @@ -325,7 +342,7 @@ FinalizeHTMLOptionElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLOptionElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -335,7 +352,7 @@ EnumerateHTMLOptionElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLOptionElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -359,23 +376,6 @@ JSClass HTMLOptionElementClass = { }; -// -// HTMLOptionElement class properties -// -static JSPropertySpec HTMLOptionElementProperties[] = -{ - {"form", HTMLOPTIONELEMENT_FORM, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"defaultSelected", HTMLOPTIONELEMENT_DEFAULTSELECTED, JSPROP_ENUMERATE}, - {"text", HTMLOPTIONELEMENT_TEXT, JSPROP_ENUMERATE}, - {"index", HTMLOPTIONELEMENT_INDEX, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"disabled", HTMLOPTIONELEMENT_DISABLED, JSPROP_ENUMERATE}, - {"label", HTMLOPTIONELEMENT_LABEL, JSPROP_ENUMERATE}, - {"selected", HTMLOPTIONELEMENT_SELECTED, JSPROP_ENUMERATE}, - {"value", HTMLOPTIONELEMENT_VALUE, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLOptionElement class methods // diff --git a/dom/src/html/nsJSHTMLParagraphElement.cpp b/dom/src/html/nsJSHTMLParagraphElement.cpp index 7c198a0fcfeb..7d80bd3842b9 100644 --- a/dom/src/html/nsJSHTMLParagraphElement.cpp +++ b/dom/src/html/nsJSHTMLParagraphElement.cpp @@ -140,6 +140,16 @@ SetHTMLParagraphElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v } +// +// HTMLParagraphElement class properties +// +static JSPropertySpec HTMLParagraphElementProperties[] = +{ + {"align", HTMLPARAGRAPHELEMENT_ALIGN, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLParagraphElement finalizer // @@ -156,7 +166,7 @@ FinalizeHTMLParagraphElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLParagraphElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -166,7 +176,7 @@ EnumerateHTMLParagraphElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLParagraphElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -190,16 +200,6 @@ JSClass HTMLParagraphElementClass = { }; -// -// HTMLParagraphElement class properties -// -static JSPropertySpec HTMLParagraphElementProperties[] = -{ - {"align", HTMLPARAGRAPHELEMENT_ALIGN, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLParagraphElement class methods // diff --git a/dom/src/html/nsJSHTMLParamElement.cpp b/dom/src/html/nsJSHTMLParamElement.cpp index 11b41d3239cf..e7d8fa412d74 100644 --- a/dom/src/html/nsJSHTMLParamElement.cpp +++ b/dom/src/html/nsJSHTMLParamElement.cpp @@ -215,6 +215,19 @@ SetHTMLParamElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLParamElement class properties +// +static JSPropertySpec HTMLParamElementProperties[] = +{ + {"name", HTMLPARAMELEMENT_NAME, JSPROP_ENUMERATE}, + {"type", HTMLPARAMELEMENT_TYPE, JSPROP_ENUMERATE}, + {"value", HTMLPARAMELEMENT_VALUE, JSPROP_ENUMERATE}, + {"valueType", HTMLPARAMELEMENT_VALUETYPE, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLParamElement finalizer // @@ -231,7 +244,7 @@ FinalizeHTMLParamElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLParamElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -241,7 +254,7 @@ EnumerateHTMLParamElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLParamElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -265,19 +278,6 @@ JSClass HTMLParamElementClass = { }; -// -// HTMLParamElement class properties -// -static JSPropertySpec HTMLParamElementProperties[] = -{ - {"name", HTMLPARAMELEMENT_NAME, JSPROP_ENUMERATE}, - {"type", HTMLPARAMELEMENT_TYPE, JSPROP_ENUMERATE}, - {"value", HTMLPARAMELEMENT_VALUE, JSPROP_ENUMERATE}, - {"valueType", HTMLPARAMELEMENT_VALUETYPE, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLParamElement class methods // diff --git a/dom/src/html/nsJSHTMLPreElement.cpp b/dom/src/html/nsJSHTMLPreElement.cpp index 0289aad778ac..8d6c5261b460 100644 --- a/dom/src/html/nsJSHTMLPreElement.cpp +++ b/dom/src/html/nsJSHTMLPreElement.cpp @@ -147,6 +147,16 @@ SetHTMLPreElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLPreElement class properties +// +static JSPropertySpec HTMLPreElementProperties[] = +{ + {"width", HTMLPREELEMENT_WIDTH, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLPreElement finalizer // @@ -163,7 +173,7 @@ FinalizeHTMLPreElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLPreElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -173,7 +183,7 @@ EnumerateHTMLPreElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLPreElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -197,16 +207,6 @@ JSClass HTMLPreElementClass = { }; -// -// HTMLPreElement class properties -// -static JSPropertySpec HTMLPreElementProperties[] = -{ - {"width", HTMLPREELEMENT_WIDTH, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLPreElement class methods // diff --git a/dom/src/html/nsJSHTMLQuoteElement.cpp b/dom/src/html/nsJSHTMLQuoteElement.cpp index c72325ae064e..028e1fd0ef83 100644 --- a/dom/src/html/nsJSHTMLQuoteElement.cpp +++ b/dom/src/html/nsJSHTMLQuoteElement.cpp @@ -140,6 +140,16 @@ SetHTMLQuoteElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLQuoteElement class properties +// +static JSPropertySpec HTMLQuoteElementProperties[] = +{ + {"cite", HTMLQUOTEELEMENT_CITE, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLQuoteElement finalizer // @@ -156,7 +166,7 @@ FinalizeHTMLQuoteElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLQuoteElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -166,7 +176,7 @@ EnumerateHTMLQuoteElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLQuoteElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -190,16 +200,6 @@ JSClass HTMLQuoteElementClass = { }; -// -// HTMLQuoteElement class properties -// -static JSPropertySpec HTMLQuoteElementProperties[] = -{ - {"cite", HTMLQUOTEELEMENT_CITE, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLQuoteElement class methods // diff --git a/dom/src/html/nsJSHTMLScriptElement.cpp b/dom/src/html/nsJSHTMLScriptElement.cpp index 2d0768f8dcb3..5f42bdee7d1a 100644 --- a/dom/src/html/nsJSHTMLScriptElement.cpp +++ b/dom/src/html/nsJSHTMLScriptElement.cpp @@ -293,6 +293,22 @@ SetHTMLScriptElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLScriptElement class properties +// +static JSPropertySpec HTMLScriptElementProperties[] = +{ + {"text", HTMLSCRIPTELEMENT_TEXT, JSPROP_ENUMERATE}, + {"htmlFor", HTMLSCRIPTELEMENT_HTMLFOR, JSPROP_ENUMERATE}, + {"event", HTMLSCRIPTELEMENT_EVENT, JSPROP_ENUMERATE}, + {"charset", HTMLSCRIPTELEMENT_CHARSET, JSPROP_ENUMERATE}, + {"defer", HTMLSCRIPTELEMENT_DEFER, JSPROP_ENUMERATE}, + {"src", HTMLSCRIPTELEMENT_SRC, JSPROP_ENUMERATE}, + {"type", HTMLSCRIPTELEMENT_TYPE, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLScriptElement finalizer // @@ -309,7 +325,7 @@ FinalizeHTMLScriptElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLScriptElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -319,7 +335,7 @@ EnumerateHTMLScriptElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLScriptElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -343,22 +359,6 @@ JSClass HTMLScriptElementClass = { }; -// -// HTMLScriptElement class properties -// -static JSPropertySpec HTMLScriptElementProperties[] = -{ - {"text", HTMLSCRIPTELEMENT_TEXT, JSPROP_ENUMERATE}, - {"htmlFor", HTMLSCRIPTELEMENT_HTMLFOR, JSPROP_ENUMERATE}, - {"event", HTMLSCRIPTELEMENT_EVENT, JSPROP_ENUMERATE}, - {"charset", HTMLSCRIPTELEMENT_CHARSET, JSPROP_ENUMERATE}, - {"defer", HTMLSCRIPTELEMENT_DEFER, JSPROP_ENUMERATE}, - {"src", HTMLSCRIPTELEMENT_SRC, JSPROP_ENUMERATE}, - {"type", HTMLSCRIPTELEMENT_TYPE, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLScriptElement class methods // diff --git a/dom/src/html/nsJSHTMLSelectElement.cpp b/dom/src/html/nsJSHTMLSelectElement.cpp index b70fd3c8b5df..7652397b2906 100644 --- a/dom/src/html/nsJSHTMLSelectElement.cpp +++ b/dom/src/html/nsJSHTMLSelectElement.cpp @@ -455,6 +455,26 @@ SetHTMLSelectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLSelectElement class properties +// +static JSPropertySpec HTMLSelectElementProperties[] = +{ + {"type", HTMLSELECTELEMENT_TYPE, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"selectedIndex", HTMLSELECTELEMENT_SELECTEDINDEX, JSPROP_ENUMERATE}, + {"value", HTMLSELECTELEMENT_VALUE, JSPROP_ENUMERATE}, + {"length", HTMLSELECTELEMENT_LENGTH, JSPROP_ENUMERATE}, + {"form", HTMLSELECTELEMENT_FORM, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"options", HTMLSELECTELEMENT_OPTIONS, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"disabled", HTMLSELECTELEMENT_DISABLED, JSPROP_ENUMERATE}, + {"multiple", HTMLSELECTELEMENT_MULTIPLE, JSPROP_ENUMERATE}, + {"name", HTMLSELECTELEMENT_NAME, JSPROP_ENUMERATE}, + {"size", HTMLSELECTELEMENT_SIZE, JSPROP_ENUMERATE}, + {"tabIndex", HTMLSELECTELEMENT_TABINDEX, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLSelectElement finalizer // @@ -471,7 +491,7 @@ FinalizeHTMLSelectElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLSelectElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -481,7 +501,7 @@ EnumerateHTMLSelectElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLSelectElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -769,26 +789,6 @@ JSClass HTMLSelectElementClass = { }; -// -// HTMLSelectElement class properties -// -static JSPropertySpec HTMLSelectElementProperties[] = -{ - {"type", HTMLSELECTELEMENT_TYPE, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"selectedIndex", HTMLSELECTELEMENT_SELECTEDINDEX, JSPROP_ENUMERATE}, - {"value", HTMLSELECTELEMENT_VALUE, JSPROP_ENUMERATE}, - {"length", HTMLSELECTELEMENT_LENGTH, JSPROP_ENUMERATE}, - {"form", HTMLSELECTELEMENT_FORM, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"options", HTMLSELECTELEMENT_OPTIONS, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"disabled", HTMLSELECTELEMENT_DISABLED, JSPROP_ENUMERATE}, - {"multiple", HTMLSELECTELEMENT_MULTIPLE, JSPROP_ENUMERATE}, - {"name", HTMLSELECTELEMENT_NAME, JSPROP_ENUMERATE}, - {"size", HTMLSELECTELEMENT_SIZE, JSPROP_ENUMERATE}, - {"tabIndex", HTMLSELECTELEMENT_TABINDEX, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLSelectElement class methods // diff --git a/dom/src/html/nsJSHTMLStyleElement.cpp b/dom/src/html/nsJSHTMLStyleElement.cpp index 82e05f5b5bba..553df3ecb7c7 100644 --- a/dom/src/html/nsJSHTMLStyleElement.cpp +++ b/dom/src/html/nsJSHTMLStyleElement.cpp @@ -218,6 +218,19 @@ SetHTMLStyleElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLStyleElement class properties +// +static JSPropertySpec HTMLStyleElementProperties[] = +{ + {"disabled", HTMLSTYLEELEMENT_DISABLED, JSPROP_ENUMERATE}, + {"media", HTMLSTYLEELEMENT_MEDIA, JSPROP_ENUMERATE}, + {"type", HTMLSTYLEELEMENT_TYPE, JSPROP_ENUMERATE}, + {"sheet", LINKSTYLE_SHEET, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // HTMLStyleElement finalizer // @@ -234,7 +247,7 @@ FinalizeHTMLStyleElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLStyleElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -244,7 +257,7 @@ EnumerateHTMLStyleElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLStyleElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -268,19 +281,6 @@ JSClass HTMLStyleElementClass = { }; -// -// HTMLStyleElement class properties -// -static JSPropertySpec HTMLStyleElementProperties[] = -{ - {"disabled", HTMLSTYLEELEMENT_DISABLED, JSPROP_ENUMERATE}, - {"media", HTMLSTYLEELEMENT_MEDIA, JSPROP_ENUMERATE}, - {"type", HTMLSTYLEELEMENT_TYPE, JSPROP_ENUMERATE}, - {"sheet", LINKSTYLE_SHEET, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // HTMLStyleElement class methods // diff --git a/dom/src/html/nsJSHTMLTableCaptionElement.cpp b/dom/src/html/nsJSHTMLTableCaptionElement.cpp index 8b9cb772575f..3a51d5c7bb92 100644 --- a/dom/src/html/nsJSHTMLTableCaptionElement.cpp +++ b/dom/src/html/nsJSHTMLTableCaptionElement.cpp @@ -140,6 +140,16 @@ SetHTMLTableCaptionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval } +// +// HTMLTableCaptionElement class properties +// +static JSPropertySpec HTMLTableCaptionElementProperties[] = +{ + {"align", HTMLTABLECAPTIONELEMENT_ALIGN, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLTableCaptionElement finalizer // @@ -156,7 +166,7 @@ FinalizeHTMLTableCaptionElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLTableCaptionElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -166,7 +176,7 @@ EnumerateHTMLTableCaptionElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLTableCaptionElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -190,16 +200,6 @@ JSClass HTMLTableCaptionElementClass = { }; -// -// HTMLTableCaptionElement class properties -// -static JSPropertySpec HTMLTableCaptionElementProperties[] = -{ - {"align", HTMLTABLECAPTIONELEMENT_ALIGN, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLTableCaptionElement class methods // diff --git a/dom/src/html/nsJSHTMLTableCellElement.cpp b/dom/src/html/nsJSHTMLTableCellElement.cpp index 143996aef793..762bcd1950c5 100644 --- a/dom/src/html/nsJSHTMLTableCellElement.cpp +++ b/dom/src/html/nsJSHTMLTableCellElement.cpp @@ -514,56 +514,6 @@ SetHTMLTableCellElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v } -// -// HTMLTableCellElement finalizer -// -PR_STATIC_CALLBACK(void) -FinalizeHTMLTableCellElement(JSContext *cx, JSObject *obj) -{ - nsJSUtils::nsGenericFinalize(cx, obj); -} - - -// -// HTMLTableCellElement enumerate -// -PR_STATIC_CALLBACK(JSBool) -EnumerateHTMLTableCellElement(JSContext *cx, JSObject *obj) -{ - return nsJSUtils::nsGenericEnumerate(cx, obj); -} - - -// -// HTMLTableCellElement resolve -// -PR_STATIC_CALLBACK(JSBool) -ResolveHTMLTableCellElement(JSContext *cx, JSObject *obj, jsval id) -{ - return nsJSUtils::nsGenericResolve(cx, obj, id); -} - - -/***********************************************************************/ -// -// class for HTMLTableCellElement -// -JSClass HTMLTableCellElementClass = { - "HTMLTableCellElement", - JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS, - JS_PropertyStub, - JS_PropertyStub, - GetHTMLTableCellElementProperty, - SetHTMLTableCellElementProperty, - EnumerateHTMLTableCellElement, - ResolveHTMLTableCellElement, - JS_ConvertStub, - FinalizeHTMLTableCellElement, - nsnull, - nsJSUtils::nsCheckAccess -}; - - // // HTMLTableCellElement class properties // @@ -588,6 +538,56 @@ static JSPropertySpec HTMLTableCellElementProperties[] = }; +// +// HTMLTableCellElement finalizer +// +PR_STATIC_CALLBACK(void) +FinalizeHTMLTableCellElement(JSContext *cx, JSObject *obj) +{ + nsJSUtils::nsGenericFinalize(cx, obj); +} + + +// +// HTMLTableCellElement enumerate +// +PR_STATIC_CALLBACK(JSBool) +EnumerateHTMLTableCellElement(JSContext *cx, JSObject *obj) +{ + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); +} + + +// +// HTMLTableCellElement resolve +// +PR_STATIC_CALLBACK(JSBool) +ResolveHTMLTableCellElement(JSContext *cx, JSObject *obj, jsval id) +{ + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); +} + + +/***********************************************************************/ +// +// class for HTMLTableCellElement +// +JSClass HTMLTableCellElementClass = { + "HTMLTableCellElement", + JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS, + JS_PropertyStub, + JS_PropertyStub, + GetHTMLTableCellElementProperty, + SetHTMLTableCellElementProperty, + EnumerateHTMLTableCellElement, + ResolveHTMLTableCellElement, + JS_ConvertStub, + FinalizeHTMLTableCellElement, + nsnull, + nsJSUtils::nsCheckAccess +}; + + // // HTMLTableCellElement class methods // diff --git a/dom/src/html/nsJSHTMLTableColElement.cpp b/dom/src/html/nsJSHTMLTableColElement.cpp index fd608ff4c859..869b723a5e1f 100644 --- a/dom/src/html/nsJSHTMLTableColElement.cpp +++ b/dom/src/html/nsJSHTMLTableColElement.cpp @@ -272,6 +272,21 @@ SetHTMLTableColElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp } +// +// HTMLTableColElement class properties +// +static JSPropertySpec HTMLTableColElementProperties[] = +{ + {"align", HTMLTABLECOLELEMENT_ALIGN, JSPROP_ENUMERATE}, + {"ch", HTMLTABLECOLELEMENT_CH, JSPROP_ENUMERATE}, + {"chOff", HTMLTABLECOLELEMENT_CHOFF, JSPROP_ENUMERATE}, + {"span", HTMLTABLECOLELEMENT_SPAN, JSPROP_ENUMERATE}, + {"vAlign", HTMLTABLECOLELEMENT_VALIGN, JSPROP_ENUMERATE}, + {"width", HTMLTABLECOLELEMENT_WIDTH, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLTableColElement finalizer // @@ -288,7 +303,7 @@ FinalizeHTMLTableColElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLTableColElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -298,7 +313,7 @@ EnumerateHTMLTableColElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLTableColElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -322,21 +337,6 @@ JSClass HTMLTableColElementClass = { }; -// -// HTMLTableColElement class properties -// -static JSPropertySpec HTMLTableColElementProperties[] = -{ - {"align", HTMLTABLECOLELEMENT_ALIGN, JSPROP_ENUMERATE}, - {"ch", HTMLTABLECOLELEMENT_CH, JSPROP_ENUMERATE}, - {"chOff", HTMLTABLECOLELEMENT_CHOFF, JSPROP_ENUMERATE}, - {"span", HTMLTABLECOLELEMENT_SPAN, JSPROP_ENUMERATE}, - {"vAlign", HTMLTABLECOLELEMENT_VALIGN, JSPROP_ENUMERATE}, - {"width", HTMLTABLECOLELEMENT_WIDTH, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLTableColElement class methods // diff --git a/dom/src/html/nsJSHTMLTableElement.cpp b/dom/src/html/nsJSHTMLTableElement.cpp index b3a9889c3e89..b74e392d1434 100644 --- a/dom/src/html/nsJSHTMLTableElement.cpp +++ b/dom/src/html/nsJSHTMLTableElement.cpp @@ -469,6 +469,29 @@ SetHTMLTableElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLTableElement class properties +// +static JSPropertySpec HTMLTableElementProperties[] = +{ + {"caption", HTMLTABLEELEMENT_CAPTION, JSPROP_ENUMERATE}, + {"tHead", HTMLTABLEELEMENT_THEAD, JSPROP_ENUMERATE}, + {"tFoot", HTMLTABLEELEMENT_TFOOT, JSPROP_ENUMERATE}, + {"rows", HTMLTABLEELEMENT_ROWS, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"tBodies", HTMLTABLEELEMENT_TBODIES, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"align", HTMLTABLEELEMENT_ALIGN, JSPROP_ENUMERATE}, + {"bgColor", HTMLTABLEELEMENT_BGCOLOR, JSPROP_ENUMERATE}, + {"border", HTMLTABLEELEMENT_BORDER, JSPROP_ENUMERATE}, + {"cellPadding", HTMLTABLEELEMENT_CELLPADDING, JSPROP_ENUMERATE}, + {"cellSpacing", HTMLTABLEELEMENT_CELLSPACING, JSPROP_ENUMERATE}, + {"frame", HTMLTABLEELEMENT_FRAME, JSPROP_ENUMERATE}, + {"rules", HTMLTABLEELEMENT_RULES, JSPROP_ENUMERATE}, + {"summary", HTMLTABLEELEMENT_SUMMARY, JSPROP_ENUMERATE}, + {"width", HTMLTABLEELEMENT_WIDTH, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLTableElement finalizer // @@ -485,7 +508,7 @@ FinalizeHTMLTableElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLTableElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -495,7 +518,7 @@ EnumerateHTMLTableElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLTableElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -819,29 +842,6 @@ JSClass HTMLTableElementClass = { }; -// -// HTMLTableElement class properties -// -static JSPropertySpec HTMLTableElementProperties[] = -{ - {"caption", HTMLTABLEELEMENT_CAPTION, JSPROP_ENUMERATE}, - {"tHead", HTMLTABLEELEMENT_THEAD, JSPROP_ENUMERATE}, - {"tFoot", HTMLTABLEELEMENT_TFOOT, JSPROP_ENUMERATE}, - {"rows", HTMLTABLEELEMENT_ROWS, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"tBodies", HTMLTABLEELEMENT_TBODIES, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"align", HTMLTABLEELEMENT_ALIGN, JSPROP_ENUMERATE}, - {"bgColor", HTMLTABLEELEMENT_BGCOLOR, JSPROP_ENUMERATE}, - {"border", HTMLTABLEELEMENT_BORDER, JSPROP_ENUMERATE}, - {"cellPadding", HTMLTABLEELEMENT_CELLPADDING, JSPROP_ENUMERATE}, - {"cellSpacing", HTMLTABLEELEMENT_CELLSPACING, JSPROP_ENUMERATE}, - {"frame", HTMLTABLEELEMENT_FRAME, JSPROP_ENUMERATE}, - {"rules", HTMLTABLEELEMENT_RULES, JSPROP_ENUMERATE}, - {"summary", HTMLTABLEELEMENT_SUMMARY, JSPROP_ENUMERATE}, - {"width", HTMLTABLEELEMENT_WIDTH, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLTableElement class methods // diff --git a/dom/src/html/nsJSHTMLTableRowElement.cpp b/dom/src/html/nsJSHTMLTableRowElement.cpp index 8a29091e33bf..e18ddf8c816c 100644 --- a/dom/src/html/nsJSHTMLTableRowElement.cpp +++ b/dom/src/html/nsJSHTMLTableRowElement.cpp @@ -339,6 +339,23 @@ SetHTMLTableRowElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp } +// +// HTMLTableRowElement class properties +// +static JSPropertySpec HTMLTableRowElementProperties[] = +{ + {"rowIndex", HTMLTABLEROWELEMENT_ROWINDEX, JSPROP_ENUMERATE}, + {"sectionRowIndex", HTMLTABLEROWELEMENT_SECTIONROWINDEX, JSPROP_ENUMERATE}, + {"cells", HTMLTABLEROWELEMENT_CELLS, JSPROP_ENUMERATE}, + {"align", HTMLTABLEROWELEMENT_ALIGN, JSPROP_ENUMERATE}, + {"bgColor", HTMLTABLEROWELEMENT_BGCOLOR, JSPROP_ENUMERATE}, + {"ch", HTMLTABLEROWELEMENT_CH, JSPROP_ENUMERATE}, + {"chOff", HTMLTABLEROWELEMENT_CHOFF, JSPROP_ENUMERATE}, + {"vAlign", HTMLTABLEROWELEMENT_VALIGN, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLTableRowElement finalizer // @@ -355,7 +372,7 @@ FinalizeHTMLTableRowElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLTableRowElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -365,7 +382,7 @@ EnumerateHTMLTableRowElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLTableRowElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -476,23 +493,6 @@ JSClass HTMLTableRowElementClass = { }; -// -// HTMLTableRowElement class properties -// -static JSPropertySpec HTMLTableRowElementProperties[] = -{ - {"rowIndex", HTMLTABLEROWELEMENT_ROWINDEX, JSPROP_ENUMERATE}, - {"sectionRowIndex", HTMLTABLEROWELEMENT_SECTIONROWINDEX, JSPROP_ENUMERATE}, - {"cells", HTMLTABLEROWELEMENT_CELLS, JSPROP_ENUMERATE}, - {"align", HTMLTABLEROWELEMENT_ALIGN, JSPROP_ENUMERATE}, - {"bgColor", HTMLTABLEROWELEMENT_BGCOLOR, JSPROP_ENUMERATE}, - {"ch", HTMLTABLEROWELEMENT_CH, JSPROP_ENUMERATE}, - {"chOff", HTMLTABLEROWELEMENT_CHOFF, JSPROP_ENUMERATE}, - {"vAlign", HTMLTABLEROWELEMENT_VALIGN, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLTableRowElement class methods // diff --git a/dom/src/html/nsJSHTMLTableSectionElement.cpp b/dom/src/html/nsJSHTMLTableSectionElement.cpp index 47e7fde32273..c2c6a7ec14df 100644 --- a/dom/src/html/nsJSHTMLTableSectionElement.cpp +++ b/dom/src/html/nsJSHTMLTableSectionElement.cpp @@ -233,6 +233,20 @@ SetHTMLTableSectionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval } +// +// HTMLTableSectionElement class properties +// +static JSPropertySpec HTMLTableSectionElementProperties[] = +{ + {"align", HTMLTABLESECTIONELEMENT_ALIGN, JSPROP_ENUMERATE}, + {"ch", HTMLTABLESECTIONELEMENT_CH, JSPROP_ENUMERATE}, + {"chOff", HTMLTABLESECTIONELEMENT_CHOFF, JSPROP_ENUMERATE}, + {"vAlign", HTMLTABLESECTIONELEMENT_VALIGN, JSPROP_ENUMERATE}, + {"rows", HTMLTABLESECTIONELEMENT_ROWS, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // HTMLTableSectionElement finalizer // @@ -249,7 +263,7 @@ FinalizeHTMLTableSectionElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLTableSectionElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -259,7 +273,7 @@ EnumerateHTMLTableSectionElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLTableSectionElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -370,20 +384,6 @@ JSClass HTMLTableSectionElementClass = { }; -// -// HTMLTableSectionElement class properties -// -static JSPropertySpec HTMLTableSectionElementProperties[] = -{ - {"align", HTMLTABLESECTIONELEMENT_ALIGN, JSPROP_ENUMERATE}, - {"ch", HTMLTABLESECTIONELEMENT_CH, JSPROP_ENUMERATE}, - {"chOff", HTMLTABLESECTIONELEMENT_CHOFF, JSPROP_ENUMERATE}, - {"vAlign", HTMLTABLESECTIONELEMENT_VALIGN, JSPROP_ENUMERATE}, - {"rows", HTMLTABLESECTIONELEMENT_ROWS, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // HTMLTableSectionElement class methods // diff --git a/dom/src/html/nsJSHTMLTextAreaElement.cpp b/dom/src/html/nsJSHTMLTextAreaElement.cpp index a22bdc7e4ae5..7aee13824869 100644 --- a/dom/src/html/nsJSHTMLTextAreaElement.cpp +++ b/dom/src/html/nsJSHTMLTextAreaElement.cpp @@ -421,6 +421,27 @@ SetHTMLTextAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp } +// +// HTMLTextAreaElement class properties +// +static JSPropertySpec HTMLTextAreaElementProperties[] = +{ + {"defaultValue", HTMLTEXTAREAELEMENT_DEFAULTVALUE, JSPROP_ENUMERATE}, + {"form", HTMLTEXTAREAELEMENT_FORM, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"accessKey", HTMLTEXTAREAELEMENT_ACCESSKEY, JSPROP_ENUMERATE}, + {"cols", HTMLTEXTAREAELEMENT_COLS, JSPROP_ENUMERATE}, + {"disabled", HTMLTEXTAREAELEMENT_DISABLED, JSPROP_ENUMERATE}, + {"name", HTMLTEXTAREAELEMENT_NAME, JSPROP_ENUMERATE}, + {"readOnly", HTMLTEXTAREAELEMENT_READONLY, JSPROP_ENUMERATE}, + {"rows", HTMLTEXTAREAELEMENT_ROWS, JSPROP_ENUMERATE}, + {"tabIndex", HTMLTEXTAREAELEMENT_TABINDEX, JSPROP_ENUMERATE}, + {"type", HTMLTEXTAREAELEMENT_TYPE, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"value", HTMLTEXTAREAELEMENT_VALUE, JSPROP_ENUMERATE}, + {"controllers", NSHTMLTEXTAREAELEMENT_CONTROLLERS, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // HTMLTextAreaElement finalizer // @@ -437,7 +458,7 @@ FinalizeHTMLTextAreaElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLTextAreaElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -447,7 +468,7 @@ EnumerateHTMLTextAreaElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLTextAreaElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -576,27 +597,6 @@ JSClass HTMLTextAreaElementClass = { }; -// -// HTMLTextAreaElement class properties -// -static JSPropertySpec HTMLTextAreaElementProperties[] = -{ - {"defaultValue", HTMLTEXTAREAELEMENT_DEFAULTVALUE, JSPROP_ENUMERATE}, - {"form", HTMLTEXTAREAELEMENT_FORM, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"accessKey", HTMLTEXTAREAELEMENT_ACCESSKEY, JSPROP_ENUMERATE}, - {"cols", HTMLTEXTAREAELEMENT_COLS, JSPROP_ENUMERATE}, - {"disabled", HTMLTEXTAREAELEMENT_DISABLED, JSPROP_ENUMERATE}, - {"name", HTMLTEXTAREAELEMENT_NAME, JSPROP_ENUMERATE}, - {"readOnly", HTMLTEXTAREAELEMENT_READONLY, JSPROP_ENUMERATE}, - {"rows", HTMLTEXTAREAELEMENT_ROWS, JSPROP_ENUMERATE}, - {"tabIndex", HTMLTEXTAREAELEMENT_TABINDEX, JSPROP_ENUMERATE}, - {"type", HTMLTEXTAREAELEMENT_TYPE, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"value", HTMLTEXTAREAELEMENT_VALUE, JSPROP_ENUMERATE}, - {"controllers", NSHTMLTEXTAREAELEMENT_CONTROLLERS, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // HTMLTextAreaElement class methods // diff --git a/dom/src/html/nsJSHTMLTitleElement.cpp b/dom/src/html/nsJSHTMLTitleElement.cpp index 943730ef87f9..e4757dba624e 100644 --- a/dom/src/html/nsJSHTMLTitleElement.cpp +++ b/dom/src/html/nsJSHTMLTitleElement.cpp @@ -140,6 +140,16 @@ SetHTMLTitleElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLTitleElement class properties +// +static JSPropertySpec HTMLTitleElementProperties[] = +{ + {"text", HTMLTITLEELEMENT_TEXT, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLTitleElement finalizer // @@ -156,7 +166,7 @@ FinalizeHTMLTitleElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLTitleElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -166,7 +176,7 @@ EnumerateHTMLTitleElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLTitleElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -190,16 +200,6 @@ JSClass HTMLTitleElementClass = { }; -// -// HTMLTitleElement class properties -// -static JSPropertySpec HTMLTitleElementProperties[] = -{ - {"text", HTMLTITLEELEMENT_TEXT, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLTitleElement class methods // diff --git a/dom/src/html/nsJSHTMLUListElement.cpp b/dom/src/html/nsJSHTMLUListElement.cpp index 36c424865495..0e1962c34a8c 100644 --- a/dom/src/html/nsJSHTMLUListElement.cpp +++ b/dom/src/html/nsJSHTMLUListElement.cpp @@ -168,6 +168,17 @@ SetHTMLUListElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// HTMLUListElement class properties +// +static JSPropertySpec HTMLUListElementProperties[] = +{ + {"compact", HTMLULISTELEMENT_COMPACT, JSPROP_ENUMERATE}, + {"type", HTMLULISTELEMENT_TYPE, JSPROP_ENUMERATE}, + {0} +}; + + // // HTMLUListElement finalizer // @@ -184,7 +195,7 @@ FinalizeHTMLUListElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateHTMLUListElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -194,7 +205,7 @@ EnumerateHTMLUListElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveHTMLUListElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -218,17 +229,6 @@ JSClass HTMLUListElementClass = { }; -// -// HTMLUListElement class properties -// -static JSPropertySpec HTMLUListElementProperties[] = -{ - {"compact", HTMLULISTELEMENT_COMPACT, JSPROP_ENUMERATE}, - {"type", HTMLULISTELEMENT_TYPE, JSPROP_ENUMERATE}, - {0} -}; - - // // HTMLUListElement class methods // diff --git a/dom/src/html/nsJSNSHTMLOptionCollection.cpp b/dom/src/html/nsJSNSHTMLOptionCollection.cpp index bfcd0d31e217..119e21e36125 100755 --- a/dom/src/html/nsJSNSHTMLOptionCollection.cpp +++ b/dom/src/html/nsJSNSHTMLOptionCollection.cpp @@ -223,6 +223,17 @@ SetNSHTMLOptionCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval } +// +// NSHTMLOptionCollection class properties +// +static JSPropertySpec NSHTMLOptionCollectionProperties[] = +{ + {"length", NSHTMLOPTIONCOLLECTION_LENGTH, JSPROP_ENUMERATE}, + {"selectedIndex", NSHTMLOPTIONCOLLECTION_SELECTEDINDEX, JSPROP_ENUMERATE}, + {0} +}; + + // // NSHTMLOptionCollection finalizer // @@ -239,7 +250,7 @@ FinalizeNSHTMLOptionCollection(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateNSHTMLOptionCollection(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -249,7 +260,7 @@ EnumerateNSHTMLOptionCollection(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveNSHTMLOptionCollection(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -359,17 +370,6 @@ JSClass NSHTMLOptionCollectionClass = { }; -// -// NSHTMLOptionCollection class properties -// -static JSPropertySpec NSHTMLOptionCollectionProperties[] = -{ - {"length", NSHTMLOPTIONCOLLECTION_LENGTH, JSPROP_ENUMERATE}, - {"selectedIndex", NSHTMLOPTIONCOLLECTION_SELECTEDINDEX, JSPROP_ENUMERATE}, - {0} -}; - - // // NSHTMLOptionCollection class methods // diff --git a/dom/src/range/nsJSRange.cpp b/dom/src/range/nsJSRange.cpp index 319a4a1f4d4b..6561ed86cd13 100644 --- a/dom/src/range/nsJSRange.cpp +++ b/dom/src/range/nsJSRange.cpp @@ -203,6 +203,21 @@ SetRangeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// Range class properties +// +static JSPropertySpec RangeProperties[] = +{ + {"startContainer", RANGE_STARTCONTAINER, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"startOffset", RANGE_STARTOFFSET, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"endContainer", RANGE_ENDCONTAINER, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"endOffset", RANGE_ENDOFFSET, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"collapsed", RANGE_COLLAPSED, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"commonAncestorContainer", RANGE_COMMONANCESTORCONTAINER, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // Range finalizer // @@ -219,7 +234,7 @@ FinalizeRange(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateRange(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -229,7 +244,7 @@ EnumerateRange(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveRange(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -1354,21 +1369,6 @@ JSClass RangeClass = { }; -// -// Range class properties -// -static JSPropertySpec RangeProperties[] = -{ - {"startContainer", RANGE_STARTCONTAINER, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"startOffset", RANGE_STARTOFFSET, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"endContainer", RANGE_ENDCONTAINER, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"endOffset", RANGE_ENDOFFSET, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"collapsed", RANGE_COLLAPSED, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"commonAncestorContainer", RANGE_COMMONANCESTORCONTAINER, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // Range class methods // diff --git a/dom/src/xul/nsJSXULCommandDispatcher.cpp b/dom/src/xul/nsJSXULCommandDispatcher.cpp index 9af682b8a0fc..529c38462b19 100644 --- a/dom/src/xul/nsJSXULCommandDispatcher.cpp +++ b/dom/src/xul/nsJSXULCommandDispatcher.cpp @@ -269,6 +269,20 @@ SetXULCommandDispatcherProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v } +// +// XULCommandDispatcher class properties +// +static JSPropertySpec XULCommandDispatcherProperties[] = +{ + {"focusedElement", XULCOMMANDDISPATCHER_FOCUSEDELEMENT, JSPROP_ENUMERATE}, + {"focusedWindow", XULCOMMANDDISPATCHER_FOCUSEDWINDOW, JSPROP_ENUMERATE}, + {"suppressFocus", XULCOMMANDDISPATCHER_SUPPRESSFOCUS, JSPROP_ENUMERATE}, + {"suppressFocusScroll", XULCOMMANDDISPATCHER_SUPPRESSFOCUSSCROLL, JSPROP_ENUMERATE}, + {"active", XULCOMMANDDISPATCHER_ACTIVE, JSPROP_ENUMERATE}, + {0} +}; + + // // XULCommandDispatcher finalizer // @@ -285,7 +299,7 @@ FinalizeXULCommandDispatcher(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateXULCommandDispatcher(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -295,7 +309,7 @@ EnumerateXULCommandDispatcher(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveXULCommandDispatcher(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -538,20 +552,6 @@ JSClass XULCommandDispatcherClass = { }; -// -// XULCommandDispatcher class properties -// -static JSPropertySpec XULCommandDispatcherProperties[] = -{ - {"focusedElement", XULCOMMANDDISPATCHER_FOCUSEDELEMENT, JSPROP_ENUMERATE}, - {"focusedWindow", XULCOMMANDDISPATCHER_FOCUSEDWINDOW, JSPROP_ENUMERATE}, - {"suppressFocus", XULCOMMANDDISPATCHER_SUPPRESSFOCUS, JSPROP_ENUMERATE}, - {"suppressFocusScroll", XULCOMMANDDISPATCHER_SUPPRESSFOCUSSCROLL, JSPROP_ENUMERATE}, - {"active", XULCOMMANDDISPATCHER_ACTIVE, JSPROP_ENUMERATE}, - {0} -}; - - // // XULCommandDispatcher class methods // diff --git a/dom/src/xul/nsJSXULDocument.cpp b/dom/src/xul/nsJSXULDocument.cpp index 678a112e5c01..da265c210b93 100644 --- a/dom/src/xul/nsJSXULDocument.cpp +++ b/dom/src/xul/nsJSXULDocument.cpp @@ -239,6 +239,21 @@ SetXULDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// XULDocument class properties +// +static JSPropertySpec XULDocumentProperties[] = +{ + {"popupNode", XULDOCUMENT_POPUPNODE, JSPROP_ENUMERATE}, + {"tooltipNode", XULDOCUMENT_TOOLTIPNODE, JSPROP_ENUMERATE}, + {"commandDispatcher", XULDOCUMENT_COMMANDDISPATCHER, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"width", XULDOCUMENT_WIDTH, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"height", XULDOCUMENT_HEIGHT, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"controls", XULDOCUMENT_CONTROLS, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // XULDocument finalizer // @@ -255,7 +270,7 @@ FinalizeXULDocument(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateXULDocument(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -265,7 +280,7 @@ EnumerateXULDocument(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveXULDocument(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -376,21 +391,6 @@ JSClass XULDocumentClass = { }; -// -// XULDocument class properties -// -static JSPropertySpec XULDocumentProperties[] = -{ - {"popupNode", XULDOCUMENT_POPUPNODE, JSPROP_ENUMERATE}, - {"tooltipNode", XULDOCUMENT_TOOLTIPNODE, JSPROP_ENUMERATE}, - {"commandDispatcher", XULDOCUMENT_COMMANDDISPATCHER, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"width", XULDOCUMENT_WIDTH, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"height", XULDOCUMENT_HEIGHT, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"controls", XULDOCUMENT_CONTROLS, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // XULDocument class methods // diff --git a/dom/src/xul/nsJSXULElement.cpp b/dom/src/xul/nsJSXULElement.cpp index c8a6a239d518..92403296891a 100644 --- a/dom/src/xul/nsJSXULElement.cpp +++ b/dom/src/xul/nsJSXULElement.cpp @@ -265,6 +265,23 @@ SetXULElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// XULElement class properties +// +static JSPropertySpec XULElementProperties[] = +{ + {"id", XULELEMENT_ID, JSPROP_ENUMERATE}, + {"className", XULELEMENT_CLASSNAME, JSPROP_ENUMERATE}, + {"style", XULELEMENT_STYLE, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"database", XULELEMENT_DATABASE, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"builder", XULELEMENT_BUILDER, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"resource", XULELEMENT_RESOURCE, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"controllers", XULELEMENT_CONTROLLERS, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"boxObject", XULELEMENT_BOXOBJECT, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // XULElement finalizer // @@ -281,7 +298,7 @@ FinalizeXULElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateXULElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -291,7 +308,7 @@ EnumerateXULElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveXULElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -597,23 +614,6 @@ JSClass XULElementClass = { }; -// -// XULElement class properties -// -static JSPropertySpec XULElementProperties[] = -{ - {"id", XULELEMENT_ID, JSPROP_ENUMERATE}, - {"className", XULELEMENT_CLASSNAME, JSPROP_ENUMERATE}, - {"style", XULELEMENT_STYLE, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"database", XULELEMENT_DATABASE, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"builder", XULELEMENT_BUILDER, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"resource", XULELEMENT_RESOURCE, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"controllers", XULELEMENT_CONTROLLERS, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"boxObject", XULELEMENT_BOXOBJECT, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // XULElement class methods // diff --git a/dom/src/xul/nsJSXULTreeElement.cpp b/dom/src/xul/nsJSXULTreeElement.cpp index 7e8149fbed53..c7278935a283 100644 --- a/dom/src/xul/nsJSXULTreeElement.cpp +++ b/dom/src/xul/nsJSXULTreeElement.cpp @@ -192,6 +192,18 @@ SetXULTreeElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// XULTreeElement class properties +// +static JSPropertySpec XULTreeElementProperties[] = +{ + {"selectedItems", XULTREEELEMENT_SELECTEDITEMS, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"currentItem", XULTREEELEMENT_CURRENTITEM, JSPROP_ENUMERATE}, + {"suppressOnSelect", XULTREEELEMENT_SUPPRESSONSELECT, JSPROP_ENUMERATE}, + {0} +}; + + // // XULTreeElement finalizer // @@ -208,7 +220,7 @@ FinalizeXULTreeElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateXULTreeElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -218,7 +230,7 @@ EnumerateXULTreeElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveXULTreeElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -641,18 +653,6 @@ JSClass XULTreeElementClass = { }; -// -// XULTreeElement class properties -// -static JSPropertySpec XULTreeElementProperties[] = -{ - {"selectedItems", XULTREEELEMENT_SELECTEDITEMS, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"currentItem", XULTREEELEMENT_CURRENTITEM, JSPROP_ENUMERATE}, - {"suppressOnSelect", XULTREEELEMENT_SUPPRESSONSELECT, JSPROP_ENUMERATE}, - {0} -}; - - // // XULTreeElement class methods // diff --git a/dom/tools/JSStubGen.cpp b/dom/tools/JSStubGen.cpp index 3cee998f4d7f..7f792157d2ff 100644 --- a/dom/tools/JSStubGen.cpp +++ b/dom/tools/JSStubGen.cpp @@ -81,12 +81,12 @@ JSStubGen::Generate(char *aFileName, GeneratePropertyFunc(aSpec, PR_TRUE); GeneratePropertyFunc(aSpec, PR_FALSE); GenerateCustomPropertyFuncs(aSpec); + GenerateClassProperties(aSpec); GenerateFinalize(aSpec); GenerateEnumerate(aSpec); GenerateResolve(aSpec); GenerateMethods(aSpec); GenerateJSClass(aSpec); - GenerateClassProperties(aSpec); GenerateClassFunctions(aSpec); GenerateConstructor(aSpec); GenerateInitClass(aSpec); @@ -273,7 +273,7 @@ JSStubGen::GeneratePropertySlots(IdlSpecification &aSpec) IdlAttribute *attr = iface->GetAttributeAt(a); char attr_name[128]; - if (attr->GetIsNoScript()) { + if (attr->GetIsNoScript() || attr->GetReplaceable()) { continue; } @@ -1190,6 +1190,28 @@ JSStubGen::GenerateCustomPropertyFuncs(IdlSpecification &aSpec) } +static int HasReplaceableAttrs(IdlSpecification &aSpec) +{ + int i, icount = aSpec.InterfaceCount(); + for (i = 0; i < icount; i++) { + IdlInterface *iface = aSpec.GetInterfaceAt(i); + + int a, acount = iface->AttributeCount(); + + for (a = 0; a < acount; a++) { + IdlAttribute *attr = iface->GetAttributeAt(a); + + if (attr->GetReplaceable()) { + return 1; + } + } + } + + + return 0; +} + + static const char kFinalizeStr[] = "\n\n//\n" "// %s finalizer\n" @@ -1219,12 +1241,9 @@ static const char kEnumerateStr[] = "PR_STATIC_CALLBACK(JSBool)\n" "Enumerate%s(JSContext *cx, JSObject *obj)\n" "{\n" -" return nsJSUtils::nsGenericEnumerate(cx, obj);\n" +" return nsJSUtils::nsGenericEnumerate(cx, obj, %s);\n" "}\n"; -#define JSGEN_GENERATE_ENUMERATE(buf, className) \ - sprintf(buf, kEnumerateStr, className, className); - void JSStubGen::GenerateEnumerate(IdlSpecification &aSpec) { @@ -1233,26 +1252,35 @@ JSStubGen::GenerateEnumerate(IdlSpecification &aSpec) IdlInterface *iface = aSpec.GetInterfaceAt(0); char *name = iface->GetName(); - JSGEN_GENERATE_ENUMERATE(buf, name); + char tmpbuf[512]; + + if (HasReplaceableAttrs(aSpec)) { + sprintf(tmpbuf, "%sReplaceableProperties", name); + } else { + sprintf(tmpbuf, "nsnull"); + } + + sprintf(buf, kEnumerateStr, name, name, tmpbuf); + *file << buf; } -static const char kResolveStr[] = +static const char kResolveStrStart[] = "\n\n//\n" "// %s resolve\n" "//\n" "PR_STATIC_CALLBACK(JSBool)\n" "Resolve%s(JSContext *cx, JSObject *obj, jsval id)\n" -"{\n" -"%s" -"}\n"; +"{\n"; + +static const char kResolveStrEnd[] = "}\n"; static const char* kGenericResolveStr = -" return nsJSUtils::nsGenericResolve(cx, obj, id);\n"; +" return nsJSUtils::nsGenericResolve(cx, obj, id, %s);\n"; static const char* kGlobalResolveStr = -" return nsJSUtils::nsGlobalResolve(cx, obj, id);\n"; +" return nsJSUtils::nsGlobalResolve(cx, obj, id, %s);\n"; #define JSGEN_GENERATE_RESOLVE(buf, className, str) \ sprintf(buf, kResolveStr, className, className, str); @@ -1265,12 +1293,31 @@ JSStubGen::GenerateResolve(IdlSpecification &aSpec) IdlInterface *iface = aSpec.GetInterfaceAt(0); char *name = iface->GetName(); + sprintf(buf, kResolveStrStart, name, name); + + *file << buf; + + int hasreplaceable = HasReplaceableAttrs(aSpec); + + char tmpbuf[512]; + + if (HasReplaceableAttrs(aSpec)) { + sprintf(tmpbuf, "%sReplaceableProperties", name); + } else { + sprintf(tmpbuf, "nsnull"); + } + if (mIsGlobal) { - JSGEN_GENERATE_RESOLVE(buf, name, kGlobalResolveStr); + sprintf(buf, kGlobalResolveStr, tmpbuf); } else { - JSGEN_GENERATE_RESOLVE(buf, name, kGenericResolveStr); + sprintf(buf, kGenericResolveStr, tmpbuf); } + + *file << buf; + + sprintf(buf, kResolveStrEnd, name); + *file << buf; } @@ -1737,12 +1784,19 @@ static const char kPropSpecEntryStr[] = static const char kPropSpecReadOnlyStr[] = " | JSPROP_READONLY"; static const char kPropSpecEntryReplaceableStr[] = -" {\"%s\", %s_%s, JSPROP_ENUMERATE, %s%sGetter, %s%sSetter},\n"; +" {\"%s\", 0, JSPROP_ENUMERATE, %s%sGetter, %s%sSetter},\n"; static const char kPropSpecEndStr[] = " {0}\n" "};\n"; +static const char kReplaceablePropSpecBeginStr[] = +"\n\n//\n" +"// %s class replaceable properties\n" +"//\n" +"static JSPropertySpec %sReplaceableProperties[] =\n" +"{\n"; + void JSStubGen::GenerateClassProperties(IdlSpecification &aSpec) { @@ -1766,28 +1820,54 @@ JSStubGen::GenerateClassProperties(IdlSpecification &aSpec) IdlAttribute *attr = iface->GetAttributeAt(a); char attr_name[128]; - if (attr->GetIsNoScript()) { + if (attr->GetIsNoScript() || attr->GetReplaceable()) { continue; } strcpy(attr_name, attr->GetName()); StrUpr(attr_name); - if (attr->GetReplaceable()) { - sprintf(buf, kPropSpecEntryReplaceableStr, attr->GetName(), - iface_name, attr_name, iface->GetName(), attr->GetName(), - iface->GetName(), attr->GetName()); - } - else { - sprintf(buf, kPropSpecEntryStr, attr->GetName(), - iface_name, attr_name, - attr->GetReadOnly() ? kPropSpecReadOnlyStr : ""); - } + sprintf(buf, kPropSpecEntryStr, attr->GetName(), + iface_name, attr_name, + attr->GetReadOnly() ? kPropSpecReadOnlyStr : ""); + *file << buf; } } *file << kPropSpecEndStr; + + if (HasReplaceableAttrs(aSpec)) { + sprintf(buf, kReplaceablePropSpecBeginStr, primary_iface->GetName(), + primary_iface->GetName()); + *file << buf; + + icount = aSpec.InterfaceCount(); + for (i = 0; i < icount; i++) { + IdlInterface *iface = aSpec.GetInterfaceAt(i); + + int a, acount = iface->AttributeCount(); + for (a = 0; a < acount; a++) { + IdlAttribute *attr = iface->GetAttributeAt(a); + char attr_name[128]; + + if (attr->GetIsNoScript() || !attr->GetReplaceable()) { + continue; + } + + strcpy(attr_name, attr->GetName()); + StrUpr(attr_name); + + sprintf(buf, kPropSpecEntryReplaceableStr, attr->GetName(), + iface->GetName(), attr->GetName(), + iface->GetName(), attr->GetName()); + + *file << buf; + } + } + + *file << kPropSpecEndStr; + } } diff --git a/layout/base/src/nsDocument.cpp b/layout/base/src/nsDocument.cpp index bb08ff330ad1..c8597f67ec83 100644 --- a/layout/base/src/nsDocument.cpp +++ b/layout/base/src/nsDocument.cpp @@ -3280,8 +3280,11 @@ PRBool nsDocument::EnumerateProperty(JSContext *aContext, JSObject *aObj) return PR_TRUE; } -PRBool nsDocument::Resolve(JSContext *aContext, JSObject *aObj, jsval aID) +PRBool nsDocument::Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty) { + *aDidDefineProperty = PR_FALSE; + return PR_TRUE; } diff --git a/layout/base/src/nsDocument.h b/layout/base/src/nsDocument.h index e50e6f5efaae..1326212d7b7e 100644 --- a/layout/base/src/nsDocument.h +++ b/layout/base/src/nsDocument.h @@ -462,7 +462,8 @@ public: virtual PRBool SetProperty(JSContext *aContext, JSObject *aObj, jsval aID, jsval *aVp); virtual PRBool EnumerateProperty(JSContext *aContext, JSObject *aObj); - virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID); + virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty); virtual PRBool Convert(JSContext *aContext, JSObject *aObj, jsval aID); virtual void Finalize(JSContext *aContext, JSObject *aObj); diff --git a/layout/base/src/nsGenericElement.cpp b/layout/base/src/nsGenericElement.cpp index b8cf5eaf6c42..07a998f01c0a 100644 --- a/layout/base/src/nsGenericElement.cpp +++ b/layout/base/src/nsGenericElement.cpp @@ -1873,8 +1873,11 @@ nsGenericElement::EnumerateProperty(JSContext *aContext, JSObject *aObj) } PRBool -nsGenericElement::Resolve(JSContext *aContext, JSObject *aObj, jsval aID) +nsGenericElement::Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool* aDidDefineProperty) { + *aDidDefineProperty = PR_FALSE; + return PR_TRUE; } diff --git a/layout/base/src/nsGenericElement.h b/layout/base/src/nsGenericElement.h index a1f784e5f569..80ff4e99e269 100644 --- a/layout/base/src/nsGenericElement.h +++ b/layout/base/src/nsGenericElement.h @@ -224,7 +224,8 @@ public: PRBool SetProperty(JSContext *aContext, JSObject *aObj, jsval aID, jsval *aVp); PRBool EnumerateProperty(JSContext *aContext, JSObject *aObj); - PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID); + PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty); PRBool Convert(JSContext *aContext, JSObject *aObj, jsval aID); void Finalize(JSContext *aContext, JSObject *aObj); @@ -1393,11 +1394,12 @@ public: virtual PRBool EnumerateProperty(JSContext *aContext, JSObject *aObj) { \ return _g.EnumerateProperty(aContext, aObj); \ } \ - virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID) { \ - return _g.EnumerateProperty(aContext, aObj); \ + virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID, \ + PRBool *aDidDefineProperty) { \ + return _g.Resolve(aContext, aObj, aID, aDidDefineProperty); \ } \ virtual PRBool Convert(JSContext *aContext, JSObject *aObj, jsval aID) { \ - return _g.EnumerateProperty(aContext, aObj); \ + return _g.Convert(aContext, aObj, aID); \ } \ virtual void Finalize(JSContext *aContext, JSObject *aObj) { \ _g.Finalize(aContext, aObj); \ diff --git a/layout/html/content/src/nsHTMLAppletElement.cpp b/layout/html/content/src/nsHTMLAppletElement.cpp index 014eb3ec2752..bf2c49e23dc9 100644 --- a/layout/html/content/src/nsHTMLAppletElement.cpp +++ b/layout/html/content/src/nsHTMLAppletElement.cpp @@ -93,11 +93,12 @@ public: virtual PRBool EnumerateProperty(JSContext *aContext, JSObject *aObj) { return mInner.EnumerateProperty(aContext, aObj); } - virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID) { - return mInner.EnumerateProperty(aContext, aObj); + virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty) { + return mInner.Resolve(aContext, aObj, aID, aDidDefineProperty); } virtual PRBool Convert(JSContext *aContext, JSObject *aObj, jsval aID) { - return mInner.EnumerateProperty(aContext, aObj); + return mInner.Convert(aContext, aObj, aID); } virtual void Finalize(JSContext *aContext, JSObject *aObj) { mInner.Finalize(aContext, aObj); diff --git a/layout/html/content/src/nsHTMLEmbedElement.cpp b/layout/html/content/src/nsHTMLEmbedElement.cpp index 10eaaacf9df7..ba3a8f665985 100644 --- a/layout/html/content/src/nsHTMLEmbedElement.cpp +++ b/layout/html/content/src/nsHTMLEmbedElement.cpp @@ -83,7 +83,8 @@ public: virtual PRBool SetProperty(JSContext *aContext, JSObject *aObj, jsval aID, jsval *aVp); virtual PRBool EnumerateProperty(JSContext *aContext, JSObject *aObj); - virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID); + virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool* aDidDefineProperty); virtual PRBool Convert(JSContext *aContext, JSObject *aObj, jsval aID); virtual void Finalize(JSContext *aContext, JSObject *aObj); @@ -486,9 +487,10 @@ nsHTMLEmbedElement::EnumerateProperty(JSContext *aContext, JSObject *aObj) } PRBool -nsHTMLEmbedElement::Resolve(JSContext *aContext, JSObject *aObj, jsval aID) +nsHTMLEmbedElement::Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty) { - return mInner.Resolve(aContext, aObj, aID); + return mInner.Resolve(aContext, aObj, aID, aDidDefineProperty); } PRBool diff --git a/layout/html/content/src/nsHTMLFormElement.cpp b/layout/html/content/src/nsHTMLFormElement.cpp index 5f5a31e58eb2..bd41beb16b74 100644 --- a/layout/html/content/src/nsHTMLFormElement.cpp +++ b/layout/html/content/src/nsHTMLFormElement.cpp @@ -98,7 +98,8 @@ public: virtual PRBool SetProperty(JSContext *aContext, JSObject *aObj, jsval aID, jsval *aVp); virtual PRBool EnumerateProperty(JSContext *aContext, JSObject *aObj); - virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID); + virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty); virtual PRBool Convert(JSContext *aContext, JSObject *aObj, jsval aID); virtual void Finalize(JSContext *aContext, JSObject *aObj); @@ -615,7 +616,8 @@ nsHTMLFormElement::EnumerateProperty(JSContext *aContext, JSObject *aObj) PRBool -nsHTMLFormElement::Resolve(JSContext *aContext, JSObject *aObj, jsval aID) +nsHTMLFormElement::Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty) { if (!JSVAL_IS_STRING(aID)) { return PR_TRUE; @@ -675,9 +677,11 @@ nsHTMLFormElement::Resolve(JSContext *aContext, JSObject *aObj, jsval aID) ret = ::JS_DefineProperty(aContext, myObj, str, OBJECT_TO_JSVAL(obj), nsnull, nsnull, 0); + + *aDidDefineProperty = PR_TRUE; } else { - ret = mInner.Resolve(aContext, aObj, aID); + ret = mInner.Resolve(aContext, aObj, aID, aDidDefineProperty); } return ret; diff --git a/layout/html/content/src/nsHTMLImageElement.cpp b/layout/html/content/src/nsHTMLImageElement.cpp index 6df08b6d9a91..18bd346d0d98 100644 --- a/layout/html/content/src/nsHTMLImageElement.cpp +++ b/layout/html/content/src/nsHTMLImageElement.cpp @@ -103,7 +103,8 @@ public: virtual PRBool SetProperty(JSContext *aContext, JSObject *aObj, jsval aID, jsval *aVp); virtual PRBool EnumerateProperty(JSContext *aContext, JSObject *aObj); - virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID); + virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty); virtual PRBool Convert(JSContext *aContext, JSObject *aObj, jsval aID); virtual void Finalize(JSContext *aContext, JSObject *aObj); @@ -723,7 +724,8 @@ nsHTMLImageElement::EnumerateProperty(JSContext *aContext, JSObject *aObj) } PRBool -nsHTMLImageElement::Resolve(JSContext *aContext, JSObject *aObj, jsval aID) +nsHTMLImageElement::Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty) { if (JSVAL_IS_STRING(aID) && mInner.mDOMSlots) { JSString *str; @@ -742,11 +744,13 @@ nsHTMLImageElement::Resolve(JSContext *aContext, JSObject *aObj, jsval aID) chars, ::JS_GetStringLength(str), JSVAL_VOID, nsnull, nsnull, 0); + *aDidDefineProperty = PR_TRUE; + return PR_TRUE; } } - return mInner.Resolve(aContext, aObj, aID); + return mInner.Resolve(aContext, aObj, aID, aDidDefineProperty); } PRBool diff --git a/layout/html/content/src/nsHTMLSelectElement.cpp b/layout/html/content/src/nsHTMLSelectElement.cpp index 93b4da436f47..fa209bc78ffa 100644 --- a/layout/html/content/src/nsHTMLSelectElement.cpp +++ b/layout/html/content/src/nsHTMLSelectElement.cpp @@ -96,7 +96,8 @@ public: PRBool SetProperty(JSContext *aContext, JSObject *aObj, jsval aID, jsval *aVp); PRBool EnumerateProperty(JSContext *aContext, JSObject *aObj); - PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID); + PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty); PRBool Convert(JSContext *aContext, JSObject *aObj, jsval aID); void Finalize(JSContext *aContext, JSObject *aObj); @@ -294,7 +295,8 @@ public: virtual PRBool SetProperty(JSContext *aContext, JSObject *aObj, jsval aID, jsval *aVp); virtual PRBool EnumerateProperty(JSContext *aContext, JSObject *aObj); - virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID); + virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty); virtual PRBool Convert(JSContext *aContext, JSObject *aObj, jsval aID); virtual void Finalize(JSContext *aContext, JSObject *aObj); @@ -1545,9 +1547,9 @@ nsHTMLSelectElement::GetProperty(JSContext *aContext, PRBool nsHTMLSelectElement::SetProperty(JSContext *aContext, - JSObject *aObj, - jsval aID, - jsval *aVp) + JSObject *aObj, + jsval aID, + jsval *aVp) { nsresult res = NS_OK; // Set options in the options list by indexing into select @@ -1571,8 +1573,11 @@ nsHTMLSelectElement::EnumerateProperty(JSContext *aContext, JSObject *aObj) } PRBool -nsHTMLSelectElement::Resolve(JSContext *aContext, JSObject *aObj, jsval aID) +nsHTMLSelectElement::Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty) { + *aDidDefineProperty = PR_FALSE; + return PR_TRUE; } @@ -1926,8 +1931,11 @@ nsHTMLOptionCollection::EnumerateProperty(JSContext *aContext, JSObject *aObj) } PRBool -nsHTMLOptionCollection::Resolve(JSContext *aContext, JSObject *aObj, jsval aID) +nsHTMLOptionCollection::Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty) { + *aDidDefineProperty = PR_FALSE; + return PR_TRUE; } diff --git a/layout/html/content/src/nsHTMLSpacerElement.cpp b/layout/html/content/src/nsHTMLSpacerElement.cpp index a0f2e1efc50b..4f68850e4e10 100644 --- a/layout/html/content/src/nsHTMLSpacerElement.cpp +++ b/layout/html/content/src/nsHTMLSpacerElement.cpp @@ -90,7 +90,8 @@ public: virtual PRBool SetProperty(JSContext *aContext, JSObject *aObj, jsval aID, jsval *aVp); virtual PRBool EnumerateProperty(JSContext *aContext, JSObject *aObj); - virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID); + virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty); virtual PRBool Convert(JSContext *aContext, JSObject *aObj, jsval aID); virtual void Finalize(JSContext *aContext, JSObject *aObj); @@ -353,9 +354,10 @@ nsHTMLSpacerElement::EnumerateProperty(JSContext *aContext, JSObject *aObj) } PRBool -nsHTMLSpacerElement::Resolve(JSContext *aContext, JSObject *aObj, jsval aID) +nsHTMLSpacerElement::Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty) { - return mInner.Resolve(aContext, aObj, aID); + return mInner.Resolve(aContext, aObj, aID, aDidDefineProperty); } PRBool diff --git a/layout/html/document/src/nsHTMLDocument.cpp b/layout/html/document/src/nsHTMLDocument.cpp index bbd44b13dfbf..afe56a80ab36 100644 --- a/layout/html/document/src/nsHTMLDocument.cpp +++ b/layout/html/document/src/nsHTMLDocument.cpp @@ -3150,8 +3150,11 @@ nsHTMLDocument::GetScriptObject(nsIScriptContext *aContext, void** aScriptObject } PRBool -nsHTMLDocument::Resolve(JSContext *aContext, JSObject *aObj, jsval aID) +nsHTMLDocument::Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty) { + *aDidDefineProperty = PR_FALSE; + if (!JSVAL_IS_STRING(aID)) { return PR_TRUE; } @@ -3166,6 +3169,8 @@ nsHTMLDocument::Resolve(JSContext *aContext, JSObject *aObj, jsval aID) ret = ::JS_DefineProperty(aContext, aObj, str, val, nsnull, nsnull, 0); + + *aDidDefineProperty = PR_TRUE; } if (NS_FAILED(result)) { ret = PR_FALSE; diff --git a/layout/html/document/src/nsHTMLDocument.h b/layout/html/document/src/nsHTMLDocument.h index 81f488b15a0e..a88615cc4624 100644 --- a/layout/html/document/src/nsHTMLDocument.h +++ b/layout/html/document/src/nsHTMLDocument.h @@ -134,7 +134,8 @@ public: NS_IMETHOD GetScriptObject(nsIScriptContext *aContext, void** aScriptObject); // From nsJSScriptObject interface, implemented by nsDocument - virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID); + virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty); /** * Finds text in content diff --git a/layout/xml/content/src/nsXMLElement.h b/layout/xml/content/src/nsXMLElement.h index fd4fd1610202..23a4272e2bc1 100644 --- a/layout/xml/content/src/nsXMLElement.h +++ b/layout/xml/content/src/nsXMLElement.h @@ -241,8 +241,9 @@ public: virtual PRBool EnumerateProperty(JSContext *aContext, JSObject *aObj) { return mInner.EnumerateProperty(aContext, aObj); } - virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID) { - return mInner.Resolve(aContext, aObj, aID); + virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty) { + return mInner.Resolve(aContext, aObj, aID, aDidDefineProperty); } virtual PRBool Convert(JSContext *aContext, JSObject *aObj, jsval aID) { return mInner.Convert(aContext, aObj, aID); diff --git a/rdf/content/src/nsJSXULCommandDispatcher.cpp b/rdf/content/src/nsJSXULCommandDispatcher.cpp index 9af682b8a0fc..529c38462b19 100644 --- a/rdf/content/src/nsJSXULCommandDispatcher.cpp +++ b/rdf/content/src/nsJSXULCommandDispatcher.cpp @@ -269,6 +269,20 @@ SetXULCommandDispatcherProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v } +// +// XULCommandDispatcher class properties +// +static JSPropertySpec XULCommandDispatcherProperties[] = +{ + {"focusedElement", XULCOMMANDDISPATCHER_FOCUSEDELEMENT, JSPROP_ENUMERATE}, + {"focusedWindow", XULCOMMANDDISPATCHER_FOCUSEDWINDOW, JSPROP_ENUMERATE}, + {"suppressFocus", XULCOMMANDDISPATCHER_SUPPRESSFOCUS, JSPROP_ENUMERATE}, + {"suppressFocusScroll", XULCOMMANDDISPATCHER_SUPPRESSFOCUSSCROLL, JSPROP_ENUMERATE}, + {"active", XULCOMMANDDISPATCHER_ACTIVE, JSPROP_ENUMERATE}, + {0} +}; + + // // XULCommandDispatcher finalizer // @@ -285,7 +299,7 @@ FinalizeXULCommandDispatcher(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateXULCommandDispatcher(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -295,7 +309,7 @@ EnumerateXULCommandDispatcher(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveXULCommandDispatcher(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -538,20 +552,6 @@ JSClass XULCommandDispatcherClass = { }; -// -// XULCommandDispatcher class properties -// -static JSPropertySpec XULCommandDispatcherProperties[] = -{ - {"focusedElement", XULCOMMANDDISPATCHER_FOCUSEDELEMENT, JSPROP_ENUMERATE}, - {"focusedWindow", XULCOMMANDDISPATCHER_FOCUSEDWINDOW, JSPROP_ENUMERATE}, - {"suppressFocus", XULCOMMANDDISPATCHER_SUPPRESSFOCUS, JSPROP_ENUMERATE}, - {"suppressFocusScroll", XULCOMMANDDISPATCHER_SUPPRESSFOCUSSCROLL, JSPROP_ENUMERATE}, - {"active", XULCOMMANDDISPATCHER_ACTIVE, JSPROP_ENUMERATE}, - {0} -}; - - // // XULCommandDispatcher class methods // diff --git a/rdf/content/src/nsJSXULDocument.cpp b/rdf/content/src/nsJSXULDocument.cpp index 678a112e5c01..da265c210b93 100644 --- a/rdf/content/src/nsJSXULDocument.cpp +++ b/rdf/content/src/nsJSXULDocument.cpp @@ -239,6 +239,21 @@ SetXULDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// XULDocument class properties +// +static JSPropertySpec XULDocumentProperties[] = +{ + {"popupNode", XULDOCUMENT_POPUPNODE, JSPROP_ENUMERATE}, + {"tooltipNode", XULDOCUMENT_TOOLTIPNODE, JSPROP_ENUMERATE}, + {"commandDispatcher", XULDOCUMENT_COMMANDDISPATCHER, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"width", XULDOCUMENT_WIDTH, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"height", XULDOCUMENT_HEIGHT, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"controls", XULDOCUMENT_CONTROLS, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // XULDocument finalizer // @@ -255,7 +270,7 @@ FinalizeXULDocument(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateXULDocument(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -265,7 +280,7 @@ EnumerateXULDocument(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveXULDocument(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -376,21 +391,6 @@ JSClass XULDocumentClass = { }; -// -// XULDocument class properties -// -static JSPropertySpec XULDocumentProperties[] = -{ - {"popupNode", XULDOCUMENT_POPUPNODE, JSPROP_ENUMERATE}, - {"tooltipNode", XULDOCUMENT_TOOLTIPNODE, JSPROP_ENUMERATE}, - {"commandDispatcher", XULDOCUMENT_COMMANDDISPATCHER, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"width", XULDOCUMENT_WIDTH, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"height", XULDOCUMENT_HEIGHT, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"controls", XULDOCUMENT_CONTROLS, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // XULDocument class methods // diff --git a/rdf/content/src/nsJSXULElement.cpp b/rdf/content/src/nsJSXULElement.cpp index c8a6a239d518..92403296891a 100644 --- a/rdf/content/src/nsJSXULElement.cpp +++ b/rdf/content/src/nsJSXULElement.cpp @@ -265,6 +265,23 @@ SetXULElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// XULElement class properties +// +static JSPropertySpec XULElementProperties[] = +{ + {"id", XULELEMENT_ID, JSPROP_ENUMERATE}, + {"className", XULELEMENT_CLASSNAME, JSPROP_ENUMERATE}, + {"style", XULELEMENT_STYLE, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"database", XULELEMENT_DATABASE, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"builder", XULELEMENT_BUILDER, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"resource", XULELEMENT_RESOURCE, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"controllers", XULELEMENT_CONTROLLERS, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"boxObject", XULELEMENT_BOXOBJECT, JSPROP_ENUMERATE | JSPROP_READONLY}, + {0} +}; + + // // XULElement finalizer // @@ -281,7 +298,7 @@ FinalizeXULElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateXULElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -291,7 +308,7 @@ EnumerateXULElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveXULElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -597,23 +614,6 @@ JSClass XULElementClass = { }; -// -// XULElement class properties -// -static JSPropertySpec XULElementProperties[] = -{ - {"id", XULELEMENT_ID, JSPROP_ENUMERATE}, - {"className", XULELEMENT_CLASSNAME, JSPROP_ENUMERATE}, - {"style", XULELEMENT_STYLE, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"database", XULELEMENT_DATABASE, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"builder", XULELEMENT_BUILDER, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"resource", XULELEMENT_RESOURCE, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"controllers", XULELEMENT_CONTROLLERS, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"boxObject", XULELEMENT_BOXOBJECT, JSPROP_ENUMERATE | JSPROP_READONLY}, - {0} -}; - - // // XULElement class methods // diff --git a/rdf/content/src/nsJSXULMenuListElement.cpp b/rdf/content/src/nsJSXULMenuListElement.cpp index 74c52544e5e3..01842970eeef 100644 --- a/rdf/content/src/nsJSXULMenuListElement.cpp +++ b/rdf/content/src/nsJSXULMenuListElement.cpp @@ -308,6 +308,22 @@ SetXULMenuListElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// XULMenuListElement class properties +// +static JSPropertySpec XULMenuListElementProperties[] = +{ + {"value", XULMENULISTELEMENT_VALUE, JSPROP_ENUMERATE}, + {"data", XULMENULISTELEMENT_DATA, JSPROP_ENUMERATE}, + {"selectedItem", XULMENULISTELEMENT_SELECTEDITEM, JSPROP_ENUMERATE}, + {"selectedIndex", XULMENULISTELEMENT_SELECTEDINDEX, JSPROP_ENUMERATE}, + {"crop", XULMENULISTELEMENT_CROP, JSPROP_ENUMERATE}, + {"disabled", XULMENULISTELEMENT_DISABLED, JSPROP_ENUMERATE}, + {"src", XULMENULISTELEMENT_SRC, JSPROP_ENUMERATE}, + {0} +}; + + // // XULMenuListElement finalizer // @@ -324,7 +340,7 @@ FinalizeXULMenuListElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateXULMenuListElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -334,7 +350,7 @@ EnumerateXULMenuListElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveXULMenuListElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -358,22 +374,6 @@ JSClass XULMenuListElementClass = { }; -// -// XULMenuListElement class properties -// -static JSPropertySpec XULMenuListElementProperties[] = -{ - {"value", XULMENULISTELEMENT_VALUE, JSPROP_ENUMERATE}, - {"data", XULMENULISTELEMENT_DATA, JSPROP_ENUMERATE}, - {"selectedItem", XULMENULISTELEMENT_SELECTEDITEM, JSPROP_ENUMERATE}, - {"selectedIndex", XULMENULISTELEMENT_SELECTEDINDEX, JSPROP_ENUMERATE}, - {"crop", XULMENULISTELEMENT_CROP, JSPROP_ENUMERATE}, - {"disabled", XULMENULISTELEMENT_DISABLED, JSPROP_ENUMERATE}, - {"src", XULMENULISTELEMENT_SRC, JSPROP_ENUMERATE}, - {0} -}; - - // // XULMenuListElement class methods // diff --git a/rdf/content/src/nsJSXULTreeElement.cpp b/rdf/content/src/nsJSXULTreeElement.cpp index 7e8149fbed53..c7278935a283 100644 --- a/rdf/content/src/nsJSXULTreeElement.cpp +++ b/rdf/content/src/nsJSXULTreeElement.cpp @@ -192,6 +192,18 @@ SetXULTreeElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } +// +// XULTreeElement class properties +// +static JSPropertySpec XULTreeElementProperties[] = +{ + {"selectedItems", XULTREEELEMENT_SELECTEDITEMS, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"currentItem", XULTREEELEMENT_CURRENTITEM, JSPROP_ENUMERATE}, + {"suppressOnSelect", XULTREEELEMENT_SUPPRESSONSELECT, JSPROP_ENUMERATE}, + {0} +}; + + // // XULTreeElement finalizer // @@ -208,7 +220,7 @@ FinalizeXULTreeElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateXULTreeElement(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -218,7 +230,7 @@ EnumerateXULTreeElement(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveXULTreeElement(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); } @@ -641,18 +653,6 @@ JSClass XULTreeElementClass = { }; -// -// XULTreeElement class properties -// -static JSPropertySpec XULTreeElementProperties[] = -{ - {"selectedItems", XULTREEELEMENT_SELECTEDITEMS, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"currentItem", XULTREEELEMENT_CURRENTITEM, JSPROP_ENUMERATE}, - {"suppressOnSelect", XULTREEELEMENT_SUPPRESSONSELECT, JSPROP_ENUMERATE}, - {0} -}; - - // // XULTreeElement class methods // diff --git a/rdf/content/src/nsXULDocument.cpp b/rdf/content/src/nsXULDocument.cpp index b3eb2f7153a1..dc84eee7b7e0 100644 --- a/rdf/content/src/nsXULDocument.cpp +++ b/rdf/content/src/nsXULDocument.cpp @@ -3758,8 +3758,11 @@ nsXULDocument::EnumerateProperty(JSContext *aContext, JSObject *aObj) PRBool -nsXULDocument::Resolve(JSContext *aContext, JSObject *aObj, jsval aID) +nsXULDocument::Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty) { + *aDidDefineProperty = PR_FALSE; + return PR_TRUE; } diff --git a/rdf/content/src/nsXULDocument.h b/rdf/content/src/nsXULDocument.h index 69c79d207406..594863adb636 100644 --- a/rdf/content/src/nsXULDocument.h +++ b/rdf/content/src/nsXULDocument.h @@ -379,7 +379,8 @@ public: virtual PRBool SetProperty(JSContext *aContext, JSObject *aObj, jsval aID, jsval *aVp); virtual PRBool EnumerateProperty(JSContext *aContext, JSObject *aObj); - virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID); + virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty); virtual PRBool Convert(JSContext *aContext, JSObject *aObj, jsval aID); virtual void Finalize(JSContext *aContext, JSObject *aObj); diff --git a/rdf/content/src/nsXULElement.cpp b/rdf/content/src/nsXULElement.cpp index 65717204d2af..5cf5887d8702 100644 --- a/rdf/content/src/nsXULElement.cpp +++ b/rdf/content/src/nsXULElement.cpp @@ -2114,8 +2114,11 @@ nsXULElement::EnumerateProperty(JSContext *aContext, JSObject *aObj) PRBool -nsXULElement::Resolve(JSContext *aContext, JSObject *aObj, jsval aID) +nsXULElement::Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty) { + *aDidDefineProperty = PR_FALSE; + return PR_TRUE; } diff --git a/rdf/content/src/nsXULElement.h b/rdf/content/src/nsXULElement.h index 87050883a732..a2a7783a5e93 100644 --- a/rdf/content/src/nsXULElement.h +++ b/rdf/content/src/nsXULElement.h @@ -461,7 +461,8 @@ public: virtual PRBool SetProperty(JSContext *aContext, JSObject *aObj, jsval aID, jsval *aVp); virtual PRBool EnumerateProperty(JSContext *aContext, JSObject *aObj); - virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID); + virtual PRBool Resolve(JSContext *aContext, JSObject *aObj, jsval aID, + PRBool *aDidDefineProperty); virtual PRBool Convert(JSContext *aContext, JSObject *aObj, jsval aID); virtual void Finalize(JSContext *aContext, JSObject *aObj); diff --git a/xpfe/appshell/src/nsJSXPConnectFactory.cpp b/xpfe/appshell/src/nsJSXPConnectFactory.cpp index 3c2ad50a320f..f8e5142d4f04 100644 --- a/xpfe/appshell/src/nsJSXPConnectFactory.cpp +++ b/xpfe/appshell/src/nsJSXPConnectFactory.cpp @@ -109,7 +109,7 @@ FinalizeXPConnectFactory(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) EnumerateXPConnectFactory(JSContext *cx, JSObject *obj) { - return nsJSUtils::nsGenericEnumerate(cx, obj); + return nsJSUtils::nsGenericEnumerate(cx, obj, nsnull); } @@ -119,7 +119,7 @@ EnumerateXPConnectFactory(JSContext *cx, JSObject *obj) PR_STATIC_CALLBACK(JSBool) ResolveXPConnectFactory(JSContext *cx, JSObject *obj, jsval id) { - return nsJSUtils::nsGenericResolve(cx, obj, id); + return nsJSUtils::nsGenericResolve(cx, obj, id, nsnull); }