Make native menus respect display:none user styles on menu items
Categories
(Core :: Widget: Cocoa, enhancement, P3)
Tracking
()
People
(Reporter: mstange, Unassigned)
References
Details
(Whiteboard: [proton-context-menus][mac:mr1])
Attachments
(1 obsolete file)
This was brought up in bug 34572 comment 29: Some users have custom userChrome CSS in order to hide unneeded items in the page context menu, by setting display:none on the items. Native context menus do not observe these CSS declarations at the moment, so these items are now unexpectedly shown in native context menus.
It's probably easy enough to check the computed display
style on the DOM nodes and make this work.
Updated•4 years ago
|
Updated•4 years ago
|
Comment hidden (obsolete) |
Updated•4 years ago
|
Reporter | ||
Comment 2•4 years ago
|
||
I gave this a shot but it looks harder than anticipated.
The problem is that the naive approach breaks dynamic changes to the hidden
attribute. [hidden=true] sets display:none. When hidden=true is removed, our AttributeChanged mutation observer calls nsMenuX::ObserveAttributeChanged
which checks the new visibility state synchronously during the observer. Querying the computed style at this point still shows cs->StyleDisplay()->mDisplay == StyleDisplay::None
. So it looks like the style hasn't yet updated in response to the attribute change, and the item is still treated as hidden even though the hidden attribute has just been removed.
Since this is just a nice-to-have I am not planning to spend more time on it.
Reporter | ||
Comment 3•4 years ago
|
||
This bug was caught by the test widget/tests/test_standalone_native_menu.xhtml
.
Updated•4 years ago
|
Please reconsider, this makes it impossible for me to use the native context menu.
Or at least allow up to deny extensions permission to populate the context menu, that'd be even better as it helps all platforms.
Description
•