Permalink
Browse files

more fixing for staffNS.xml.js and readonly NameNodeMap stuff

  • Loading branch information...
1 parent b02faf7 commit 7246b08664e4ef8c75a6c7f56786ee71e9eaa9d8 @tmpvar tmpvar committed Jan 30, 2011
Showing with 10 additions and 0 deletions.
  1. +9 −0 lib/jsdom/level2/core.js
  2. +1 −0 test/level2/core/files/staffNS.xml.js
View
@@ -178,6 +178,10 @@ core.AttrNodeMap.prototype.setNamedItem = function(/* Node */ arg) {
core.NamedNodeMap.prototype.setNamedItemNS = function(/* Node */ arg)
{
+ if (this._readonly) {
+ throw new core.DOMException(core.NO_MODIFICATION_ALLOWED_ERR);
+ }
+
var owner = this._ownerDocument;
if (this._parentNode &&
this._parentNode._parentNode &&
@@ -190,6 +194,11 @@ core.NamedNodeMap.prototype.setNamedItemNS = function(/* Node */ arg)
throw new core.DOMException(core.HIERARCHY_REQUEST_ERR);
}
+ if (this._parentNode._ownerDocument !== arg.ownerDocument) {
+ throw new core.DOMException(core.WRONG_DOCUMENT_ERR);
+ }
+
+
if (arg._parentNode) {
throw new core.DOMException(core.INUSE_ATTRIBUTE_ERR);
}
@@ -93,6 +93,7 @@ exports.staffNS = function() {
staff.appendChild(employee);
employee.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns", "http://www.nist.gov");
+ employee.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:dmstc", "http://www.usa.com");
id.appendChild(doc.createTextNode("EMP0001"));
salary.appendChild(doc.createTextNode("56,000"));

0 comments on commit 7246b08

Please sign in to comment.