Skip to content

Commit

Permalink
FIXED: qualifiedName/prefix calculation (now uses nodeName)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmpvar committed Jan 29, 2011
1 parent 8fb81df commit e967eb5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/jsdom/level2/core.js
Expand Up @@ -116,6 +116,10 @@ core.Node.prototype.__defineSetter__("prefix", function(value) {

ns.validate(value, this._namespaceURI);

if (this._localName) {
this._nodeName = value + ':' + this._localName;
}

this._prefix = value;
});

Expand Down Expand Up @@ -210,8 +214,8 @@ core.Node.prototype.__defineSetter__("qualifiedName", function(qualifiedName) {
ns.validate(qualifiedName, this._namespaceURI);
qualifiedName = qualifiedName || "";
this._localName = qualifiedName.split(":")[1] || null;
this.prefix = qualifiedName.split(":")[0] || null;
this._qualifiedName = qualifiedName;
this.prefix = qualifiedName.split(":")[0] || null;
this._nodeName = qualifiedName;
});

core.NamedNodeMap.prototype._map = function(fn) {
Expand Down Expand Up @@ -463,7 +467,7 @@ core.Document.prototype.createElementNS = function(/* string */ namespaceURI,
element = this.createElement(qualifiedName),

element._namespaceURI = namespaceURI;
element._qualifiedName = qualifiedName;
element._nodeName = qualifiedName;

element._localName = parts.pop();

Expand Down

0 comments on commit e967eb5

Please sign in to comment.