Bug 968509 - Move about:certerror from components to content. r=Unfocused
authorValentin Tsatskin <vtsatskin@mozilla.com>
Thu, 03 Apr 2014 00:39:02 -0700
changeset 176995 8ce0aa12e00c80e90ef938de9bb916d565a092a2
parent 176994 c4dbb3c39b33f590679923d5521f9cfa462a6cfe
child 176996 24f5a463b606b389effc04879c5a70f53dcd4b11
push idunknown
push userunknown
push dateunknown
reviewersUnfocused
bugs968509
milestone31.0a1
Bug 968509 - Move about:certerror from components to content. r=Unfocused
browser/base/content/aboutcerterror/aboutCertError.css
browser/base/content/aboutcerterror/aboutCertError.xhtml
browser/base/content/test/general/browser.ini
browser/base/content/test/general/browser_bug431826.js
browser/base/content/test/general/browser_bug633691.js
browser/base/jar.mn
browser/components/certerror/content/aboutCertError.css
browser/components/certerror/content/aboutCertError.xhtml
browser/components/certerror/jar.mn
browser/components/certerror/moz.build
browser/components/certerror/test/browser.ini
browser/components/certerror/test/browser_bug431826.js
browser/components/certerror/test/browser_bug633691.js
browser/components/moz.build
rename from browser/components/certerror/content/aboutCertError.css
rename to browser/base/content/aboutcerterror/aboutCertError.css
rename from browser/components/certerror/content/aboutCertError.xhtml
rename to browser/base/content/aboutcerterror/aboutCertError.xhtml
--- a/browser/components/certerror/content/aboutCertError.xhtml
+++ b/browser/base/content/aboutcerterror/aboutCertError.xhtml
@@ -74,87 +74,87 @@
         function replaceWithHost(node) {
           if (node.textContent == "#1")
             node.textContent = location.host;
           else
             for(var i = 0; i < node.childNodes.length; i++)
               replaceWithHost(node.childNodes[i]);
         };
         replaceWithHost(intro);
-        
+
         if (getCSSClass() == "expertBadCert") {
           toggle('technicalContent');
           toggle('expertContent');
         }
 
         // Disallow overrides if this is a Strict-Transport-Security
         // host and the cert is bad (STS Spec section 7.3) or if the
         // certerror is in a frame (bug 633691).
         if (getCSSClass() == "badStsCert" || window != top)
           document.getElementById("expertContent").setAttribute("hidden", "true");
-        
+
         var tech = document.getElementById("technicalContentText");
         if (tech)
           tech.textContent = getDescription();
-        
+
         addDomainErrorLink();
       }
-      
+
       /* In the case of SSL error pages about domain mismatch, see if
          we can hyperlink the user to the correct site.  We don't want
          to do this generically since it allows MitM attacks to redirect
          users to a site under attacker control, but in certain cases
          it is safe (and helpful!) to do so.  Bug 402210
       */
       function addDomainErrorLink() {
         // Rather than textContent, we need to treat description as HTML
         var sd = document.getElementById("technicalContentText");
         if (sd) {
           var desc = getDescription();
-          
+
           // sanitize description text - see bug 441169
-          
+
           // First, find the index of the <a> tag we care about, being careful not to
           // use an over-greedy regex
           var re = /<a id="cert_domain_link" title="([^"]+)">/;
           var result = re.exec(desc);
           if(!result)
             return;
-          
+
           // Remove sd's existing children
           sd.textContent = "";
 
           // Everything up to the link should be text content
           sd.appendChild(document.createTextNode(desc.slice(0, result.index)));
-          
+
           // Now create the link itself
           var anchorEl = document.createElement("a");
           anchorEl.setAttribute("id", "cert_domain_link");
           anchorEl.setAttribute("title", result[1]);
           anchorEl.appendChild(document.createTextNode(result[1]));
           sd.appendChild(anchorEl);
-          
+
           // Finally, append text for anything after the closing </a>
           sd.appendChild(document.createTextNode(desc.slice(desc.indexOf("</a>") + "</a>".length)));
         }
 
         var link = document.getElementById('cert_domain_link');
         if (!link)
           return;
-        
+
         var okHost = link.getAttribute("title");
         var thisHost = document.location.hostname;
         var proto = document.location.protocol;
 
         // If okHost is a wildcard domain ("*.example.com") let's
         // use "www" instead.  "*.example.com" isn't going to
         // get anyone anywhere useful. bug 432491
         okHost = okHost.replace(/^\*\./, "www.");
 
