Bug 1172987 - Incorrect padding for various locales. r=Mardak.
authorMarina Samuel <msamuel@mozilla.com>
Thu, 11 Jun 2015 14:09:13 -0400
changeset 267955 e7c0ddb5f948b86ceaf28c1b23ed596affeec12a
parent 267954 ab13fee627df98e881162949f12de47b5f6b66d1
child 267956 b3a00a0a6ef4c2dd4d735ffe46da6eb65c446d31
push id8157
push userjlund@mozilla.com
push dateMon, 29 Jun 2015 20:36:23 +0000
treeherdermozilla-aurora@d480e05bd276 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMardak
bugs1172987
milestone41.0a1
Bug 1172987 - Incorrect padding for various locales. r=Mardak.
browser/base/content/newtab/intro.js
browser/base/content/newtab/newTab.css
--- a/browser/base/content/newtab/intro.js
+++ b/browser/base/content/newtab/intro.js
@@ -142,20 +142,24 @@ let gIntro = {
   },
 
   _generateImages: function() {
     Object.keys(this._imageTypes).forEach(type => {
       let image = "";
       let imageClass = "";
       switch (this._imageTypes[type]) {
         case this._imageTypes.COG:
-          image = document.getElementById("newtab-customize-panel").cloneNode(true);
-          image.removeAttribute("hidden");
-          image.removeAttribute("type");
+          // Copy the customize panel's subnodes over so that it can be styled
+          // appropriately for the intro.
+          image = document.createElementNS(HTML_NAMESPACE, "div");
           image.classList.add("newtab-intro-image-customize");
+          let imageToCopy = document.getElementById("newtab-customize-panel").cloneNode(true);
+          while (imageToCopy.firstChild) {
+            image.appendChild(imageToCopy.firstChild);
+          }
           break;
         case this._imageTypes.PIN_REMOVE:
           imageClass = "-hover";
           // fall-through
         case this._imageTypes.SUGGESTED:
           image = document.createElementNS(HTML_NAMESPACE, "div");
           image.classList.add("newtab-intro-cell-wrapper");
 
--- a/browser/base/content/newtab/newTab.css
+++ b/browser/base/content/newtab/newTab.css
@@ -473,45 +473,47 @@ input[type=button] {
   margin-top: -5px;
   min-width: 270px;
 }
 
 #newtab-customize-title {
   color: #7A7A7A;
   font-size: 14px;
   background-color: #FFFFFF;
-  height: 52px;
-  line-height: 52px;
-  padding-left: 15px;
+  line-height: 25px;
+  padding: 15px;
   font-weight: 600;
   cursor: default;
   border-radius: 5px 5px 0px 0px;
+  max-width: 300px;
+  overflow: hidden;
+  display: table-cell;
 }
 
 #newtab-customize-title > label {
   cursor: default;
 }
 
 #newtab-customize-panel > .panel-arrowcontainer > .panel-arrowcontent,
 #newtab-search-panel > .panel-arrowcontainer > .panel-arrowcontent {
   padding: 0;
 }
 
 .newtab-customize-panel-item,
 .newtab-search-panel-engine,
 #newtab-search-manage {
-  line-height: 54px;
-  padding-left: 40px;
+  line-height: 25px;
+  padding: 15px 15px 15px 40px;
   font-size: 14px;
   cursor: pointer;
 }
 
-.newtab-customize-panel-item:not(:last-child),
+.newtab-customize-panel-item:not(:first-child),
 .newtab-search-panel-engine {
-  border-bottom: 1px solid threedshadow;
+  border-top: 1px solid threedshadow;
 }
 
 .newtab-search-panel-engine > image {
   -moz-margin-end: 8px;
   width: 16px;
   height: 16px;
   list-style-image: url("chrome://mozapps/skin/places/defaultFavicon.png");
 }
