Bug 1098371 - Create localized version of sslv3 error page. r=mconley, a=sledru
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Fri, 19 Dec 2014 20:10:56 +0000
changeset 243033 e6cefc687439
parent 243032 f4e1d64f9ab9
child 243034 ea3b10634381
push id4368
push userryanvm@gmail.com
push date2015-01-26 15:37 +0000
treeherdermozilla-beta@e6cefc687439 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley, sledru
bugs1098371
milestone36.0
Bug 1098371 - Create localized version of sslv3 error page. r=mconley, a=sledru
browser/base/content/aboutNetError.xhtml
browser/themes/linux/jar.mn
browser/themes/osx/jar.mn
browser/themes/shared/aboutNetError.css
browser/themes/shared/aboutNetError_alert.svg
browser/themes/windows/jar.mn
--- a/browser/base/content/aboutNetError.xhtml
+++ b/browser/base/content/aboutNetError.xhtml
@@ -151,16 +151,40 @@
         var ld = document.getElementById("errorLongDesc");
         if (ld)
         {
           ld.parentNode.replaceChild(errDesc, ld);
           // change id to the replaced child's id so styling works
           errDesc.id = "errorLongDesc";
         }
 
+        if (err == "nssFailure2" &&
+            sd.textContent.contains("ssl_error_no_cypher_overlap")) {
+          var ssl3ErrorTitle = document.getElementById("et_ssl3");
+          var ssl3ErrorDesc = document.getElementById("ed_ssl3");
+          var ssl3ShortDesc = document.getElementById("esd_ssl3");
+          var learnMoreText = document.getElementById("learn_more_ssl3");
+
+          errTitle.parentNode.replaceChild(ssl3ErrorTitle, errTitle);
+          ssl3ErrorTitle.id = "errorTitleText";
+          ssl3ErrorTitle.setAttribute("sslv3", "true");
+          errTitle = ssl3ErrorTitle;
+
+          sd.innerHTML = ssl3ShortDesc.innerHTML;
+          sd.querySelector('span').textContent = location.hostname;
+
+          errDesc.parentNode.replaceChild(ssl3ErrorDesc, errDesc);
+          ssl3ErrorDesc.id = "errorLongDesc";
+          ssl3ErrorDesc.querySelector('span').textContent = "ssl_error_no_cypher_overlap";
+
+          var retryBtn = document.getElementById("errorTryAgain");
+          retryBtn.textContent = learnMoreText.textContent;
+          retryBtn.setAttribute("onclick", "learnMoreSSLV3()");
+        }
+
         // remove undisplayed errors to avoid bug 39098
         var errContainer = document.getElementById("errorContainer");
         errContainer.parentNode.removeChild(errContainer);
 
         var className = getCSSClass();
         if (className && className != "expertBadCert") {
           // Associate a CSS class with the root of the page, if one was passed in,
           // to allow custom styling.
@@ -189,17 +213,17 @@
         if (err == "cspBlocked") {
           // Remove the "Try again" button for CSP violations, since it's
           // almost certainly useless. (Bug 553180)
           document.getElementById("errorTryAgain").style.display = "none";
         }
 
         window.addEventListener("AboutNetErrorOptions", function(evt) {
         // Pinning errors are of type nssFailure2 (don't ask me why)
-          if (getErrorCode() == "nssFailure2") {
+          if (getErrorCode() == "nssFailure2" && !errTitle.hasAttribute("sslv3")) {
           // TODO: and the pref is set...
             var options = JSON.parse(evt.detail);
             if (options && options.enabled) {
               var checkbox = document.getElementById('automaticallyReportInFuture');
               showCertificateErrorReporting();
               if (options.automatic) {
                 // set the checkbox
                 checkbox.checked = true;
@@ -319,16 +343,21 @@
         if (endsWith(thisHost, "." + okHost))
           link.href = proto + okHost;
       }
 
       function endsWith(haystack, needle) {
         return haystack.slice(-needle.length) == needle;
       }
 
+      function learnMoreSSLV3() {
+        location.href = "https://support.mozilla.org/kb/how-resolve-sslv3-error-messages-firefox";
+        // Ensure users don't re-click the button:
+        e.target.disabled = true;
+      }
     ]]></script>
   </head>
 
   <body dir="&locale.dir;">
 
     <!-- ERROR ITEM CONTAINER (removed during loading to avoid bug 39098) -->
     <div id="errorContainer">
       <div id="errorTitlesContainer">
@@ -351,16 +380,17 @@
         <h1 id="et_contentEncodingError">&contentEncodingError.title;</h1>
         <h1 id="et_unsafeContentType">&unsafeContentType.title;</h1>
         <h1 id="et_nssFailure2">&nssFailure2.title;</h1>
         <h1 id="et_nssBadCert">&nssBadCert.title;</h1>
         <h1 id="et_malwareBlocked">&malwareBlocked.title;</h1>
         <h1 id="et_cspBlocked">&cspBlocked.title;</h1>
         <h1 id="et_remoteXUL">&remoteXUL.title;</h1>
         <h1 id="et_corruptedContentError">&corruptedContentError.title;</h1>
+        <h1 id="et_ssl3">&oldSecurityProtocol.title;</h1>
       </div>
       <div id="errorDescriptionsContainer">
         <div id="ed_generic">&generic.longDesc;</div>
         <div id="ed_dnsNotFound">&dnsNotFound.longDesc;</div>
         <div id="ed_fileNotFound">&fileNotFound.longDesc;</div>
         <div id="ed_malformedURI">&malformedURI.longDesc;</div>
         <div id="ed_unknownProtocolFound">&unknownProtocolFound.longDesc;</div>
         <div id="ed_connectionFailure">&connectionFailure.longDesc;</div>
@@ -377,16 +407,19 @@
         <div id="ed_contentEncodingError">&contentEncodingError.longDesc;</div>
         <div id="ed_unsafeContentType">&unsafeContentType.longDesc;</div>
         <div id="ed_nssFailure2">&nssFailure2.longDesc2;</div>
         <div id="ed_nssBadCert">&nssBadCert.longDesc2;</div>
         <div id="ed_malwareBlocked">&malwareBlocked.longDesc;</div>
         <div id="ed_cspBlocked">&cspBlocked.longDesc;</div>
         <div id="ed_remoteXUL">&remoteXUL.longDesc;</div>
         <div id="ed_corruptedContentError">&corruptedContentError.longDesc;</div>
+        <div id="esd_ssl3">&oldSecurityProtocol.longDesc2;</div>
+        <div id="ed_ssl3">&oldSecurityProtocol.advancedInfo;</div>
+        <div id="learn_more_ssl3">&oldSecurityProtocol.learnMore;</div>
       </div>
     </div>
 
     <!-- PAGE CONTAINER (for styling purposes only) -->
     <div id="errorPageContainer">
 
       <!-- Error Title -->
       <div id="errorTitle">
--- a/browser/themes/linux/jar.mn
+++ b/browser/themes/linux/jar.mn
@@ -10,16 +10,17 @@ browser.jar:
   skin/classic/browser/aboutSessionRestore-window-icon.png
   skin/classic/browser/aboutWelcomeBack.css                     (../shared/aboutWelcomeBack.css)
   skin/classic/browser/aboutCertError.css
   skin/classic/browser/aboutCertError_sectionCollapsed.png
   skin/classic/browser/aboutCertError_sectionCollapsed-rtl.png
   skin/classic/browser/aboutCertError_sectionExpanded.png
   skin/classic/browser/aboutNetError.css                        (../shared/aboutNetError.css)
   skin/classic/browser/aboutNetError_info.svg                   (../shared/aboutNetError_info.svg)
+  skin/classic/browser/aboutNetError_alert.svg                  (../shared/aboutNetError_alert.svg)
   skin/classic/browser/aboutSocialError.css                     (../shared/aboutSocialError.css)
 * skin/classic/browser/aboutProviderDirectory.css               (../shared/aboutProviderDirectory.css)
 #ifdef MOZ_SERVICES_SYNC
   skin/classic/browser/aboutSyncTabs.css
 #endif
   skin/classic/browser/aboutTabCrashed.css
   skin/classic/browser/actionicon-tab.png
 * skin/classic/browser/browser.css
--- a/browser/themes/osx/jar.mn
+++ b/browser/themes/osx/jar.mn
@@ -2,16 +2,17 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 browser.jar:
 % skin browser classic/1.0 %skin/classic/browser/
   skin/classic/browser/sanitizeDialog.css                   (sanitizeDialog.css)
   skin/classic/browser/aboutNetError.css                    (../shared/aboutNetError.css)
   skin/classic/browser/aboutNetError_info.svg               (../shared/aboutNetError_info.svg)
+  skin/classic/browser/aboutNetError_alert.svg              (../shared/aboutNetError_alert.svg)
 * skin/classic/browser/aboutSessionRestore.css              (aboutSessionRestore.css)
   skin/classic/browser/aboutSessionRestore-window-icon.png
   skin/classic/browser/aboutWelcomeBack.css                 (../shared/aboutWelcomeBack.css)
   skin/classic/browser/aboutCertError.css
   skin/classic/browser/aboutCertError_sectionCollapsed.png
   skin/classic/browser/aboutCertError_sectionCollapsed-rtl.png
   skin/classic/browser/aboutCertError_sectionExpanded.png
   skin/classic/browser/aboutSocialError.css                 (../shared/aboutSocialError.css)
--- a/browser/themes/shared/aboutNetError.css
+++ b/browser/themes/shared/aboutNetError.css
@@ -38,16 +38,20 @@ ul {
   -moz-margin-start: -2em;
   -moz-padding-start: 2em;
 }
 
 #errorTitleText:-moz-dir(rtl) {
   background-position: right 0;
 }
 
+#errorTitleText[sslv3=true] {
+  background-image: url("aboutNetError_alert.svg");
+}
+
 #errorTryAgain {
   margin-top: 1.2em;
   min-width: 150px
 }
 
 #errorContainer {
   display: none;
 }
