plumatic / dommy

A tiny ClojureScript DOM manipulation and event library
759 stars 74 forks source link

IE fix: replace reference to js/HTMLDocument with js/Document #28

Closed starvinraven closed 11 years ago

starvinraven commented 11 years ago

So, I noticed Dommy breaks in Internet Explorer (versions > 8, I think). This is due to references to HTMLDocument, which results in the following error:

SCRIPT5009: 'HTMLDocument' is undefined

I tried a quick fix and replaced HTMLDocument with Document, which seemed to do the trick. To be honest, however, this might break any number of other things...

This seems to coincide with the pull request by @hsalokor, but just referencing another nonexistant global object. I suppose the "correct" way to fix this would be to check for existence, e.g. if(typeof HTMLDocument !== 'undefined') { extendPrototype() }. Anyway, as is, it's a pretty nasty bug.

hsalokor commented 11 years ago

Any news on this one? I encountered this same issue with IE9, and am currently using custom dommy version w/ this patch in order to avoid it.

cpetzold commented 11 years ago

This is fine, as Document is a superclass of HTMLDocument, and still implements all of the methods on document that we care about (querySelector[All], getElementBy{Id | TagName | ClassName}, addEventListener, etc).

Thanks for the fix!