Commit graph

447 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
f56dca9254 Bug 1878037 - Fix some regressions on alert windows. r=saschanaz,win-reviewers,rkraesig
Bug 1870512 removed top level windows with WindowType::Popup, instead
replacing it with an "alert" feature for the only use of them that we
had.

Turns out that on Windows they need a bit more special handling than I
thought, so this patch uses the alert boolean to fix two regressions
(that alerts now create taskbar icons, and that they steal focus).

Remove mIsForMenuPopupFrame since that is now a synonym with
WindowType::Popup.

Remove also the dialog vs. toplevel difference of using
WS_EX_DLGMODALFRAME, since that doesn't seem to have an effect at all on
windows 10+.

Differential Revision: https://phabricator.services.mozilla.com/D200508
2024-02-12 19:45:48 +00:00
Emilio Cobos Álvarez
cca9bd6975 Bug 1872997 - Improve and simplify DevTools' xul:panel tooltip implementation. r=devtools-reviewers,desktop-theme-reviewers,dao,nchevobbe
This adds proper borders and radii on Windows and Linux, which are
otherwise not present, and simplifies a bit the code by using the same
code path across platforms, and between HTML and XUL.

Remove some ::-moz-focus-inner styles which no longer apply to un-themed
buttons.

The extra -0.5 offset I think was compensating for the margins and
missing border-box sizing.

Differential Revision: https://phabricator.services.mozilla.com/D197793
2024-01-11 10:16:55 +00:00
Emilio Cobos Álvarez
ec1ddfebcd Bug 1872983 - Restore behavior of -moz-window-shadow: auto and appearance: none. r=dholbert
Before the first part of bug 1872399, that would use
WindowShadow::Default, which didn't create a vibrant effect etc, which
causes the background here.

Make it more explicit by calling this "Panel". The second part of
bug 1872399 already did this.

Differential Revision: https://phabricator.services.mozilla.com/D197648
2024-01-04 23:47:54 +00:00
Emilio Cobos Álvarez
35c465dca0 Bug 1872399 - Clean-up -moz-window-shadow set-up. r=dholbert
-moz-window-shadow is a chrome-only property (not exposed to the web),
and chrome stylesheets only use the none value to disable the default
behavior.

Split the style property (default/none) from the actual widget behavior.
This is useful because I want to add a distinction between
natively-styled menupopups and other panels in the following commit.

While at it rename default to "auto" which is a more common name in CSS
for something like this.

We have no use case for removing the shadow of a top-level window, so
remove it to simplify the code.