@@ -524,16 +526,25 @@ input[type=button] {
   padding: 0;
   margin: 0;
   cursor: pointer;
 }
 
 .newtab-customize-panel-item,
 .newtab-customize-complex-option {
   width: 100%;
+  display: block;
+  text-align: left;
+  max-width: 300px;
+  background-color: #F9F9F9;
+}
+
+.newtab-intro-image-customize .newtab-customize-panel-item,
+.newtab-intro-image-customize .newtab-customize-complex-option {
+  max-width: 100%;
 }
 
 .newtab-customize-panel-item:not([selected]),
 .newtab-customize-panel-subitem:not([selected]){
   color: #7A7A7A;
 }
 
 .newtab-customize-panel-item:not([selected]):hover {
@@ -573,29 +584,32 @@ input[type=button] {
   background: url("chrome://global/skin/menu/shared-menu-check-black.svg") no-repeat #FFFFFF;
   background-size: 9px 9px;
   background-position: center;
   color: #333333;
 }
 
 .newtab-customize-panel-subitem {
   font-size: 12px;
-  padding-left: 40px;
-  padding-bottom: 15px;
-  border-bottom: 1px solid threedshadow;
+  padding: 0px 15px 15px 40px;
+  display: block;
 }
 
 .newtab-customize-panel-subitem > label {
   padding-left: 10px;
+  line-height: 20px;
+  vertical-align: middle;
+  max-width: 225px;
 }
 
 .newtab-customize-panel-superitem {
-  line-height: 14px;
+  line-height: 20px;
   border-bottom: medium none !important;
-  padding: 15px 0px 10px 40px;
+  padding: 15px 15px 10px 40px;
+  border-top: 1px solid threedshadow;
 }
 
 .searchSuggestionTable {
   font: message-box;
   font-size: 16px;
 }
 
 /**
@@ -609,45 +623,50 @@ input[type=button] {
   width: 100%;
   height: 100%;
   background: #424F5A;
   z-index:102;
   background-color: rgba(66,79,90,0.95);
   transition: opacity .5s linear;
   overflow: auto;
   display: none;
+  text-align: center;
 }
 
 #newtab-intro-modal {
   font-family: "Helvetica";
-  width: 700px;
   height: 500px;
   position: fixed;
   left: 0;
   right: 0;
   top: 0;
   bottom: 0;
   margin: auto;
   background: linear-gradient(#FFFFFF, #F9F9F9);
   box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.7);
   border-radius: 8px 8px 0px 0px;
+  min-width: 715px;
+  position: relative;
+  display: inline-block;
+  top: 50%;
+  transform: translateY(-50%);
 }
 
 #newtab-intro-header {
   font-size: 28px;
   color: #737980;
   text-align: center;
   top: 50px;
   position: relative;
   border-bottom: 2px solid #E0DFE0;
   padding-bottom: 10px;
-  width: 600px;
   display: block;
   margin: 0px auto;
   font-weight: 100;
+  padding: 0px 15px;
 }
 
 #newtab-intro-header .bold {
   font-weight: 500;
   color: #343F48;
 }
 
 #newtab-intro-footer {
@@ -685,67 +704,83 @@ input[type=button] {
   color: #171F26;
 }
 
 #newtab-intro-footer > ul > :first-child {
   border-right: solid 1px #C1C1C1;
 }
 
 #newtab-intro-body {
-  height: 300px;
+  height: 310px;
   position: relative;
   display: block;
   top: 50px;
   margin: 25px 50px 30px;
 }
 
 #newtab-intro-content > * {
   display: inline-block;
 }
 
 #newtab-intro-content {
   height: 210px;
   position: relative;
 }
 
 #newtab-intro-buttons {
-  height: 90px;
   text-align: center;
   vertical-align: middle;
-  line-height: 90px;
+  position: absolute;
+  display: block;
+  bottom: 0px;
+  width: 100%;
 }
 
 #newtab-intro-tile {
   width: 290px;
   height: 100%;
 }
 
+#newtab-intro-text {
+  text-align: left;
+  right: 0px;
+  width: 270px;
+}
+
 #newtab-intro-text,
 #newtab-intro-image {
   height: 100%;
-  width: 270px;
   right: 0px;
-  position: absolute;
   font-size: 14px;
   line-height: 20px;
   margin-top: -12px;
+  min-width: 270px;
 }
 
 #newtab-intro-image {
   left: 0px;
   right: auto;
-}
-
-.newtab-intro-image-tile {
+  float: left;
+  margin-right: 40px;
 }
 
 .newtab-intro-image-customize {
-  display: block;
   box-shadow: 3px 3px 5px #888;
   margin: 0 !important;
+  background-color: #FFF;
+  float: left;
+  z-index: 101;
+  margin-top: -5px;
+  min-width: 270px;
+  padding: 0;
+}
+
+.newtab-intro-image-customize #newtab-customize-title {
+  display: block;
+  max-height: 72px;
 }
 
 .newtab-intro-image-customize .newtab-customize-panel-item:not([selected]):hover {
   background-color: inherit;
   color: #7A7A7A;
   background: none;
 }
 
@@ -758,25 +793,26 @@ input[type=button] {
   height: 18px;
   width: 18px;
   vertical-align: middle;
   opacity: 1;
   position: inherit;
 }
 
 #newtab-intro-buttons > input {
-  width: 150px;
+  min-width: 150px;
   height: 50px;
   margin: 0px 5px;
   vertical-align: bottom;
   border-radius: 2px;
   border: solid 1px #2C72E2;
   background-color: #FFFFFF;
   color: #4A90E2;
   -moz-user-focus: normal;
+  padding: 0px 10px;
 }
 
 #newtab-intro-buttons > input[default] {
   background-color: #4A90E2;
   color: #FFFFFF;
 }
 
 #newtab-intro-buttons > input:hover {