-        /* case #1: 
+        /* case #1:
          * example.com uses an invalid security certificate.
          *
          * The certificate is only valid for www.example.com
          *
          * Make sure to include the "." ahead of thisHost so that
          * a MitM attack on paypal.com doesn't hyperlink to "notpaypal.com"
          *
          * We'd normally just use a RegExp here except that we lack a
@@ -167,23 +167,23 @@
 
         /* case #2:
          * browser.garage.maemo.org uses an invalid security certificate.
          *
          * The certificate is only valid for garage.maemo.org
          */
         if (endsWith(thisHost, "." + okHost))
           link.href = proto + okHost;
-          
+
         // If we set a link, meaning there's something helpful for
         // the user here, expand the section by default
         if (link.href && getCSSClass() != "expertBadCert")
           toggle("technicalContent");
       }
-      
+
       function endsWith(haystack, needle) {
         return haystack.slice(-needle.length) == needle;
       }
 
       function toggle(id) {
         var el = document.getElementById(id);
         if (el.getAttribute("collapsed"))
           el.removeAttribute("collapsed");
@@ -192,44 +192,44 @@
       }
     ]]></script>
   </head>
 
   <body dir="&locale.dir;">
 
     <!-- PAGE CONTAINER (for styling purposes only) -->
     <div id="errorPageContainer">
-    
+
       <!-- Error Title -->
       <div id="errorTitle">
         <h1 id="errorTitleText">&certerror.longpagetitle;</h1>
       </div>
-      
+
       <!-- LONG CONTENT (the section most likely to require scrolling) -->
       <div id="errorLongContent">
         <div id="introContent">
           <p id="introContentP1">&certerror.introPara1;</p>
           <p>&certerror.introPara2;</p>
         </div>
-        
+
         <div id="whatShouldIDoContent">
           <h2>&certerror.whatShouldIDo.heading;</h2>
           <div id="whatShouldIDoContentText">
             <p>&certerror.whatShouldIDo.content;</p>
             <button id='getMeOutOfHereButton'>&certerror.getMeOutOfHere.label;</button>
           </div>
         </div>
-        
+
         <!-- The following sections can be unhidden by default by setting the
              "browser.xul.error_pages.expert_bad_cert" pref to true -->
         <h2 id="technicalContent" class="expander" collapsed="true">
           <button onclick="toggle('technicalContent');">&certerror.technical.heading;</button>
         </h2>
         <p id="technicalContentText"/>
-        
+
         <h2 id="expertContent" class="expander" collapsed="true">
           <button onclick="toggle('expertContent');">&certerror.expert.heading;</button>
         </h2>
         <div>
           <p>&certerror.expert.content;</p>
           <p>&certerror.expert.contentPara2;</p>
           <button id='exceptionDialogButton'>&certerror.addException.label;</button>
         </div>
--- a/browser/base/content/test/general/browser.ini
+++ b/browser/base/content/test/general/browser.ini
@@ -122,16 +122,18 @@ skip-if = e10s # Bug ?????? - no about:h
 skip-if = e10s # Bug 691614 - no e10s zoom support yet
 [browser_bug422590.js]
 [browser_bug423833.js]
 skip-if = true # bug 428712
 [browser_bug424101.js]
 skip-if = e10s # Bug ?????? - test directly manipulates content
 [browser_bug427559.js]
 skip-if = e10s # Bug ?????? - "content window is focused - Got [object ChromeWindow], expected [object XrayWrapper [object Window]]"
+[browser_bug431826.js]
+skip-if = e10s # Bug ?????? - test directly manipulates content (eg, var expertDiv = gBrowser.contentDocument.getElementById("expertContent");)
 [browser_bug432599.js]
 [browser_bug435035.js]
 [browser_bug435325.js]
 skip-if = e10s # Bug ?????? - test directly manipulates content
 [browser_bug441778.js]
 skip-if = e10s # Bug 691614 - no e10s zoom support yet
 [browser_bug455852.js]
 [browser_bug460146.js]
@@ -220,16 +222,18 @@ skip-if = e10s # Bug 691601 - no form su
 skip-if = e10s # Bug 921905 - pinTab/unpinTab fail in e10s
 [browser_bug609700.js]
 skip-if = e10s # Bug 516755 - SessionStore disabled for e10s (calls duplicateTabIn, which uses SessionStore)
 [browser_bug623155.js]
 skip-if = e10s # Bug ?????? - URLBar issues (apparently issues with redirection)
 [browser_bug623893.js]
 skip-if = e10s # Bug 916974 - Session history doesn't work in e10s
 [browser_bug624734.js]
