Bug 590481 - Menulist are not scrollable [r=mfinkle]
authorVivien Nicolas <21@vingtetun.org>
Wed, 25 Aug 2010 17:31:22 +0200
changeset 66489 7bf0a6c65238ff988b09d97ed9d9ff1a957392d7
parent 66488 9f5213769bf782e1758e5351ff333e983b42e66b
child 66490 a65def5b42dad444a51cd1c16aa1d080b05dd2dd
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs590481
Bug 590481 - Menulist are not scrollable [r=mfinkle]
mobile/chrome/content/browser-ui.js
mobile/chrome/content/browser.xul
mobile/themes/core/browser.css
--- a/mobile/chrome/content/browser-ui.js
+++ b/mobile/chrome/content/browser-ui.js
@@ -2089,19 +2089,19 @@ var MenuListHelperUI = {
     let listbox = this._popup.firstChild;
     while (listbox.firstChild)
       listbox.removeChild(listbox.firstChild);
 
     let children = this._currentList.menupopup.children;
     for (let i = 0; i < children.length; i++) {
       let child = children[i];
       let item = document.createElement("richlistitem");
-      if (child.selected)
-        item.setAttribute("selected", child.selected);
-      item.setAttribute("class", "menulist-command");
+      // Add selected as a class name instead of an attribute to not being overidden
+      // by the richlistbox behavior (it sets the "current" and "selected" attribute
+      item.setAttribute("class", "menulist-command" + (child.selected ? " selected" : ""));
 
       let label = document.createElement("label");
       label.setAttribute("value", child.label);
       item.appendChild(label);
 
       listbox.appendChild(item);
     }
 
--- a/mobile/chrome/content/browser.xul
+++ b/mobile/chrome/content/browser.xul
@@ -535,18 +535,18 @@
         <hbox id="select-buttons" pack="center">
           <button id="select-buttons-done" class="button-dark" label="&selectHelper.done;" oncommand="SelectHelperUI.hide();"/>
         </hbox>
       </vbox>
       <spacer flex="1000"/>
     </vbox>
 
     <hbox id="menulist-container" class="window-width window-height context-block" top="0" left="0" hidden="true" flex="1">
-      <vbox id="menulist-popup" class="dialog-dark"> 
-        <richlistbox id="menulist-commands" onselect="MenuListHelperUI.selectByIndex(this.selectedIndex)"/>
+      <vbox id="menulist-popup" class="dialog-dark">
+        <richlistbox id="menulist-commands" onclick="if (event.target != this) MenuListHelperUI.selectByIndex(this.selectedIndex);" flex="1"/>
       </vbox>
     </hbox>
 
     <hbox id="context-container" class="window-width window-height context-block" top="0" left="0" hidden="true">
       <vbox id="context-popup" class="dialog-dark">
         <hbox id="context-header">
           <label id="context-hint" crop="center" flex="1"/>
         </hbox>
--- a/mobile/themes/core/browser.css
+++ b/mobile/themes/core/browser.css
@@ -1538,19 +1538,19 @@ pageaction:hover:active > vbox > .pageac
 .menulist-command:first-child:last-child {
   -moz-border-radius: 8px;
 }
 
 .menulist-command:hover:active {
   background: #8db8d8;
 }
 
-.menulist-command[selected="true"] {
+.menulist-command.selected {
+  background: #8db8d8;
   pointer-events: none;
-  background: #8db8d8;
 }
 
 /* context popup ----------------------------------------------------------- */
 #context-popup {
   /* Remove some dialog-dark styles */
   padding: 8px 0 0 0;
   border: none;
 }