Permalink
Browse files

envjs#24: jQuery 1.5.1

  • Loading branch information...
orslumen committed Apr 8, 2011
1 parent 44fb38d commit c3e702cfa84872782dd40a2c4cd8a4c8f9bac3a3
Showing with 30 additions and 5 deletions.
  1. +30 −5 envjs/dom.js
View
@@ -1479,8 +1479,12 @@ __extend__(NamedNodeMap.prototype, {
var itemIndex = __findNamedItemIndex__(this, name);
// throw Exception if there is no node named name in this map
if (doc.implementation.errorChecking && (itemIndex < 0)) {
throw (new DOMException(DOMException.NOT_FOUND_ERR));
if (itemIndex < 0) {
if (doc.implementation.errorChecking) {
throw (new DOMException(DOMException.NOT_FOUND_ERR));
} else {
return;
}
}
// get Node
@@ -1573,9 +1577,13 @@ __extend__(NamedNodeMap.prototype, {
// get item index
var itemIndex = __findNamedItemNSIndex__(this, namespaceURI, localName);
// throw Exception if there is no matching node in this map
if (__ownerDocument__(this).implementation.errorChecking && (itemIndex < 0)) {
throw (new DOMException(DOMException.NOT_FOUND_ERR));
if (itemIndex < 0) {
// throw Exception if there is no matching node in this map
if (__ownerDocument__(this).implementation.errorChecking) {
throw (new DOMException(DOMException.NOT_FOUND_ERR));
} else {
return;
}
}
// get Node
@@ -1591,6 +1599,12 @@ __extend__(NamedNodeMap.prototype, {
// return removed node
return __removeChild__(this, itemIndex);
},
get value() {
return this.__value__ || '';
},
set value(attr) {
this.__value__ = attr;
},
get xml() {
var ret = "";
@@ -4683,6 +4697,17 @@ __extend__(Element.prototype, {
// delegate to NamedNodeMap.removeNamedItem
return this.attributes.removeNamedItem(name);
},
clearAttributes: function() {
for(i=0;i< this.attributes.length;i++){
this.removeAttribute(this.attributes[i].name);
}
},
mergeAttributes: function(src) {
var attrs = src.attributes;
for(i=0;i< attrs.length;i++){
this.setAttribute(attrs[i].name, attrs[i].value);
}
},
getAttributeNode : function getAttributeNode(name) {
// delegate to NamedNodeMap.getNamedItem
return this.attributes.getNamedItem(name);

0 comments on commit c3e702c

Please sign in to comment.