Bug 697750 - Follow-up: replace about:home sync "links" (actually buttons) with links. r=gavin.sharp
authorChenxia Liu <liuche@mozilla.com>
Fri, 28 Oct 2011 15:00:48 -0700
changeset 80234 9215e529ae7a1ab7ab1cb6e0eb86c7bad2a2c0e7
parent 80233 22b52ebe83e608e397558770aa30c31d50509df6
child 80235 d23278e1fe195f83285444b1cc821dc2a55e70b4
push id506
push userclegnitto@mozilla.com
push dateWed, 09 Nov 2011 02:03:18 +0000
treeherdermozilla-aurora@63587fc7bb93 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgavin
bugs697750
milestone10.0a1
Bug 697750 - Follow-up: replace about:home sync "links" (actually buttons) with links. r=gavin.sharp
browser/base/content/aboutHome.css
browser/base/content/aboutHome.xhtml
browser/base/content/browser.js
--- a/browser/base/content/aboutHome.css
+++ b/browser/base/content/aboutHome.css
@@ -368,34 +368,17 @@ body[dir=rtl] #restorePreviousSession::b
   text-align: center;
   bottom: 2%;
 }
 
 #syncLinksContainer {
   padding-top: 1em;
 }
 
-/* Hack to make buttons appear as links. Necessary to piggyback on browser.js
- * OnBrowserClick listener, which checks that click originates from a button.
- */
 .sync-link {
-  -moz-appearance: none;
-  outline: none;
-  border: none;
-  color: -moz-hyperlinktext;
-  background-color: transparent;
-}
-
-.sync-link:hover {
-  color: -moz-activehyperlinktext;
-  text-decoration: underline;
-  cursor: pointer;
-}
-
-.sync-link:active {
-  padding: 0px 6px 0px 6px;
+  padding: 1em;
 }
 
 @media all and (max-height: 370px) {
   #bottomSection {
     visibility: hidden;
   }
 }
--- a/browser/base/content/aboutHome.xhtml
+++ b/browser/base/content/aboutHome.xhtml
@@ -98,14 +98,14 @@
       </div>
     </div>
 
     <div id="bottomSection">
       <div id="aboutMozilla">
         <a href="http://www.mozilla.com/about/">&abouthome.aboutMozilla;</a>
       </div>
       <div id="syncLinksContainer">
-        <button class="sync-link" id="setupSyncLink">&abouthome.syncSetup.label;</button>
-        <button class="sync-link" id="pairDeviceLink">&abouthome.pairDevice.label;</button>
+        <a href="javascript:void(0);" class="sync-link" id="setupSyncLink">&abouthome.syncSetup.label;</a>
+        <a href="javascript:void(0);" class="sync-link" id="pairDeviceLink">&abouthome.pairDevice.label;</a>
       </div>
     </div>
   </body>
 </html>
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -2682,17 +2682,19 @@ function BrowserOnAboutPageLoad(document
   }
 }
 
 /**
  * Handle command events bubbling up from error page content
  */
 function BrowserOnClick(event) {
     // Don't trust synthetic events
-    if (!event.isTrusted || event.target.localName != "button")
+    if (!event.isTrusted ||
+        (event.target.localName != "button" &&
+         event.target.className != "sync-link"))
       return;
 
     var ot = event.originalTarget;
     var errorDoc = ot.ownerDocument;
 
     // If the event came from an ssl error page, it is probably either the "Add
     // Exception…" or "Get me out of here!" button
     if (/^about:certerror/.test(errorDoc.documentURI)) {