Bug 1444901 - Simplify setText() function in security.js. r=prathiksha
authorkanika <kanika16047@iiitd.ac.in>
Sun, 18 Mar 2018 00:46:58 +0530
changeset 408993 33563f005b67fd3dcad3503fb7bcd53002f593ee
parent 408992 9193e64cfe29d8df8e30d957b4f58785389d9ed5
child 408994 41097954197f73820cc1f38dbe1b2f3d7d03ce2d
push id33671
push usercsabou@mozilla.com
push dateTue, 20 Mar 2018 22:23:32 +0000
treeherdermozilla-central@e2e874ceae78 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersprathiksha
bugs1444901
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1444901 - Simplify setText() function in security.js. r=prathiksha MozReview-Commit-ID: HDKEz80aGCM
browser/base/content/pageinfo/security.js
--- 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);