+[browser_bug633691.js]
+skip-if = e10s # Bug ?????? - test directly manipulates content (eg, var expertDiv = gBrowser.contentDocument.getElementById("expertContent");)
 [browser_bug647886.js]
 skip-if = e10s # Bug 916974 - Session history doesn't work in e10s
 [browser_bug655584.js]
 [browser_bug664672.js]
 [browser_bug676619.js]
 skip-if = os == "mac" || e10s # mac: Intermittent failures, bug 925225; e10s: Bug ?????? - test directly manipulates content (event.target.location)
 [browser_bug678392.js]
 skip-if = e10s # Bug ?????? - Obscure non-windows failures ("Snapshot array has correct length of 1 after loading one page. - Got 0, expected 1" and more)
rename from browser/components/certerror/test/browser_bug431826.js
rename to browser/base/content/test/general/browser_bug431826.js
rename from browser/components/certerror/test/browser_bug633691.js
rename to browser/base/content/test/general/browser_bug633691.js
--- a/browser/base/jar.mn
+++ b/browser/base/jar.mn
@@ -58,16 +58,19 @@ browser.jar:
         content/browser/aboutaccounts/fonts.css                               (content/aboutaccounts/fonts.css)
         content/browser/aboutaccounts/fonts/clearsans-regular.woff            (content/aboutaccounts/fonts/clearsans-regular.woff)
         content/browser/aboutaccounts/fonts/firasans-light.woff               (content/aboutaccounts/fonts/firasans-light.woff)
         content/browser/aboutaccounts/fonts/firasans-regular.woff             (content/aboutaccounts/fonts/firasans-regular.woff)
         content/browser/aboutaccounts/images/fox.png                          (content/aboutaccounts/images/fox.png)
         content/browser/aboutaccounts/images/graphic_sync_intro.png           (content/aboutaccounts/images/graphic_sync_intro.png)
         content/browser/aboutaccounts/images/graphic_sync_intro@2x.png        (content/aboutaccounts/images/graphic_sync_intro@2x.png)
 
+        content/browser/certerror/aboutCertError.xhtml     (content/aboutcerterror/aboutCertError.xhtml)
+        content/browser/certerror/aboutCertError.css       (content/aboutcerterror/aboutCertError.css)
+
         content/browser/aboutRobots-icon.png          (content/aboutRobots-icon.png)
         content/browser/aboutRobots-widget-left.png   (content/aboutRobots-widget-left.png)
         content/browser/aboutSocialError.xhtml        (content/aboutSocialError.xhtml)
         content/browser/aboutTabCrashed.js            (content/aboutTabCrashed.js)
         content/browser/aboutTabCrashed.xhtml         (content/aboutTabCrashed.xhtml)
 *       content/browser/browser.css                   (content/browser.css)
 *       content/browser/browser.js                    (content/browser.js)
 *       content/browser/browser.xul                   (content/browser.xul)
deleted file mode 100644
--- a/browser/components/certerror/jar.mn
+++ /dev/null
@@ -1,7 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# 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:
-  content/browser/certerror/aboutCertError.xhtml               (content/aboutCertError.xhtml)
-  content/browser/certerror/aboutCertError.css                 (content/aboutCertError.css)
deleted file mode 100644
--- a/browser/components/certerror/moz.build
+++ /dev/null
@@ -1,11 +0,0 @@
-# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# 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_CHROME_MANIFESTS += [
-    'test/browser.ini',
-]
-
-JAR_MANIFESTS += ['jar.mn']
\ No newline at end of file
deleted file mode 100644
--- a/browser/components/certerror/test/browser.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[DEFAULT]
-skip-if = e10s # Bug ?????? - tests directly manipulate content (eg, var expertDiv = gBrowser.contentDocument.getElementById("expertContent");)
-
-[browser_bug431826.js]
-[browser_bug633691.js]
--- a/browser/components/moz.build
+++ b/browser/components/moz.build
@@ -1,17 +1,16 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # 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/.
 
 PARALLEL_DIRS += [
     'about',
-    'certerror',
     'customizableui',
     'dirprovider',
     'downloads',
     'feeds',
     'places',
     'preferences',
     'privatebrowsing',
     'search',
@@ -44,9 +43,8 @@ EXTRA_JS_MODULES += [
 ]
 
 BROWSER_CHROME_MANIFESTS += [
     'test/browser.ini'
 ]
 
 if CONFIG['MOZ_SAFE_BROWSING']:
     BROWSER_CHROME_MANIFESTS += ['safebrowsing/content/test/browser.ini']
-