new file mode 100644
--- /dev/null
+++ b/browser/themes/shared/aboutNetError_alert.svg
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 40 40" enable-background="new 0 0 40 40" xml:space="preserve">
+<g>
+	<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="20" y1="4" x2="20" y2="36">
+		<stop offset="0" style="stop-color:#E63B2E"/>
+		<stop offset="1" style="stop-color:#C33931"/>
+	</linearGradient>
+	<path fill="url(#SVGID_1_)" d="M13.373,4L4,13.372v13.256L13.373,36h13.255L36,26.628V13.372L26.627,4H13.373z M22.176,8.704   l-0.48,14.304h-3.424L17.76,8.704H22.176z M20,31.296c-1.44,0-2.592-1.184-2.592-2.592c0-1.44,1.152-2.592,2.592-2.592   c1.472,0,2.592,1.152,2.592,2.592C22.592,30.112,21.472,31.296,20,31.296z"/>
+	<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="20" y1="-3.728928e-10" x2="20" y2="40">
+		<stop offset="0" style="stop-color:#E63B2E"/>
+		<stop offset="1" style="stop-color:#C33931"/>
+	</linearGradient>
+	<path fill="url(#SVGID_2_)" d="M28.284,0H11.716L0,11.716v16.569L11.716,40h16.569L40,28.284V11.716L28.284,0z M38,27.456   L27.456,38H12.544L2,27.456V12.544L12.544,2h14.911L38,12.544V27.456z"/>
+</g>
+</svg>
--- a/browser/themes/windows/jar.mn
+++ b/browser/themes/windows/jar.mn
@@ -12,16 +12,17 @@ browser.jar:
         skin/classic/browser/aboutSessionRestore-window-icon.png     (preferences/application.png)
         skin/classic/browser/aboutWelcomeBack.css                    (../shared/aboutWelcomeBack.css)
         skin/classic/browser/aboutCertError.css
         skin/classic/browser/aboutCertError_sectionCollapsed.png
         skin/classic/browser/aboutCertError_sectionCollapsed-rtl.png
         skin/classic/browser/aboutCertError_sectionExpanded.png
         skin/classic/browser/aboutNetError.css                       (../shared/aboutNetError.css)
         skin/classic/browser/aboutNetError_info.svg                  (../shared/aboutNetError_info.svg)
