Skip to content

Commit

Permalink
envjs#24: jQuery 1.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
orslumen committed Apr 8, 2011
1 parent 44fb38d commit c3e702c
Showing 1 changed file with 30 additions and 5 deletions.
35 changes: 30 additions & 5 deletions envjs/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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 = "";

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit c3e702c

Please sign in to comment.