Skip to content

Commit

Permalink
repush dom seperation fix with missing wait for the parser
Browse files Browse the repository at this point in the history
  • Loading branch information
smparkes committed Nov 24, 2009
1 parent 6194ed7 commit a60923a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/dom/document.js
Expand Up @@ -36,7 +36,7 @@ var DOMDocument = function(implementation, docParentWindow) {
DOMDocument.prototype = new DOMNode;
__extend__(DOMDocument.prototype, {
toString : function(){
return '[object HTMLDocument]';
return '[object DOMDocument]';
},
addEventListener : function(){ $w.addEventListener.apply(this, arguments); },
removeEventListener : function(){ $w.removeEventListener.apply(this, arguments); },
Expand Down Expand Up @@ -352,7 +352,7 @@ __extend__(DOMDocument.prototype, {
return this.documentElement.xml;
},
toString: function(){
return "Document" + (typeof this._url == "string" ? ": " + this._url : "");
return "DOMDocument" + (typeof this._url == "string" ? ": " + this._url : "");
},
get defaultView(){
return { getComputedStyle: function(elem){
Expand Down
2 changes: 1 addition & 1 deletion src/html/document.js
Expand Up @@ -209,7 +209,7 @@ __extend__(HTMLDocument.prototype, {
this.write(htmlstring+'\n');
},
toString: function(){
return "Document" + (typeof this._url == "string" ? ": " + this._url : "");
return "HTMLDocument" + (typeof this._url == "string" ? ": " + this._url : "");
},
get innerHTML(){
return this.documentElement.outerHTML;
Expand Down
9 changes: 5 additions & 4 deletions src/html/element.js
Expand Up @@ -41,9 +41,10 @@ __extend__(HTMLElement.prototype, {
set innerHTML(html){
//Should be replaced with HTMLPARSER usage
//$debug('SETTING INNER HTML ('+this+'+'+html.substring(0,64));
var tmp = new HTMLDocument($implementation,null,"");
$w.parseHtmlDocument(html,tmp,null,null);
var parent = tmp.body;
var doc = new HTMLDocument($implementation,null,"");
$w.parseHtmlDocument(html,doc,null,null);
$env.wait(-1);
var parent = doc.body;
while(this.firstChild != null){
this.removeChild( this.firstChild );
}
Expand All @@ -54,7 +55,7 @@ __extend__(HTMLElement.prototype, {
this.appendChild( importedNode );
}
//Mark for garbage collection
tmp = null;
doc = null;
},
get innerText(){
return __recursivelyGatherText__(this);
Expand Down

0 comments on commit a60923a

Please sign in to comment.