Bug 565508 - Remove the ugly hacks for copying the right thing from about:privatebrowsing once bug 39098 is fixed; r=dao
authorEhsan Akhgari <ehsan@mozilla.com>
Thu, 27 May 2010 20:34:06 -0400
changeset 42902 b84dd5c2cb1843a4246a191edeeb0d183ca6299b
parent 42901 8893eef77dcdbed6056b9ec3973fb6679d84f375
child 42903 09eee26d01241916df2c2ab15015ff5f50e8b433
push idunknown
push userunknown
push dateunknown
reviewersdao
bugs565508, 39098
milestone1.9.3a5pre
Bug 565508 - Remove the ugly hacks for copying the right thing from about:privatebrowsing once bug 39098 is fixed; r=dao
browser/components/privatebrowsing/content/aboutPrivateBrowsing.xhtml
--- a/browser/components/privatebrowsing/content/aboutPrivateBrowsing.xhtml
+++ b/browser/components/privatebrowsing/content/aboutPrivateBrowsing.xhtml
@@ -48,16 +48,22 @@
   <!ENTITY % privatebrowsingpageDTD SYSTEM "chrome://browser/locale/aboutPrivateBrowsing.dtd">
   %privatebrowsingpageDTD;
 ]>
 
 <html xmlns="http://www.w3.org/1999/xhtml">
   <head>
     <link rel="stylesheet" href="chrome://global/skin/netError.css" type="text/css" media="all"/>
     <link rel="stylesheet" href="chrome://browser/skin/aboutPrivateBrowsing.css" type="text/css" media="all"/>
+    <style type="text/css"><![CDATA[
+      body.normal .showPrivate,
+      body.private .showNormal {
+        display: none;
+      }
+    ]]></style>
     <script type="application/javascript;version=1.7"><![CDATA[
       const Cc = Components.classes;
       const Ci = Components.interfaces;
 
       var pb = Cc["@mozilla.org/privatebrowsing;1"].
                getService(Ci.nsIPrivateBrowsingService);
 
       if (!pb.privateBrowsingEnabled) {
@@ -91,29 +97,19 @@
         icon.setAttribute("rel", "icon");
         icon.setAttribute("type", "image/png");
         icon.setAttribute("href", url);
         var head = document.getElementsByTagName("head")[0];
         head.insertBefore(icon, head.firstChild);
       }
 
       document.addEventListener("DOMContentLoaded", function () {
-        let selector;
         if (!pb.privateBrowsingEnabled) {
           document.body.setAttribute("class", "normal");
-          selector = ".showPrivate";
         }
-        else {
-          selector = ".showNormal";
-        }
-
-        // Remove hidden elements to avoid bug 39098
-        let elements = document.body.querySelectorAll(selector);
-        for (let i = 0; i < elements.length; ++ i)
-          elements[i].parentNode.removeChild(elements[i]);
 
         // Set up the help link
         let moreInfoURL = Cc["@mozilla.org/toolkit/URLFormatterService;1"].
                           getService(Ci.nsIURLFormatter).
                           formatURLPref("app.support.baseURL");
         let moreInfoLink = document.getElementById("moreInfoLink");
         if (moreInfoLink)
           moreInfoLink.setAttribute("href", moreInfoURL + "private-browsing");