+        skin/classic/browser/aboutNetError_alert.svg                 (../shared/aboutNetError_alert.svg)
         skin/classic/browser/aboutSocialError.css                    (../shared/aboutSocialError.css)
 *       skin/classic/browser/aboutProviderDirectory.css              (../shared/aboutProviderDirectory.css)
 #ifdef MOZ_SERVICES_SYNC
         skin/classic/browser/aboutSyncTabs.css
 #endif
         skin/classic/browser/aboutTabCrashed.css
         skin/classic/browser/actionicon-tab.png
 *       skin/classic/browser/browser.css
@@ -459,16 +460,17 @@ browser.jar:
 *       skin/classic/aero/browser/aboutSessionRestore.css            (aboutSessionRestore.css)
         skin/classic/aero/browser/aboutSessionRestore-window-icon.png (aboutSessionRestore-window-icon-aero.png)
         skin/classic/aero/browser/aboutCertError.css
         skin/classic/aero/browser/aboutCertError_sectionCollapsed.png
         skin/classic/aero/browser/aboutCertError_sectionCollapsed-rtl.png
         skin/classic/aero/browser/aboutCertError_sectionExpanded.png
         skin/classic/aero/browser/aboutNetError.css                   (../shared/aboutNetError.css)
         skin/classic/aero/browser/aboutNetError_info.svg              (../shared/aboutNetError_info.svg)
+        skin/classic/aero/browser/aboutNetError_alert.svg             (../shared/aboutNetError_alert.svg)
         skin/classic/aero/browser/aboutSocialError.css                (../shared/aboutSocialError.css)
 *       skin/classic/aero/browser/aboutProviderDirectory.css          (../shared/aboutProviderDirectory.css)
 #ifdef MOZ_SERVICES_SYNC
         skin/classic/aero/browser/aboutSyncTabs.css
 #endif
         skin/classic/aero/browser/aboutTabCrashed.css
         skin/classic/aero/browser/aboutWelcomeBack.css               (../shared/aboutWelcomeBack.css)
         skin/classic/aero/browser/actionicon-tab.png