Bug 1535786 - Fix the missing current date. r=johannh
authorCarolina Jimenez Gomez <carolina.jimenez.g@gmail.com>
Wed, 27 Mar 2019 11:13:26 +0000
changeset 466432 1fff0c2e7990094e7dc04ce03d565b6b287c9dc0
parent 466431 4d9740676fab3043128e1b04e23b1c784f4e61b3
child 466433 c1d1576431d7d3a6e1a394ca52f2802343038258
push id35768
push useropoprus@mozilla.com
push dateThu, 28 Mar 2019 09:55:54 +0000
treeherdermozilla-central@c045dd97faf2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjohannh
bugs1535786
milestone68.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 1535786 - Fix the missing current date. r=johannh The solution is to get which of all the errors is being shown in the web page, we can know that resting msg.data.code with the bases and getting which is the name of the parent div where we need to put the date on its child with id="wrongSystemTime_systemDate2". Differential Revision: https://phabricator.services.mozilla.com/D24363
browser/actors/NetErrorChild.jsm
--- a/browser/actors/NetErrorChild.jsm
+++ b/browser/actors/NetErrorChild.jsm
@@ -58,17 +58,16 @@ const SSL_ERROR_BAD_CERT_DOMAIN = SSL_ER
 const SSL_ERROR_SSL_DISABLED  = SSL_ERROR_BASE + 20;
 const SSL_ERROR_SSL2_DISABLED  = SSL_ERROR_BASE + 14;
 
 const PREF_SERVICES_SETTINGS_CLOCK_SKEW_SECONDS = "services.settings.clock_skew_seconds";
 const PREF_SERVICES_SETTINGS_LAST_FETCHED       = "services.settings.last_update_seconds";
 
 const PREF_SSL_IMPACT_ROOTS = ["security.tls.version.", "security.ssl3."];
 
-
 function getSerializedSecurityInfo(docShell) {
   let serhelper = Cc["@mozilla.org/network/serialization-helper;1"]
                     .getService(Ci.nsISerializationHelper);
 
   let securityInfo = docShell.failedChannel && docShell.failedChannel.securityInfo;
   if (!securityInfo) {
     return "";
   }
@@ -594,17 +593,20 @@ class NetErrorChild extends ActorChild {
           if (desc) {
             // eslint-disable-next-line no-unsanitized/property
             desc.innerHTML = clockErrDesc.innerHTML;
           }
           let errorPageContainer = doc.getElementById("errorPageContainer");
           let textContainer = doc.getElementById("text-container");
           errorPageContainer.style.backgroundPosition = `left top calc(50vh - ${textContainer.clientHeight / 2}px)`;
         } else {
-          doc.getElementById("wrongSystemTime_systemDate2").textContent = systemDate;
+          let targetElems = doc.querySelectorAll("#wrongSystemTime_systemDate2");
+          for (let elem of targetElems) {
+            elem.textContent = systemDate;
+          }
 
           let errDesc = doc.getElementById("ed_nssBadCert_SEC_ERROR_EXPIRED_CERTIFICATE");
           let sd = doc.getElementById("errorShortDescText");
           // eslint-disable-next-line no-unsanitized/property
           sd.innerHTML = errDesc.innerHTML;
 
           let span = sd.querySelector(".hostname");
           span.textContent = doc.location.hostname;