Open Bug 1287158 Opened 8 years ago Updated 2 years ago

Previewing or Installing Light Weight Themes Closes Navigation Toolbar Menu and Popups Automatically

Categories

(Core :: General, defect)

47 Branch
x86
macOS
defect

Tracking

()

UNCONFIRMED

People

(Reporter: barisderin, Unassigned)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:47.0) Gecko/20100101 Firefox/47.0 Build ID: 20160623154057 Steps to reproduce: 1.Install the Personas Plus: https://addons.mozilla.org/en-US/firefox/addon/personas-plus/ 2. Go to about:addons and remove “Groovy Blue” theme. 3. Go to Personas Plus icon and hover over themes in “Featured” Github issue for more details: https://github.com/mozilla/personas-plus/issues/42 Actual results: The list closes after hovering over the themes. Expected results: The list with themes is displayed without any issues.
It is because of the line: https://dxr.mozilla.org/mozilla-esr45/source/toolkit/modules/LightweightThemeConsumer.jsm#126 `root.setAttribute("lwtheme", "true");` Setting lwtheme attribute to true for `window.document.documentElement` closes any open popup and menus automatically.
This issue is not specific to Personas Plus toolbar button menu. Most of the Navigation Toolbar popups and menus get closed when root.setAttribute("lwtheme", "true"); To test other popups, e.g. Pocket menu, run below code in Scratchpad, open Pocket popup, wait 5 seconds and it gets closed automatically when setTimeout runs. var win=Components.classes['@mozilla.org/appshell/window-mediator;1'].getService(Components.interfaces.nsIWindowMediator).getMostRecentWindow("navigator:browser") win.setTimeout(function(){ var root = win.document.documentElement; root.setAttribute("lwtheme", "true"); },5000)
Unable to reproduce bug on OSX Yosemite 10.10.2 using nightly build 50.0a1 (2016-7-18). These are the steps I took: (1) installed the add-on (2) went to about:addons/appearance/ and deleted "Groovy Blue" theme. (3) Clicked on the persona plus icon/featured/and hovered over several themes anywhere from 5 seconds to 30 seconds and the list stayed open and showed the theme loaded in the background. (4) I added a different theme/deleted that theme/ and repeated step (3). The list stayed open and showed the theme loaded in the background.
I couldn't reproduce that on Mac, but I can on Windows 7.
I have tested this on Mac OS X 10.10 and Windows 7 with FF Nightly. I tested this using new profile. You can try to see if you can reproduce it with new profile, you have the steps here:https://support.mozilla.org/en-US/kb/profile-manager-create-and-remove-firefox-profiles?redirectlocale=en-US&redirectslug=Managing-profiles#w_starting-the-profile-manager
Component: Untriaged → Add-ons Manager
OS: Unspecified → Mac OS X
Product: Firefox → Toolkit
Hardware: Unspecified → x86
Flags: needinfo?(barisderin)
Detailed report here, https://github.com/mozilla/personas-plus/issues/39 , please check the screencast. I can still produce this on Mac. Strangely I noticed this bug on Windows but now I can not produce it on Windows. It happens sporadic, not sure why. The best way to test is the below code. Run below code in Scratchpad, open Pocket popup quickly (you must open up the panel in 5 seconds), wait 5 seconds and it gets closed automatically when setTimeout runs. var win = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService(Components.interfaces.nsIWindowMediator).getMostRecentWindow("navigator:browser") win.setTimeout(function(){ var root = win.document.documentElement; root.setAttribute("lwtheme", "true"); },5000) The issue is: root.setAttribute("lwtheme", "true"); closes all popups so even if you can not reproduce the issue for Personas Plus by the attached STR, you can produce it by above code.
I don't think this is an add-ons manager bug but with the APIs the add-on uses?
Component: Add-ons Manager → Theme
Product: Toolkit → Firefox
Dão, is this just a widget or toolkit issue? Doesn't seem like it's anything in our theme code...
Flags: needinfo?(dao+bmo)
I have no idea, but I don't see how this could be a theme bug.
Component: Theme → General
Flags: needinfo?(dao+bmo)
Product: Firefox → Core
The theme might be changing CSS properties that cause frame reconstruction, and if you destroy + recreate a popup frame then it will close. To know for sure, somebody will need to set a breakpoint on nsWindow::Show when this happens and look at the callstack.
Before popup closed "lwtheme" attribute is modified by LightweightThemeConsumer.jsm https://dxr.mozilla.org/mozilla-esr45/source/toolkit/modules/LightweightThemeConsumer.jsm#126 Then as Markus noted, some observer is probably called which is listening "lwtheme" attribute change and navigation toolbox is redrawn.
(In reply to Baris Derin from comment #6) > Detailed report here, https://github.com/mozilla/personas-plus/issues/39 , > please check the screencast. > > I can still produce this on Mac. Strangely I noticed this bug on Windows but > now I can not produce it on Windows. It happens sporadic, not sure why. > > The best way to test is the below code. <snip> Baris, does this reproduce if you don't install the personas plus extension? Does it happen if you repeat the code (keep setting the attribute) ? Or only when the default theme is selected and you hover over lightweight themes? (In reply to Markus Stange [:mstange] from comment #11) > The theme might be changing CSS properties that cause frame reconstruction, > and if you destroy + recreate a popup frame then it will close. This seems likely, but how would we narrow down what CSS property does this? And what could we do to avoid this besides "don't change that css property" ?
Flags: needinfo?(mstange)
One would need to start with what I suggested in comment 11: Set a breakpoint on nsWindow::Show(false) and go from there. My hypothesis about frame reconstruction might not even be correct. Once we know the reason why the panel closes, we can start thinking about remedies.
Flags: needinfo?(mstange)
Screencast = https://cloud.githubusercontent.com/assets/15885467/16873902/c27d3ca8-4a9e-11e6-97d2-00e9d655b24a.gif When "Default", there is not light weight theme installed and there is no "lwtheme" attribute on global "Window" node. If you open up Personas Plus menu and hover over a Light Weight Theme menuitem, "preview" action is called. While previewing, Personas Plus menu is still in "open" state. Previewing sets "lwtheme" attribute on Window node by below line: https://dxr.mozilla.org/mozilla-esr45/source/toolkit/modules/LightweightThemeConsumer.jsm#126 Then because "lwtheme" is "added" on window node, Firefox "navigation toolbox" is modified and Personas Plus menu gets closed as probably redrawn or frame reconstruction. The other case: If there is already a light weight theme is installed before opening Personas Plus menu, Window node already has "lwtheme" attribute. If you open up Personas Plus menu and hover over a Light Weight Theme menuitem, "preview" action is called. Because "lwtheme" attribute is already there, Preview action does not add "lwtheme" attribute so state does not change and Personas Plus menu does not get closed. The problem is adding or removing "lwtheme" attribute to the Window root node while the Personas Plus menu is open, as this line states: https://dxr.mozilla.org/mozilla-esr45/source/toolkit/modules/LightweightThemeConsumer.jsm#126 "lwtheme" attribute changes state and Personas Plus menu get affected.
Flags: needinfo?(gijskruitbosch+bugs)
I can't reproduce this on either Windows (tested with Windows 10) or Mac, not with the personas plus menu nor with the test from comment #16 using the pocket panel, so I don't know how to investigate this further.
Flags: needinfo?(gijskruitbosch+bugs)
Flags: needinfo?(barisderin)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.