Bug 1444901 - Simplify setText() function in security.js. r?prathiksha
MozReview-Commit-ID: HDKEz80aGCM
--- a/browser/base/content/pageinfo/security.js
+++ b/browser/base/content/pageinfo/security.js
@@ -289,20 +289,17 @@ function securityOnLoad(uri, windowInfo)
function setText(id, value) {
var element = document.getElementById(id);
if (!element)
return;
if (element.localName == "textbox" || element.localName == "label")
element.value = value;
else {
- if (element.hasChildNodes())
- element.firstChild.remove();
- var textNode = document.createTextNode(value);
- element.appendChild(textNode);
+ element.textContent = value;
}
}
function viewCertHelper(parent, cert) {
if (!cert)
return;
var cd = Cc[CERTIFICATEDIALOGS_CONTRACTID].getService(nsICertificateDialogs);