mozilla / personas-plus

Personas Plus extension for Firefox
https://addons.mozilla.org/addon/personas-plus/
Mozilla Public License 2.0
8 stars 11 forks source link

The list closes when hovering over a theme after removing the applied theme #42

Closed cosminbadescuSV closed 7 years ago

cosminbadescuSV commented 8 years ago

Steps to reproduce:

1.Install the Personas Plus version 1.8.0b1 add-on. 2.Go to about:addons and remove “Groovy Blue” theme. 3.Go to Personas Plus icon and hover over themes in “Featured”.

Expected results: The list with themes is displayed without any issues.

Actual results: The list closes after hovering over the themes.

Note/Issues: Verified on FF48.0b7(Win 7 64-bit) This issue is reproducing in AMO production server. This issue is reproducing with e10s enabled and disabled

Here is a video: hover

wagnerand commented 8 years ago

@cosminbadescuSV For issues like this, can you please check the error log and see whether there is anything related to the add-on? Thanks!

cosminbadescuSV commented 8 years ago

This is what I receive in the browser console: hover2

derinb commented 8 years ago

Thanks for the report.

I think this bug is already available for current AMO version.

https://addons.mozilla.org/en-US/firefox/addon/personas-plus/

Could you install AMO 1.7.8 version on a new profile and follow same STR to produce the issue?

cosminbadescuSV commented 8 years ago

The issue is reproducing for 1.7.8 on a new profile, here are some videos: hover2

hover3

derinb commented 8 years ago

Yes this is Firefox bug. A new bugzilla bug needs to submitted for the issue.

Although it seems blocking, it does not seem to be an issue for production. I think no user reported a complaint about this bug in AMO reviews.

One way to fix is to install a new theme from Mozilla manually https://addons.mozilla.org/en-US/firefox/addon/plush/

After that list works properly.

The issue is; Firefox does not like Theme change request if the current theme is Default. If there is an open menu or popup, theme change request closes the popup because LightWeightThemeManager adds some attributes to the navigation area and this modifies CSS and Popup settings. Therefore popup closes.

This issue not only closes PP menu. It also closes Pocket popup, too, if there a Theme change request is taking place.

wagnerand commented 8 years ago

Weird, I can't reproduce this on a fresh profile in Fx 47.0.1 or in 48.0b7.

derinb commented 8 years ago

I can produce it on 47.0.1 Mac OS X.

wagnerand commented 8 years ago

Ah, I can reproduce it on Windows at least. @derinb you seem to know why this is happening. Could you file a bugzilla bug, please?

derinb commented 8 years ago

Bugzilla report

derinb commented 8 years ago

Workflow

In the case Default Theme is active and when hovered over Featured menu item, this workflow is executed

DOMMenuItemActive https://github.com/mozilla/personas-plus/blob/1b395cee5aee9f02a6edc3740a22b66fb6dafae1/extension/content/personas.js#L1113

onPreviewPersona https://github.com/mozilla/personas-plus/blob/1b395cee5aee9f02a6edc3740a22b66fb6dafae1/extension/content/personas.js#L710

_previewPersona https://github.com/mozilla/personas-plus/blob/1b395cee5aee9f02a6edc3740a22b66fb6dafae1/extension/content/personas.js#L749

previewPersona https://github.com/mozilla/personas-plus/blob/1b395cee5aee9f02a6edc3740a22b66fb6dafae1/extension/modules/service.js#L1017

_notifyWindows(aData); https://dxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/LightweightThemeManager.jsm#222

lightweight-theme-styling-update https://dxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/LightweightThemeManager.jsm#798

lightweight-theme-styling-update observer https://dxr.mozilla.org/mozilla-esr45/source/toolkit/modules/LightweightThemeConsumer.jsm#72

root.setAttribute("lwtheme", "true"); https://dxr.mozilla.org/mozilla-esr45/source/toolkit/modules/LightweightThemeConsumer.jsm#126

derinb commented 8 years ago

root.setAttribute("lwtheme", "true");

is the bug line. When setting lwtheme attribute to true for window.document.documentElement, which is root element of Firefox Window, open popups and menus get closed.

derinb commented 8 years ago

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)
wagnerand commented 8 years ago

Great, thanks!