envjs / env-js

A pure-JavaScript browser environment.
http://www.envjs.com/
87 stars 19 forks source link

jQuery 1.5.1 #24

Open orslumen opened 13 years ago

orslumen commented 13 years ago

Some fixes were needed to get jQuery 1.5.1 working with EnvJs in Ruby Racer:

i) The jQuery.clone method uses an expando attribute that is removed in jQeury.cloneFixAttributes. But that attribute may not be present on the current node. If doc.implementation.errorChecking === false it should fail silently, see NamedNodeMap#removeNamedItem(NS).

ii) jQuery directly retrieves and sets the value attribute on the nodes, but (at least in Ruby Racer) the NamedNodeMap does not accept a call to value=. To fix this, explicit getter and setters are added, see NamedNodeMap#get/set value

iii) jQeury.cloneFixAttributes makes use of Element.clearAttributes and Element.mergeAttributes. Both methods were not defined yet.

The code changes I used to get jQuery 1.5.1 working can be found in https://github.com/orslumen/env-js/commit/c3e702cfa84872782dd40a2c4cd8a4c8f9bac3a3

vanm commented 13 years ago

@orslumen Thanks for publishing these fixes. If you haven't created a pull request already, it would be great to get these pulled back into envjs master.