Skip to content

Commit

Permalink
Remove attributes bound via xbl:attr if they don't exist on the bound…
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Crutch committed Aug 24, 2011
1 parent 12e14f7 commit 8d05154
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions source/dom-xbl/ElementXBL.js
Expand Up @@ -67,10 +67,16 @@ cElementXBL.prototype.addBinding = function(sDocumentUri) {
if (aNames[1].indexOf(':' + "text") >-1)
oElement.setAttribute(aNames[0], this.textContent || this.innerText);
else
oElement.setAttribute(aNames[0], this.getAttribute(aNames[1]));
if (this.hasAttribute(aNames[1]))
oElement.setAttribute(aNames[0], this.getAttribute(aNames[1]));
else
oElement.removeAttribute(aNames[0]);
}
else
oElement.setAttribute(aNames[0], this.getAttribute(aNames[0]));
if (this.hasAttribute(aNames[0]))
oElement.setAttribute(aNames[0], this.getAttribute(aNames[0]));
else
oElement.removeAttribute(aNames[0]);
}
}
}
Expand Down Expand Up @@ -309,4 +315,4 @@ function fTemplateElement_getElementById(sId) {
}
return oElement;
})(this.firstChild));
};
};

0 comments on commit 8d05154

Please sign in to comment.