I'm not quite certain of the events that lead html5 to the following state, but running capybara's expectations on zombie.js I get this stack trace:
TypeError: Cannot read property 'tagName' of undefined
at EventEmitter.reset_insertion_mode (/usr/local/lib/node/.npm/html5/9999.0.0-LINK-3d23ff1b/package/lib/html5/parser.js:190:24)
at Object.endTagSelect (/usr/local/lib/node/.npm/html5/9999.0.0-LINK-3d23ff1b/package/lib/html5/parser/in_select_phase.js:81:15)
Poking around, I see that Parser.prototype.reset_insertion_mode expects a context parameter but p.endTagSelect does not supply one. I looked for similar patterns in your code and saw that p.prototype.endTagTable in end_table_phase.js is very similar to p.endTagSelect and it supplies this.tree.open_elements.last() to reset_insertion_mode.
I made that change and zombie plowed forward.
Here's the commit: boblail/html5@18c09b9e78e3c384babdbc66afae41babaec57af.
I'm not quite certain of the events that lead html5 to the following state, but running capybara's expectations on zombie.js I get this stack trace:
Poking around, I see that
Parser.prototype.reset_insertion_mode
expects acontext
parameter butp.endTagSelect
does not supply one. I looked for similar patterns in your code and saw thatp.prototype.endTagTable
inend_table_phase.js
is very similar top.endTagSelect
and it suppliesthis.tree.open_elements.last()
toreset_insertion_mode
.I made that change and zombie plowed forward.
Here's the commit: boblail/html5@18c09b9e78e3c384babdbc66afae41babaec57af.
I'll send a pull request.