Skip to content
Browse files

HTML5 doesn't play nice with JSDOM, bringing back html-parser to

handle innerHTML (full document parsing still handled by HTML5).
  • Loading branch information...
1 parent 92ab434 commit 2edf72d13a15a9ac79be8cdca6bb090c6748f996 @assaf assaf committed Dec 28, 2010
Showing with 15 additions and 7 deletions.
  1. +6 −1 CHANGELOG.md
  2. +2 −1 package.json
  3. +1 −1 spec/history-spec.coffee
  4. +3 −1 src/zombie/browser.coffee
  5. +2 −2 src/zombie/history.coffee
  6. +1 −1 src/zombie/jsdom_patches.coffee
View
7 CHANGELOG.md
@@ -1,14 +1,19 @@
zombie.js-changelog(1) -- Changelog
===================================
-## Version 0.7.5 2010-12-28
+## Version 0.7.6 2010-12-28
+
+HTML5 doesn't play nice with JSDOM, bringing back html-parser to handle
+innerHTML (full document parsing still handled by HTML5).
Added documentation page for CSS selectors.
Man pages now moved to section 7.
Added zombie.version.
+ 189 Tests
+ 2.3 sec to complete
## Version 0.7.5 2010-12-28
View
3 package.json
@@ -1,6 +1,6 @@
{
"name": "zombie",
- "version": "0.7.5",
+ "version": "0.7.6",
"description": "Insanely fast, full-stack, headless testing using node.js",
"homepage": "http://zombie.labnotes.org/",
"author": "Assaf Arkin <assaf@labnotes.org> (http://labnotes.org/)",
@@ -23,6 +23,7 @@
"node": "*"
},
"dependencies": {
+ "htmlparser": ">= 1.7.3",
"html5": ">= 0.2.5",
"jsdom": ">= 0.1.21"
},
View
2 spec/history-spec.coffee
@@ -99,7 +99,7 @@ vows.describe("History").addBatch(
"change hash":
zombie.wants "http://localhost:3003/"
topic: (browser)->
- browser.window.document.innerHTML = "Wolf"
+ browser.document.innerHTML = "Wolf"
browser.window.addEventListener "hashchange", => @callback null, browser
browser.window.location.hash = "boo"
"should add page to history": (browser)-> assert.length browser.window.history, 2
View
4 src/zombie/browser.coffee
@@ -170,7 +170,9 @@ class Browser extends require("events").EventEmitter
@removeListener "error", arguments.callee
callback error
history._assign url
- window.document.addEventListener "DOMContentLoaded", => @wait callback
+ window.document.addEventListener "DOMContentLoaded", =>
+ @removeListener "error", arguments.callee
+ @wait callback
return
# ### browser.location => Location
View
4 src/zombie/history.coffee
@@ -1,9 +1,9 @@
# Window history and location.
+http = require("http")
jsdom = require("jsdom")
html = jsdom.dom.level3.html
-http = require("http")
-URL = require("url")
qs = require("querystring")
+URL = require("url")
util = require("util")
View
2 src/zombie/jsdom_patches.coffee
@@ -164,7 +164,7 @@ core.HTMLDocument.prototype._write = (html)->
# During page loading, document.write appends to the current element
open = @_parser.tree.open_elements.last()
parser = new html5.Parser(document: this)
- node = parser.parse_fragment(html, open.parentNode)
+ parser.parse_fragment(html, open.parentNode)
else
# When loading page, parse from scratch.
# After page loading, empty document and parse from scratch.

0 comments on commit 2edf72d

Please sign in to comment.
Something went wrong with that request. Please try again.