Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

updated runner.js and finished the framework for level2/core

  • Loading branch information...
commit d1cf3ca30f4a47611e9b5fc2167f3e924de79fd4 1 parent 39b921d
@tmpvar authored
Showing with 105 additions and 70 deletions.
  1. +98 −64 lib/jsdom/level2/core.js
  2. +7 −6 test/runner.js
View
162 lib/jsdom/level2/core.js
@@ -7,8 +7,8 @@ var NAMESPACE_ERR = core.NAMESPACE_ERR = 14;
var INVALID_ACCESS_ERR = core.INVALID_ACCESS_ERR = 15;
core.DOMImplementation.prototype.createDocumentType = function(/* String */ qualifiedName,
- /* String */ publicId,
- /* String */ systemId)
+ /* String */ publicId,
+ /* String */ systemId)
{
};
@@ -94,81 +94,115 @@ core.Node.prototype.hasAttributes = function() {
};
-core.NamedNodeMap.prototype.getNamedItemNS = function(/* string */ namespaceURI,/* string */ localName) {
+core.NamedNodeMap.prototype.getNamedItemNS = function(/* string */ namespaceURI,
+ /* string */ localName)
+{
};
-core.NamedNodeMap.prototype.setNamedItemNS = function(/* Node */ arg) { // raises(DOMException)
+core.NamedNodeMap.prototype.setNamedItemNS = function(/* Node */ arg)
+{
};
-core.NamedNodeMap.prototype.removeNamedItemNS = function(/*string */ namespaceURI, /* string */ localName) {
+core.NamedNodeMap.prototype.removeNamedItemNS = function(/*string */ namespaceURI,
+ /* string */ localName)
+{
};
core.Attr.prototype.__defineGetter__("ownerElement", function() {
});
-/*
- interface Element : Node {
- // Introduced in DOM Level 2:
- DOMString getAttributeNS(in DOMString namespaceURI, in DOMString localName);
- // Introduced in DOM Level 2:
- void setAttributeNS(in DOMString namespaceURI,
- in DOMString qualifiedName,
- in DOMString value)
- raises(DOMException);
- // Introduced in DOM Level 2:
- void removeAttributeNS(in DOMString namespaceURI,
- in DOMString localName)
- raises(DOMException);
- // Introduced in DOM Level 2:
- Attr getAttributeNodeNS(in DOMString namespaceURI,
- in DOMString localName);
- // Introduced in DOM Level 2:
- Attr setAttributeNodeNS(in Attr newAttr)
- raises(DOMException);
- // Introduced in DOM Level 2:
- NodeList getElementsByTagNameNS(in DOMString namespaceURI,
- in DOMString localName);
- // Introduced in DOM Level 2:
- boolean hasAttribute(in DOMString name);
- // Introduced in DOM Level 2:
- boolean hasAttributeNS(in DOMString namespaceURI,
- in DOMString localName);
- };
-
- interface DocumentType : Node {
- // Introduced in DOM Level 2:
- readonly attribute DOMString publicId;
- // Introduced in DOM Level 2:
- readonly attribute DOMString systemId;
- // Introduced in DOM Level 2:
- readonly attribute DOMString internalSubset;
- };
-
- interface Document : Node {
- // 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);
- };
+
+
+core.Element.prototype.getAttributeNS = function(/* string */ namespaceURI,
+ /* string */ localName)
+{
+
};
-*/
-exports.dom =
+core.Element.prototype.setAttributeNS = function(/* string */ namespaceURI,
+ /* string */ qualifiedName,
+ /* string */ value)
+{
+
+};
+
+core.Element.prototype.removeAttributeNS = function(/* string */ namespaceURI,
+ /* string */ localName)
+{
+
+};
+
+core.Element.prototype.getAttributeNodeNS = function(/* string */ namespaceURI,
+ /* string */ localName)
+{
+
+};
+
+core.Element.prototype.setAttributeNodeNS = function(/* Attr */ newAttr)
+{
+
+};
+
+core.Element.prototype.getElementsByTagNameNS = function(/* string */ namespaceURI,
+ /* string */ localName)
+{
+
+};
+
+core.Element.prototype.hasAttribute = function(/* string */name)
+{
+
+};
+
+core.Element.prototype.hasAttributeNS = function(/* string */namespaceURI,
+ /* string */localName)
+{
+
+};
+
+core.DocumentType.prototype.__defineGetter__("publicId", function() {
+ return this._publicId || "";
+});
+
+core.DocumentType.prototype.__defineGetter__("systemId", function() {
+ return this._systemId || "";
+});
+
+core.DocumentType.prototype.__defineGetter__("internalSubset", function() {
+ return this._internalSubset || "";
+});
+
+core.Document.prototype.importNode(/* Node */ importedNode,
+ /* bool */ deep)
+{
+
+}
+core.Document.prototype.createElementNS(/* string */ namespaceURI,
+ /* string */ qualifiedName)
+{
+
+}
+
+core.Document.prototype.createAttributeNS(/* string */ namespaceURI,
+ /* string */ qualifiedName)
+{
+
+}
+
+core.Document.prototype.getElementsByTagNameNS(/* string */ namespaceURI,
+ /* string */ localName)
+{
+
+}
+
+core.Document.prototype.getElementById(/* string */ elementId)
+{
+
+}
+
+exports.dom =
{
level2 : {
core : core
View
13 test/runner.js
@@ -20,7 +20,7 @@ var mixin = function(target) {
return target;
};
-mixin(global, require("../lib/jsdom/level1/core").dom.level1.core);
+mixin(global, require(__dirname + "/../lib/jsdom/level1/core").dom.level1.core);
mixin(global, require(__dirname + "/mjsunit"));
mixin(global, require("./DOMTestCase"));
@@ -32,7 +32,10 @@ global.builder = {
};
global.load = function(docRef, doc, name) {
- return require("./" + global.builder.testDirectory + "/files/" + name + "." + global.builder.type)[name]();
+ return require(__dirname + "/" +
+ global.builder.testDirectory +
+ "/files/" + name + "." +
+ global.builder.type)[name]();
};
global.checkInitialization = function() {
@@ -84,7 +87,6 @@ var suites = {
global.dom = require(__dirname + "/../lib/jsdom/level1/core").dom.level1.core;
global.browser = require(__dirname + "/../lib/jsdom/browser").browserAugmentation(dom);
-
global.builder.contentType = "text/html";
global.builder.type = "html";
global.builder.testDirectory = "browser";
@@ -94,7 +96,6 @@ var suites = {
global.dom = require(__dirname + "/../lib/jsdom/level1/core").dom.level1.core;
global.window = require(__dirname + "/../lib/jsdom/browser").windowAugmentation(dom);
-
global.builder.contentType = "text/html";
global.builder.type = "html";
global.builder.testDirectory = "browser";
@@ -124,6 +125,6 @@ var suites = {
*/
};
-require.paths.unshift(__dirname + "/../../.node_libraries");
-require("mjsunit.runner/lib/runner").run(suites);
+
+require("mjsunit.runner/jsdom/runner").run(suites);
Please sign in to comment.
Something went wrong with that request. Please try again.