With the negative margin, some context menus that remain open start
getting events that would otherwise go to the content underneath
(and which the affected tests need to pass).
Close the context menus explicitly in the affected tests (this is
what would usually happen if a user clicked a context menu item
anyways).
Differential Revision: https://phabricator.services.mozilla.com/D129867
Make `ChangesContextMenu` directly extend `Menu` instead of wrapping it so external objects and tests can listen to its events.
Reduce `ChangesContextMenu`'s knowledge about the outside world (like `ChangesView`) by providing it in the constructor with the callbacks necessary for each context menu item.
Differential Revision: https://phabricator.services.mozilla.com/D55448
Already tested via toolbox menus in devtools/client/framework/test/browser_toolbox_zoom_popup.js
Could open a follow up to allow for other anchor points than bottom-left.
Differential Revision: https://phabricator.services.mozilla.com/D37044
Depends on D28036
If a context menu is opened in the toolbox document when running in a frame with type=content, keyboard navigation will not move to the context menu when it's opened.
Differential Revision: https://phabricator.services.mozilla.com/D27695
Depends on D27693
Menu::popup and popupAtZoom are expecting a toolbox argument as last argument.
However, half of the callsites do not have access to the toolbox and just pass
a { doc } object. This is misleading when trying to work on menu.js because you
cannot rely on toolbox APIs.
Differential Revision: https://phabricator.services.mozilla.com/D28036
Depends on D28036
If a context menu is opened in the toolbox document when running in a frame with type=content, keyboard navigation will not move to the context menu when it's opened.
Differential Revision: https://phabricator.services.mozilla.com/D27695
Depends on D27693
Menu::popup and popupAtZoom are expecting a toolbox argument as last argument.
However, half of the callsites do not have access to the toolbox and just pass
a { doc } object. This is misleading when trying to work on menu.js because you
cannot rely on toolbox APIs.
Differential Revision: https://phabricator.services.mozilla.com/D28036
Network - HAR and Throtthling menus when they are opened are preventing other events to trigger by the first mouse click. After this
change, they will not consume the first click.
Differential Revision: https://phabricator.services.mozilla.com/D15444
This allows us to open the context menu directly from webconsole.html when it's
running as a top level window. Ultimately, I'd like to not have to use special
handling in the console - all top-level windows should get the edit menu working
automatically for HTML inputs - but this lets us prove it out as a first consumer.
MozReview-Commit-ID: BYisQDtXWe4
Create a popugroup element to setup the context menu behind the scenes.
Create all the menu related elements with the XUL namespace.
MozReview-Commit-ID: DI24aNHHFON
Signed-off-by: Brendan Dahl <[email protected]>
In a couple of places in DevTools we read back the value of the
"devtools.toolbox.zoomValue" pref and take that to be the zoom value. However,
at certain zoom levels these two can differ: the pref value representing the
ideal zoom and currentZoom giving the actual zoom value in use.
This patch makes us use the actual zoom value in the two places where this
occurs.
Unfortunately, we cannot easily adjust the browser_html_tooltip_zoom.js test for
this since it uses a separate XUL document that does not take into account the
pref value---as a result that test directly sets the currentZoom on the separate
doc and hence this problem won't occur.
Instead, this patch adjusts the browser_toolbox_zoom_popup.js test since the
toolbox menu positioning uses the same problematic pattern so we can reproduce
the bug in the browser_toolbox_zoom_popup.js. (This patch fixes both
occurances of this pattern.)
At least locally browser_toolbox_zoom_popup.js passes for me with a zoom of 1.5
but fails with a zoom of 1.4. Similarly in my testing of HTMLTooltip, zoom
values such as 1.2 and 1.4 often show significant misalignment whilst a zoom of
1.3 or 1.5 is fine.
With the code changes in this patch, the test passes with any given zoom factor.
(This patch also incidentally replaced isNaN with the more robust Number.isNaN.)
MozReview-Commit-ID: JmlRoidARVp
Create a popugroup element to setup the context menu behind the scenes.
Create all the menu related elements with the XUL namespace.
MozReview-Commit-ID: DI24aNHHFON
Signed-off-by: Brendan Dahl <[email protected]>
The openPopupAtScreen() use the zoomed css coordinate value as position value,
devtools's caller of this function use css pixel value without zoom. So position
of popup will missaligned if zooming out/in the devtool panel.
MozReview-Commit-ID: 4vvEssO41bO
Popup manager will eat click event when clicking outside of popup only if macOS
and Linux. This patch will add consumeoutesideclicks attribute to this popup in
order to prevent to react click event listener of a button which accessing to
this popup on all platform.
MozReview-Commit-ID: Sv3Hv9Olhn