Differential Revision: https://phabricator.services.mozilla.com/D197454
2023-12-31 21:53:32 +00:00
Emilio Cobos Álvarez
819c082c31 Bug 1848526 - Clear descendant intrinsics too when opening a popup. r=tnikkel,layout-reviewers
This is probably testable, but I don't know how we'd make the test
reliable (we haven't found particularly reliable STR yet, see comments).

Differential Revision: https://phabricator.services.mozilla.com/D193827
2023-11-18 10:21:10 +00:00
Emilio Cobos Álvarez
25c0d10932 Bug 1624819 - Remove TaskCategory and other quantum dom remnants. r=smaug,media-playback-reviewers,credential-management-reviewers,cookie-reviewers,places-reviewers,win-reviewers,valentin,mhowell,sgalich,alwu
Sorry this is not a particularly easy patch to review. But it should be
mostly straight-forward.

I kept Document::Dispatch mostly for convenience, but could be
cleaned-up too / changed by SchedulerGroup::Dispatch. Similarly maybe
that can just be NS_DispatchToMainThread if we add an NS_IsMainThread
check there or something (to preserve shutdown semantics).

Differential Revision: https://phabricator.services.mozilla.com/D190450
2023-10-10 08:51:12 +00:00
Emilio Cobos Álvarez
45db443027 Bug 1850709 - Wayland: constrain popup size to screen. r=stransky
To avoid trying to render a huge popup before move-to-rect finishes.

Not quite convince we want this but should fix this.

Differential Revision: https://phabricator.services.mozilla.com/D187824
2023-09-11 13:22:09 +00:00
Emilio Cobos Álvarez
0a7c21b9a6 Bug 1852153 - Don't use move-to-rect if layout has constrained popup. r=stransky
This is an edge case where layout thinks the popup doesn't need
flipping, but the compositor does.

In an ideal world we'd convince the compositor it doesn't by providing
our margins, but that doesn't seem easily doable.

So check whether there was a constraint rect that we tried to honor
instead, rather than whether we actually had to flip or what not.

Differential Revision: https://phabricator.services.mozilla.com/D187823
2023-09-11 13:20:51 +00:00
Emilio Cobos Álvarez
52d097c513 Bug 1851868 - Refactor nsIFrame::Destroy to pass a single DestroyContext parameter. r=dholbert
This shouldn't change behavior, but it packs the two arguments to
DestroyFrom into a single thing, and makes nsIFrame::Destroy not so easy
to call without a previous context.

This is a prerequisite to pass aDestroyContext to various things that
right now just mint one, which can cause badness, see bug 1851787 and
related bugs.

It's also a bit nicer to add things there if we need to in the future.

Differential Revision: https://phabricator.services.mozilla.com/D187578
2023-09-07 11:46:30 +00:00
Narcis Beleuzu
77ba6cde90 Backed out changeset 55052ae7d067 (bug 1851868) for reftest failure on 1153695.html . CLOSED TREE 2023-09-07 02:42:25 +03:00
Emilio Cobos Álvarez
59766eeba4 Bug 1851868 - Refactor nsIFrame::Destroy to pass a single DestroyContext parameter. r=dholbert
This shouldn't change behavior, but it packs the two arguments to
DestroyFrom into a single thing, and makes nsIFrame::Destroy not so easy
to call without a previous context.

This is a prerequisite to pass aDestroyContext to various things that
right now just mint one, which can cause badness, see bug 1851787 and
related bugs.

It's also a bit nicer to add things there if we need to in the future.

Differential Revision: https://phabricator.services.mozilla.com/D187578
2023-09-06 22:34:35 +00:00
Shane Hughes
dc069d280d Bug 1842366 - Part 1: Support center alignment for XUL popups. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D183639
2023-08-31 08:14:41 +00:00
Butkovits Atila
86090140b2 Backed out 2 changesets (bug 1842366) for causing Xpcshell failures at test_PanelTestProvider.js. CLOSED TREE
Backed out changeset bcc147043981 (bug 1842366)
Backed out changeset c9e538ad8526 (bug 1842366)
2023-08-31 07:43:26 +03:00
Shane Hughes
cf53089e33 Bug 1842366 - Part 1: Support center alignment for XUL popups. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D183639
2023-08-31 03:29:05 +00:00
Emilio Cobos Álvarez
4cc6758558 Bug 1839922 - Remove usage of {Has,Get}Attr(kNameSpaceID_None, ..). r=edgar
We have more readable and faster versions (that just omit the namespace
arg).

Mostly done via sed, with a couple helpers to use the faster lookups
where possible.

Differential Revision: https://phabricator.services.mozilla.com/D181795
2023-06-23 10:01:32 +00:00
Emilio Cobos Álvarez
e170de6a14 Bug 1826622 - [wayland] Ensure explicit popup constraints are honored. r=stransky
This makes sure that wayland <select> elements are constrained to the
window.

Differential Revision: https://phabricator.services.mozilla.com/D175039
2023-04-13 07:42:36 +00:00
Emilio Cobos Álvarez
2d0e69f4a1 Bug 1824957 - Remove a bunch of now completely dead XUL layout code. r=layout-reviewers,desktop-theme-reviewers,devtools-reviewers,dao,TYLin
And some related tests.

A bunch of -moz-box* properties are web exposed, so I'll file a
follow-up for hiding them.

Differential Revision: https://phabricator.services.mozilla.com/D173819
2023-03-29 21:23:55 +00:00
Emilio Cobos Álvarez
7fd5088695 Bug 1824986 - Use element more in popup manager code. r=mstange
We know these are elements, take advantage of that.

Depends on D173836

Differential Revision: https://phabricator.services.mozilla.com/D173837
2023-03-28 14:33:19 +00:00
Emilio Cobos Álvarez
28e6c8dbfe Bug 1824986 - Factor widget styling in nsMenuPopupFrame. r=mstange
We had these spread around, it's better to have a single central place where we
update the widget based on the styling of the popups.

Differential Revision: https://phabricator.services.mozilla.com/D173836
2023-03-28 14:33:18 +00:00
Emilio Cobos Álvarez
d8d7f3f68c Bug 1823552 - Fix test_popup_moveToAnchor.xhtml failures by resetting offset on MoveTo calls.
MANUAL PUSH: Trivial fix CLOSED TREE
2023-03-21 13:46:25 +01:00
Emilio Cobos Álvarez
273cb18ba2 Bug 1823552 - When fixing the position of a followanchor="false" popup, don't lose the anchor rect altogether. r=stransky
Otherwise we lose the anchor constraints which can change our layout.
The only thing we want is to stop following the anchor _node_, so we can
just convert it to an anchor rect instead.

Differential Revision: https://phabricator.services.mozilla.com/D173135
2023-03-21 11:24:07 +00:00
Emilio Cobos Álvarez
a8be8e8d20 Bug 1823020 - Set mUntransformedAnchorRect for rect-anchored popups.
I missed setting mUntransformedAnchorRect in one case, causing Wayland
popups to be wrongly positioned.

Differential Revision: https://phabricator.services.mozilla.com/D172886
2023-03-17 19:26:54 +00:00
Emilio Cobos Álvarez
da7fa43d4a Bug 1809084 - Stop using XUL layout for menu popups. r=desktop-theme-reviewers,dao,dshin
The underlying issue here is an invalidation bug with XUL layout. When a
popup opens, we try to lay it out at full size, then post a reflow
callback to constrain it.

There's an intermediate step there where the popup might remain at full
size, and the constraining operates directly on mRect, which isn't quite
sound and doesn't update the scrollport of descendants.

Make nsMenuPopupFrame inherit from nsBlockFrame instead, doing
potentially two layout passes when constrained.

This fixes the issue at hand, and removes XUL layout from menu popups,
so it's a win-win.

To make reasoning about it a bit easier, factor out a bunch of the XUL
positioning code to be const. The mutation of mRect etc which was going
on otherwise was pretty hard to reason about.

Differential Revision: https://phabricator.services.mozilla.com/D170368
2023-03-16 19:09:14 +00:00
Emilio Cobos Álvarez
6384797392 Bug 1812329 - Remove nsMenuBarFrame. r=smaug
This ended up being a lot more straight-forward than the menu changes.

TLDR:

 * nsMenuBarFrame -> XULMenuBarElement
 * nsMenuBarListener -> MenuBarListener

Rest should be rather straight-forward.

Depends on D168649

Differential Revision: https://phabricator.services.mozilla.com/D167809
2023-02-08 13:12:23 +00:00
Iulian Moraru
d19790ed5f Backed out 2 changesets (bug 1812329) for causing multiple leaks. CLOSED TREE
Backed out changeset d663fc115ab9 (bug 1812329)
Backed out changeset 5464978a27a8 (bug 1812329)
2023-02-07 23:45:43 +02:00
Emilio Cobos Álvarez
b9833bfcca Bug 1812329 - Remove nsMenuBarFrame. r=smaug
This ended up being a lot more straight-forward than the menu changes.

TLDR:

 * nsMenuBarFrame -> XULMenuBarElement
 * nsMenuBarListener -> MenuBarListener

Rest should be rather straight-forward.

Depends on D168649

Differential Revision: https://phabricator.services.mozilla.com/D167809
2023-02-07 18:09:37 +00:00
Emilio Cobos Álvarez
1aa0c40769 Bug 1815309 - Make IsOnMenu() only return true for menupopups/popup elements. r=smaug
This matches what the old code did.

Differential Revision: https://phabricator.services.mozilla.com/D169016
2023-02-07 12:49:41 +00:00
Emilio Cobos Álvarez
46dd8a0d40 Bug 1811487 - Clean-up popup hide / rollup APIs. r=cmartin,stransky
I'm about to extend them for bug 1811486, where I want to force in some
cases the rolled up popups to hide synchronously. These APIs use a ton
of boolean arguments that make them error prone, so refactor them a bit
to use strongly typed enums and flags.

Differential Revision: https://phabricator.services.mozilla.com/D167381
2023-01-24 15:43:49 +00:00
Emilio Cobos Álvarez
4fa60b3b58 Bug 1798697 - Use outside rather than closest pixels for popup sizes, and don't clamp translucent popups. r=tnikkel
Both are needed to make this look ok.

Differential Revision: https://phabricator.services.mozilla.com/D167494
2023-01-24 11:24:48 +00:00
Emilio Cobos Álvarez
9e530f224a Bug 1811834 - Clean up nsWidgetInitData. r=cmartin,geckoview-reviewers,calu
Move it to the mozilla::widget namespace.

Use enum classes for transparency, popup type, popup level, etc.

Mostly automated with sed, but there were a few manual changes required
as well in windows code because they relied on Atomic<TransparencyMode>
working (which now doesn't because TransparencyMode is 1 byte instead of
4 bytes).

Differential Revision: https://phabricator.services.mozilla.com/D167537
2023-01-23 23:58:41 +00:00
Iulian Moraru
a713f3dd73 Backed out changeset f9a25f51a254 (bug 1811487) for causing bc failures related to PanelMultiView. CLOSED TREE 2023-01-23 21:11:43 +02:00
Emilio Cobos Álvarez
e8d9ad8d88 Bug 1811487 - Clean-up popup hide / rollup APIs. r=cmartin
I'm about to extend them for bug 1811486, where I want to force in some
cases the rolled up popups to hide synchronously. These APIs use a ton
of boolean arguments that make them error prone, so refactor them a bit
to use strongly typed enums and flags.

Differential Revision: https://phabricator.services.mozilla.com/D167381
2023-01-23 16:15:00 +00:00
Butkovits Atila
8ee1c95687 Backed out 2 changesets (bug 1811487) for causing failures at browser_PanelMultiView_keyboard.js. CLOSED TREE
Backed out changeset 88c5316c2183 (bug 1811487)
Backed out changeset 6350911c1c8d (bug 1811487)
2023-01-23 16:18:50 +02:00
Emilio Cobos Álvarez
5c3fc07c2e Bug 1811487 - Clean-up popup hide / rollup APIs. r=cmartin
I'm about to extend them for bug 1811486, where I want to force in some
cases the rolled up popups to hide synchronously. These APIs use a ton
of boolean arguments that make them error prone, so refactor them a bit
to use strongly typed enums and flags.

Differential Revision: https://phabricator.services.mozilla.com/D167381
2023-01-23 11:58:25 +00:00
Emilio Cobos Álvarez
4f1f5e7314 Bug 1805414 - Remove nsMenuFrame and nsMenuParent. r=smaug,Jamie,desktop-theme-reviewers,settings-reviewers,dao
Move most the event handling stuff to the DOM. I've left nsMenuBarFrame
for now, but I will be removing that in the future.

The basic set up is:

  * nsMenuParent becomes XULMenuParentElement (menubar or popup, manages
    the current active menu item)

  * nsMenuFrame -> XULButtonElements that return true for IsMenu().
    Can't use XULMenuElement because of <button type=menu>, which
    behaves like a, well, menu.

This makes the a11y events for menus (DOMMenuItem{Active,Inactive}) make
sense (before that we were firing duplicate Inactive events etc, and the
event order was rather suspicious).

Differential Revision: https://phabricator.services.mozilla.com/D164210
2023-01-04 19:01:13 +00:00
Csoregi Natalia
9807a6e6e8 Backed out changeset f11c529b2407 (bug 1805414) for failures on test_submenuClose.xhtml and nsMenuPopupFrame.cpp. CLOSED TREE 2023-01-04 01:48:30 +02:00
Emilio Cobos Álvarez
3d82727505 Bug 1805414 - Remove nsMenuFrame and nsMenuParent. r=smaug,Jamie,desktop-theme-reviewers,settings-reviewers,dao
Move most the event handling stuff to the DOM. I've left nsMenuBarFrame
for now, but I will be removing that in the future.

The basic set up is:

  * nsMenuParent becomes XULMenuParentElement (menubar or popup, manages
    the current active menu item)

  * nsMenuFrame -> XULButtonElements that return true for IsMenu().
    Can't use XULMenuElement because of <button type=menu>, which
    behaves like a, well, menu.

This makes the a11y events for menus (DOMMenuItem{Active,Inactive}) make
sense (before that we were firing duplicate Inactive events etc, and the
event order was rather suspicious).

Differential Revision: https://phabricator.services.mozilla.com/D164210
2023-01-03 22:06:01 +00:00
Olli Pettay
5d21de32ac Bug 1807812 - Remove WidgetEventTime::mTime, r=masayuki,geckoview-reviewers,m_kato
HTMLSelectEventListener changes are needed, since currently that code works somewhat by accident given that
mTime often contains totally bogus values, like PR_IntervalNow(). Those changes then reveal issues also in
browser_editAddressDialog.js.

Differential Revision: https://phabricator.services.mozilla.com/D165618
2023-01-02 12:31:40 +00:00
Emilio Cobos Álvarez
95d32359be Bug 1807892 - Some minor improvements to popup sizing code. r=tnikkel,layout-reviewers
This doesn't change behavior but should make what's going on slightly
clearer.

Depends on D165669

Differential Revision: https://phabricator.services.mozilla.com/D165670
2022-12-29 11:23:28 +00:00
Emilio Cobos Álvarez
3636635724 Bug 1807892 - Keep accounting for scrollbar sizes on menulist popup intrinsic size. r=tnikkel,layout-reviewers
See the comment for why we can't just use scrollbar-gutter: stable,
which is what we'd want, ideally.

This is reproducible on Win10 and also Linux as long as:

 * Overlay scrollbars are disabled.
 * The scrollbar size is bigger than the menulist arrow size.

This used to be done by the chunk of code here:

 * 8f61a444ce (l7.82)

Which changed the size of the menu (not just the popup) which then the
popup expanded to. So quite hacky over-all.

Differential Revision: https://phabricator.services.mozilla.com/D165669
2022-12-29 11:23:27 +00:00
Emilio Cobos Álvarez
bbe36d6bf7 Bug 1805694 - Simplify menulist popup layout. r=tnikkel
I decided to split this up from bug 1805414 because it's only
tangentially related to the removal of nsMenuFrame.

We have this sizetopopup attribute and behavior that allows menulists to
be sized to the contents of the popup. The popup also expands to the
menulist rect.

This means that layout is by somewhat cyclic and we need to go out of
our way to support it. However, I think we only care about the first
behavior. We don't have many non-intrinsically-sized menulists, and
if we need we can use HTML <select> instead, which does have that
behavior.

Simplify the setup to make sizetopopup only apply to menulists (we don't
have non-menulist usage anyways), and only work in the "popup depends on
the menulist" direction, not the other way around.

This will allow making the popup a regular out-of-flow element. The
change to test_menulist_paging is not needed (I restored the behavior of
eagerly layout menulists, to fix the <select> popup, but I'd like to fix
that eventually, so I'd rather leave them in, they're harmless).

Differential Revision: https://phabricator.services.mozilla.com/D164693
2022-12-19 16:15:52 +00:00
Emilio Cobos Álvarez
b8a0c9a742 Bug 1805500 - Implement panel borders in cocoa using a border rather than shadow. r=mstange,extension-reviewers
My guess is that it was done using shadows to not interfere with the
native look, but actually this just works even with native-looking menus
(like the <select> menulist), because the background-color for those is
set on the menupopup, rather than the ::part(content).

So those have effectively 1px of extra padding (due to the transparent
border), but that seems barely perceptible, and worth the consistency
and simplification.

Differential Revision: https://phabricator.services.mozilla.com/D164716
2022-12-17 01:45:05 +00:00
Cristian Tuns
c2f987572a Backed out changeset b9473eda2d5b (bug 1805500) for causing mochitest failures on browser_ext_popup_select_in_oopif.js CLOSED TREE 2022-12-16 19:10:34 -05:00
Emilio Cobos Álvarez
1eb1a7ba94 Bug 1805500 - Implement panel borders in cocoa using a border rather than shadow. r=mstange,extension-reviewers
My guess is that it was done using shadows to not interfere with the
native look, but actually this just works even with native-looking menus
(like the <select> menulist), because the background-color for those is
set on the menupopup, rather than the ::part(content).

So those have effectively 1px of extra padding (due to the transparent
border), but that seems barely perceptible, and worth the consistency
and simplification.

Differential Revision: https://phabricator.services.mozilla.com/D164716
2022-12-16 17:34:48 +00:00
Norisz Fay
df7a96cf4a Backed out changeset 48f2dad16e54 (bug 1805694) for causing bc failures on browser_selectpopup.js CLOSED TREE 2022-12-16 19:11:19 +02:00
Norisz Fay
08d4a8b04f Backed out changeset 839fc9d4bfa4 (bug 1805500) for causing mochitest failures on browser_test_select_popup_position.js 2022-12-16 18:11:22 +02:00
Emilio Cobos Álvarez
ed57810bcf Bug 1805500 - Implement panel borders in cocoa using a border rather than shadow. r=mstange,extension-reviewers
My guess is that it was done using shadows to not interfere with the
native look, but actually this just works even with native-looking menus
(like the <select> menulist), because the background-color for those is
set on the menupopup, rather than the ::part(content).

So those have effectively 1px of extra padding (due to the transparent
border), but that seems barely perceptible, and worth the consistency
and simplification.

Differential Revision: https://phabricator.services.mozilla.com/D164716
2022-12-16 10:31:33 +00:00
Emilio Cobos Álvarez
51b37cc937 Bug 1805694 - Simplify menulist popup layout. r=tnikkel
I decided to split this up from bug 1805414 because it's only
tangentially related to the removal of nsMenuFrame.

We have this sizetopopup attribute and behavior that allows menulists to
be sized to the contents of the popup. The popup also expands to the
menulist rect.

This means that layout is by somewhat cyclic and we need to go out of
our way to support it. However, I think we only care about the first
behavior. We don't have many non-intrinsically-sized menulists, and
if we need we can use HTML <select> instead, which does have that
behavior.

Simplify the setup to make sizetopopup only apply to menulists (we don't
have non-menulist usage anyways), and only work in the "popup depends on
the menulist" direction, not the other way around.

This will allow making the popup a regular out-of-flow element. The
change to test_menulist_paging is not needed (I restored the behavior of
eagerly layout menulists, to fix the <select> popup, but I'd like to fix
that eventually, so I'd rather leave them in, they're harmless).

Differential Revision: https://phabricator.services.mozilla.com/D164693
2022-12-16 10:23:05 +00:00
Martin Robinson
abb5044ca7 Bug 1803377 - Rename the values of the IntrinsicDirty enum r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D163607
2022-12-02 12:27:31 +00:00
Emilio Cobos Álvarez
31c279d479 Bug 1799460 - Implement label[value] and start/end cropping with CSS rather than XUL layout. r=Gijs,jfkthame
This reduces the weird interactions that can appear on menus.

This also progresses BiDi support, including for accesskeys.

Differential Revision: https://phabricator.services.mozilla.com/D161498
2022-11-16 16:27:59 +00:00