aredridel / html5

Event-driven HTML5 Parser in Javascript
http://dinhe.net/~aredridel/projects/js/html5/
MIT License
590 stars 168 forks source link

Why don't you use document.createElement / document.createElementNS ? #87

Closed danyaPostfactum closed 10 years ago

danyaPostfactum commented 11 years ago

Any reason?

I also don't understand TreeBuilder.copyAttributeToElement function. Can you explain please?

aredridel commented 11 years ago

so that it's possible to create elements like <<> and attributes like foo!=bar. The spec says that these get created, but the DOM spec says they're rejected in createElement and setAttribute.

It's horrible and I want to add private API to jsdom to make it better.

danyaPostfactum commented 11 years ago

Ok, I see. Same problem with doctype ( with empty name ). Thanks.

aredridel commented 11 years ago

On 27 July 2013 at 2:40:25 AM, danyaPostfactum (notifications@github.com) wrote:

Ok, I see. Same problem with doctype ( with empty name ). Thanks.

— Reply to this email directly or view it on GitHub.

aredridel commented 11 years ago

Exactly. I keep intending to make a “screw invalid documents anyway” mode that discards all the bogus stuff.