Bug 1080030 - Trim the whitespace surrounding option/optgroup text when displaying a drop-down in e10s; r=felipe
authorEhsan Akhgari <ehsan@mozilla.com>
Sat, 11 Oct 2014 09:40:45 -0400
changeset 233183 94e7f3c3969c899f753098afb6639b811fbc7d1c
parent 233182 4ef90fdc2c5895c81cdf6434ce54a88dd7b3d499
child 233184 c6af18bbbafa95040e66f4e81297a4237800f3ee
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfelipe
bugs1080030
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1080030 - Trim the whitespace surrounding option/optgroup text when displaying a drop-down in e10s; r=felipe
toolkit/modules/SelectContentHelper.jsm
--- a/toolkit/modules/SelectContentHelper.jsm
+++ b/toolkit/modules/SelectContentHelper.jsm
@@ -87,18 +87,18 @@ this.SelectContentHelper.prototype = {
 }
 
 function buildOptionListForChildren(node) {
   let result = [];
   for (let child = node.firstChild; child; child = child.nextSibling) {
     if (child.tagName == 'OPTION' || child.tagName == 'OPTGROUP') {
       let info = {
         tagName: child.tagName,
-        textContent: child.tagName == 'OPTGROUP' ? child.getAttribute("label")
-                                                 : child.textContent,
+        textContent: child.tagName == 'OPTGROUP' ? child.getAttribute("label").trim()
+                                                 : child.textContent.trim(),
         // XXX this uses a highlight color when this is the selected element.
         // We need to suppress such highlighting in the content process to get
         // the option's correct unhighlighted color here.
         // We also need to detect default color vs. custom so that a standard
         // color does not override color: menutext in the parent.
         // backgroundColor: computedStyle.backgroundColor,
         // color: computedStyle.color,
         children: child.tagName == 'OPTGROUP' ? buildOptionListForChildren(child) : []