Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
fix benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelw committed Mar 15, 2014
1 parent 4bd18f5 commit 1edb9aa
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 3 deletions.
2 changes: 1 addition & 1 deletion benchmark/d8_benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var width = 2;
var depth = 4;
var decoration = 8;
var instanceCount = 10;
var oneTime = true;
var oneTime = false;
var compoundBindings = false;
var expressionCheckbox = false;
var bindingDensities = [0, .1, .2, .3, .4, .5, .6, .7, .8, .9, 1];
Expand Down
48 changes: 46 additions & 2 deletions benchmark/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ Node.prototype = {
node.previousSibling = this.lastChild;
this.lastChild = node;
}

return node;
},

Expand Down Expand Up @@ -164,7 +165,14 @@ Document.prototype = {
nodeType: Node.DOCUMENT_NODE,
implementation: {
createHTMLDocument: function() {
return new Document();
var doc = new Document();
var html = doc.appendChild(doc.createElement('HTML'));
var head = html.appendChild(doc.createElement('HEAD'));
doc.head = head;
var body = html.appendChild(doc.createElement('BODY'));
doc.body = body;

return doc;
}
},
importNode: function(node) {
Expand Down Expand Up @@ -192,6 +200,14 @@ Document.prototype = {
return new HTMLHeadingElement(this, tagName);
case 'TEMPLATE':
return new HTMLTemplateElement(this, tagName);
case 'HTML':
return new HTMLHtmlElement(this, tagName);
case 'HEAD':
return new HTMLHeadElement(this, tagName);
case 'BODY':
return new HTMLBodyElement(this, tagName);
case 'BASE':
return new HTMLBaseElement(this, tagName)
default:
throw Error('Unknown tag: ' + tagName);
}
Expand Down Expand Up @@ -357,8 +373,36 @@ HTMLHeadingElement.prototype = {

function HTMLTemplateElement(owner, tagName) {
HTMLElement.call(this, owner, tagName);
this.content = new DocumentFragment();
this.content = new DocumentFragment(owner.templateContentsOwnerDocument);
}
HTMLTemplateElement.prototype = {
__proto__: HTMLElement.prototype,
};

function HTMLHtmlElement(owner, tagName) {
HTMLElement.call(this, owner, tagName);
}
HTMLHtmlElement.prototype = {
__proto__: HTMLElement.prototype
};

function HTMLHeadElement(owner, tagName) {
HTMLElement.call(this, owner, tagName);
}
HTMLHeadElement.prototype = {
__proto__: HTMLElement.prototype
};

function HTMLBodyElement(owner, tagName) {
HTMLElement.call(this, owner, tagName);
}
HTMLBodyElement.prototype = {
__proto__: HTMLElement.prototype
};

function HTMLBaseElement(owner, tagName) {
HTMLElement.call(this, owner, tagName);
}
HTMLBaseElement.prototype = {
__proto__: HTMLElement.prototype
};

0 comments on commit 1edb9aa

Please sign in to comment.