diff options
author | Vincent Sanders <vince@netsurf-browser.org> | 2012-08-01 19:25:45 +0100 |
---|---|---|
committer | Vincent Sanders <vince@netsurf-browser.org> | 2012-08-01 19:25:45 +0100 |
commit | 6bbae1f2284a7d52daf96ad30e1519600ae5493b (patch) | |
tree | 5d35c4f4e378d5c4083d3b04e51fb1799374a20d /javascript | |
parent | b238791002697efbda1ece31985ca15331511fa8 (diff) | |
download | netsurf-6bbae1f2284a7d52daf96ad30e1519600ae5493b.tar.gz netsurf-6bbae1f2284a7d52daf96ad30e1519600ae5493b.tar.bz2 |
add document IDL and test for geteleemntbyid
Diffstat (limited to 'javascript')
-rw-r--r-- | javascript/jsapi/document.c | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/javascript/jsapi/document.c b/javascript/jsapi/document.c index bb5019c4b..c54d2f6a5 100644 --- a/javascript/jsapi/document.c +++ b/javascript/jsapi/document.c @@ -24,6 +24,80 @@ #include "render/html_internal.h" #include "utils/log.h" +/* IDL from http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html + + +interface Document : Node { + // Modified in DOM Level 3: + readonly attribute DocumentType doctype; + readonly attribute DOMImplementation implementation; + readonly attribute Element documentElement; + Element createElement(in DOMString tagName) + raises(DOMException); + DocumentFragment createDocumentFragment(); + Text createTextNode(in DOMString data); + Comment createComment(in DOMString data); + CDATASection createCDATASection(in DOMString data) + raises(DOMException); + ProcessingInstruction createProcessingInstruction(in DOMString target, + in DOMString data) + raises(DOMException); + Attr createAttribute(in DOMString name) + raises(DOMException); + EntityReference createEntityReference(in DOMString name) + raises(DOMException); + NodeList getElementsByTagName(in DOMString tagname); + // Introduced in DOM Level 2: + Node importNode(in Node importedNode, + in boolean deep) + raises(DOMException); + // Introduced in DOM Level 2: + Element createElementNS(in DOMString namespaceURI, + in DOMString qualifiedName) + raises(DOMException); + // Introduced in DOM Level 2: + Attr createAttributeNS(in DOMString namespaceURI, + in DOMString qualifiedName) + raises(DOMException); + // Introduced in DOM Level 2: + NodeList getElementsByTagNameNS(in DOMString namespaceURI, + in DOMString localName); + // Introduced in DOM Level 2: + Element getElementById(in DOMString elementId); + // Introduced in DOM Level 3: + readonly attribute DOMString inputEncoding; + // Introduced in DOM Level 3: + readonly attribute DOMString xmlEncoding; + // Introduced in DOM Level 3: + attribute boolean xmlStandalone; + // raises(DOMException) on setting + + // Introduced in DOM Level 3: + attribute DOMString xmlVersion; + // raises(DOMException) on setting + + // Introduced in DOM Level 3: + attribute boolean strictErrorChecking; + // Introduced in DOM Level 3: + attribute DOMString documentURI; + // Introduced in DOM Level 3: + Node adoptNode(in Node source) + raises(DOMException); + // Introduced in DOM Level 3: + readonly attribute DOMConfiguration domConfig; + // Introduced in DOM Level 3: + void normalizeDocument(); + // Introduced in DOM Level 3: + Node renameNode(in Node n, + in DOMString namespaceURI, + in DOMString qualifiedName) + raises(DOMException); +}; + + + */ + + static JSClass jsclass_document = { "document", @@ -39,6 +113,12 @@ static JSClass jsclass_document = JSCLASS_NO_OPTIONAL_MEMBERS }; +static JSBool JSAPI_NATIVE(getElementById, JSContext *cx, uintN argc, jsval *vp) +{ + JSAPI_SET_RVAL(cx, vp, JSVAL_VOID); + + return JS_TRUE; +} static JSBool JSAPI_NATIVE(write, JSContext *cx, uintN argc, jsval *vp) { @@ -67,6 +147,7 @@ static JSBool JSAPI_NATIVE(write, JSContext *cx, uintN argc, jsval *vp) static JSFunctionSpec jsfunctions_document[] = { JSAPI_FS(write, 1, 0), + JSAPI_FS(getElementById, 1, 0), JSAPI_FS_END }; |