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.
@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.
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 injQeury.cloneFixAttributes
. But that attribute may not be present on the current node. Ifdoc.implementation.errorChecking === false
it should fail silently, seeNamedNodeMap#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 ofElement.clearAttributes
andElement.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