It appears that even a noop function `() => {}` will capture the entire scope,
so this patch also changes the normal state of the cancel callback to be
undefined.
Differential Revision: https://phabricator.services.mozilla.com/D170039
`this.forNode` (with `this` being a `PanelMultiView` instance) may
return a node that was already disconnected before, in which case its
`node` member will be void. To avoid unexpected promise rejections, add
a null check before `_moveOutKids()`.
Differential Revision: https://phabricator.services.mozilla.com/D167369
This was used to prevent reflows due to popuppositioned events during
view transitions.
The previous patch should've prevented the popuppositioned events to
begin with, plus we no longer use arrows that need positioning etc,
which means we shouldn't be triggering the reflows anyways.
Since this is the only consumer of autoPosition = true/false, we can
remove the code supporting it. It's a bit bogus as per the commit
message of the previous patch and, while fixable, it doesn't seem worth
fixing if we can just get rid of it.
Depends on D159936
Differential Revision: https://phabricator.services.mozilla.com/D159937
getOuterScreenRect doesn't flush layout, so not flushing here should be
fine.
We only care about the CSS width / height, not about the screen
positioning, so this is more accurate.
The flickering in comment 8 (the hover effect in the "restore previous
session" button) happens because the following set of events:
* We try to lock the size of the panel.
* The size returned by getOuterScreenRect() is fractionally different
to the actual size.
* We get to [1], realize we've changed size (even though fractionally),
set the origin at 0, 0, and then call SetPopupPosition to fix that
up.
* But we've disabled autopositioning[1], so the layout position of the
panel remains at 0, 0.
This prevents the flickering by using the actual layout size
(getBoundsWithoutFlushing / getBoundingClientRect) rather than the
potentially-rounded getOuterScreenRect, to prevent the resize.
We could fix autoPosition = false, but I don't think it's needed
anymore, so I'm going to try removing it instead. However this change
should still avoid work, so seems worth landing regardless.
[1]: https://searchfox.org/mozilla-central/rev/c5c002f81f08a73e04868e0c2bf0eb113f200b03/layout/xul/nsMenuPopupFrame.cpp#621-626
[2]: https://searchfox.org/mozilla-central/rev/c5c002f81f08a73e04868e0c2bf0eb113f200b03/browser/components/customizableui/PanelMultiView.jsm#668
Depends on D159935
Differential Revision: https://phabricator.services.mozilla.com/D159936
While these work now because I haven't ported popups to modern flexbox,
let's remove usage of these attributes so I don't have to later. This
doesn't change behavior.
Depends on D159934
Differential Revision: https://phabricator.services.mozilla.com/D159935
This is needed to fix browser_ext_browserAction_click_types.js.
Before the first patch in this bug, the order of the built-in command
event and the synthetic event here was slightly different, so it was
papered over. Also, the click event will trigger a command event if
needed, so there's no need to do it explicitly.
Differential Revision: https://phabricator.services.mozilla.com/D157591
The virtual click event is also removed. It seems this event is only used to check whether this was a key or mouse event in PanelMultiView.jsm
This also removes support for pressing the enter key to trigger these toolbarbuttons on Mac which shouldn't be happening anyway.
Differential Revision: https://phabricator.services.mozilla.com/D149285
The virtual click event is also removed. It seems this event is only used to check whether this was a key or mouse event in PanelMultiView.jsm
This also removes support for pressing the enter key to trigger these toolbarbuttons on Mac which shouldn't be happening anyway.
Differential Revision: https://phabricator.services.mozilla.com/D149285
The virtual click event is also removed. It seems this event is only used to check whether this was a key or mouse event in PanelMultiView.jsm
This also removes support for pressing the enter key to trigger these toolbarbuttons on Mac which shouldn't be happening anyway.
Differential Revision: https://phabricator.services.mozilla.com/D149285
When the tracking protection toast popup closes on a timer, it doesn't
smoothly fade out, because it uses PanelMultiView.hidePopup instead of
panelNode.hidePopup. The static method on PanelMultiView ultimately
calls panelNode.hidePopup, but it doesn't have a parameter for enabling
the animation so it passes nothing to that method. This patch extends
PanelMultiView's hidePopup class methods to add an optional `animate`
parameter, and adds that parameter to the toast popup's hidePopup call.
This should slightly reduce the speed of part of
browser_protectionsUI.js but I don't think it affects any other tests.
Differential Revision: https://phabricator.services.mozilla.com/D146394
Device pixels and desktop pixels are not the same on macOS and Win7.
Expose the desktop-to-device scale to JS and use it appropriately.
Depends on D138038
Differential Revision: https://phabricator.services.mozilla.com/D138039
Device pixels and desktop pixels are not the same on macOS and Win7.
Expose the desktop-to-device scale to JS and use it appropriately.
Depends on D138038
Differential Revision: https://phabricator.services.mozilla.com/D138039
screenForRect takes screen coordinates (device pixels, for our purpose here).
However screenX / screenY are in CSS pixels, so we need to convert them to the
right coordinate space before looking up the screen.
Differential Revision: https://phabricator.services.mozilla.com/D137895
The toolbarseparator is added the first time a subview is opened. However for subsequent times the header already exists and we bailed out early without adding the separator.
Differential Revision: https://phabricator.services.mozilla.com/D122907
The toolbarseparator is added the first time a subview is opened. However for subsequent times the header already exists and we bailed out early without adding the separator.
Differential Revision: https://phabricator.services.mozilla.com/D122907