Commit Graph

131 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
d8a3b41034 Bug 1791219 - Fix direction of <select>. r=mconley
Differential Revision: https://phabricator.services.mozilla.com/D157576
2022-09-21 02:00:13 +00:00
Emilio Cobos Álvarez
9e5d2b06c0 Bug 1789522 - Provide transient user activation when handling user input from JS. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D156670
2022-09-07 20:36:41 +00:00
Andreea Pavel
3553966d60 Bug 1775896 - update disabling condition for browser_selectpopup.js r=intermittent-reviewers,jmaher DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D156026
2022-08-30 23:49:45 +00:00
Daniel Holbert
716972942b Bug 1786210: Remove mentions of unused pref gfx.font_loader.interval. r=emilio
This patch doesn't impact behavior.

The pref "gfx.font_loader.interval" used to control certain aspects of
font-loading behavior, but that code has evolved and we no longer read the
value of this pref anywhere.

Differential Revision: https://phabricator.services.mozilla.com/D155183
2022-08-21 23:45:56 +00:00
Emilio Cobos Álvarez
4e0e6bec60 Bug 1783500 - Account for input region margins when anchoring to a large rect. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D154074
2022-08-11 10:40:56 +00:00
Marian-Vasile Laza
9bc9d59b2f Backed out changeset 40d9553a84b9 (bug 1783500) for causing mochitest failures on test_popup_attribute.xhtml. CLOSED TREE 2022-08-10 14:34:51 +03:00
Emilio Cobos Álvarez
25cd340e57 Bug 1783500 - Account for input region margins when anchoring to a large rect. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D154074
2022-08-10 10:46:22 +00:00
Norisz Fay
1743877caf Backed out 2 changesets (bug 1783500) for causing mochitest failures on test_menulist_keynav.xhtml CLOSED TREE
Backed out changeset 96ef708fe045 (bug 1783500)
Backed out changeset fc1e55745c43 (bug 1783500)
2022-08-09 16:25:58 +03:00
Emilio Cobos Álvarez
027e7eb37b Bug 1783500 - Account for negative popup margins when anchoring to a large rect. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D154074
2022-08-09 10:42:39 +00:00
Emilio Cobos Álvarez
82a49f6600 Bug 1782858 - Make color-scheme affect Windows' non-native menus. r=desktop-theme-reviewers,dao
This matches what Linux and macOS do, and that allows the fix for bug 1782623
to work on Windows for unstyled selects.

This also simplifies the CSS (though it adds a new system color which is a bit
more annoying). I filed https://github.com/w3c/csswg-drafts/issues/7561 to
propose adding a more generic way to do this in the future (not just for
Firefox).

Differential Revision: https://phabricator.services.mozilla.com/D153549
2022-08-03 20:33:09 +00:00
Mark Banner
1e3410cbdd Bug 1782008 - Remove now unnecessary .eslintrc.js files. r=webcompat-reviewers,extension-reviewers,media-playback-reviewers,pip-reviewers,denschub,rpl,alwu,mossop
Differential Revision: https://phabricator.services.mozilla.com/D152736
2022-08-03 11:16:20 +00:00
Emilio Cobos Álvarez
cdefe1463a Bug 1782623 - Set select color-scheme based on child background. r=dholbert
This makes us use light or dark select popups on supported platforms
based on the background of the select element, which allows us to use
the right scrollbar color.

Depends on D153424

Differential Revision: https://phabricator.services.mozilla.com/D153425
2022-08-02 15:49:13 +00:00
Emilio Cobos Álvarez
51af54fe65 Bug 1774378 - Make select code harder to mess up. r=Gijs
Right now we rely on the menulist to be injected by hand in all the
relevant windows. Instead create it lazily, making the select code more
standalone.

The DevTools window was missing it, for example.

Differential Revision: https://phabricator.services.mozilla.com/D149620
2022-06-21 21:42:58 +00:00
Emilio Cobos Álvarez
afb69e165e Bug 1768278 - Prevent negative margins from causing us to flip / resize / slide popups. r=NeilDeakin
Differential Revision: https://phabricator.services.mozilla.com/D145879
2022-05-17 14:37:23 +00:00
Gijs Kruitbosch
edda40141b Bug 1753696 - Automatic rewrite: replace add_task(setup with add_setup in browser mochitest, r=Standard8,webcompat-reviewers,twisniewski
Differential Revision: https://phabricator.services.mozilla.com/D141437
2022-03-30 16:16:42 +00:00
Norisz Fay
e1d7571cc8 Backed out 2 changesets (bug 1753696) for causing multiple dt and bc failures CLOSED TREE
Backed out changeset 67fd9edfbcea (bug 1753696)
Backed out changeset a9d957ea887b (bug 1753696)
2022-03-30 12:17:55 +03:00
Gijs Kruitbosch
1214ac636b Bug 1753696 - Automatic rewrite: replace add_task(setup with add_setup in browser mochitest, r=Standard8,webcompat-reviewers,twisniewski
Differential Revision: https://phabricator.services.mozilla.com/D141437
2022-03-30 08:18:51 +00:00
Emilio Cobos Álvarez
5b179c996b Bug 1760317 - Fix browser_selectpopup_colors to not read the colors too early. CLOSED TREE 2022-03-18 21:40:03 +02:00
Emilio Cobos Álvarez
64175b6c73 Bug 1744009 - Simplify combobox <select> code. r=mconley,dholbert
With this patch on its own we get some a11y tests failures, but those
are fixed on a later patch.

Combobox select no longer creates frames for its <options>, nor an
nsListControlFrame. Instead, it computes its right intrinsic size using
the largest size of the options. This is better, because we render the
option text using the select style so if the select and option styles
are mismatched it'd cause changes in the size of the select when text
changes. See the following in a build without the patch, for example:

  <select>
    <option>ABC</option>
    <option style="font-size: 1px">Something long</option>
  </select>

This seems like a rather obscure case, but it's important to get it
right, see bug 1741888.

With this patch we use the same setup in content and parent processes
(this needs bug 1596852 and bug 1744152). This means we can remove a
bunch of the native view and popup code in nsListControlFrame. A couple
browser_* tests are affected by this change and have been tweaked
appropriately (the changes there are trivial).

Not creating an nsListControlFrame for dropdown select means that we
need to move a bunch of the event handling code from nsListControlFrame
to a common place that nsComboboxControlFrame can also use. That place
is HTMLSelectEventListener, and I think the setup is much nicer than
having the code intertwined with nsListControlFrame. It should be
relatively straight-forward to review, mostly moving code from one part
to another.

Another thing that we need to do in HTMLSelectEventListener that we
didn't use to do is listening for DOM mutations on the dropdown. Before,
we were relying on changes like text mutations triggering a reflow of
the listcontrolframe, which also triggered a reflow of the
comboboxcontrolframe, which in turn updated the text of the anonymous
content. Now we need to trigger that reflow manually.

There are some further simplifications that can be done after this
lands (cleanup naming of openInParentProcess and so on, among others),
but I'd rather land this first (after the merge of course) and work on
them separately.

Differential Revision: https://phabricator.services.mozilla.com/D132719
2022-01-17 11:10:05 +00:00
Marian-Vasile Laza
84e23c5194 Backed out 2 changesets (bug 1744009) for causing reftest failures on select-3.html.
Backed out changeset 3e44e31d3d12 (bug 1744009)
Backed out changeset 619389788775 (bug 1744009)
2022-01-17 11:14:27 +02:00
Emilio Cobos Álvarez
d4e563138d Bug 1744009 - Simplify combobox <select> code. r=mconley,dholbert
With this patch on its own we get some a11y tests failures, but those
are fixed on a later patch.

Combobox select no longer creates frames for its <options>, nor an
nsListControlFrame. Instead, it computes its right intrinsic size using
the largest size of the options. This is better, because we render the
option text using the select style so if the select and option styles
are mismatched it'd cause changes in the size of the select when text
changes. See the following in a build without the patch, for example:

  <select>
    <option>ABC</option>
    <option style="font-size: 1px">Something long</option>
  </select>

This seems like a rather obscure case, but it's important to get it
right, see bug 1741888.

With this patch we use the same setup in content and parent processes
(this needs bug 1596852 and bug 1744152). This means we can remove a
bunch of the native view and popup code in nsListControlFrame. A couple
browser_* tests are affected by this change and have been tweaked
appropriately (the changes there are trivial).

Not creating an nsListControlFrame for dropdown select means that we
need to move a bunch of the event handling code from nsListControlFrame
to a common place that nsComboboxControlFrame can also use. That place
is HTMLSelectEventListener, and I think the setup is much nicer than
having the code intertwined with nsListControlFrame. It should be
relatively straight-forward to review, mostly moving code from one part
to another.

Another thing that we need to do in HTMLSelectEventListener that we
didn't use to do is listening for DOM mutations on the dropdown. Before,
we were relying on changes like text mutations triggering a reflow of
the listcontrolframe, which also triggered a reflow of the
comboboxcontrolframe, which in turn updated the text of the anonymous
content. Now we need to trigger that reflow manually.

There are some further simplifications that can be done after this
lands (cleanup naming of openInParentProcess and so on, among others),
but I'd rather land this first (after the merge of course) and work on
them separately.

Differential Revision: https://phabricator.services.mozilla.com/D132719
2022-01-16 23:31:22 +00:00
Emilio Cobos Álvarez
6b2389d62e Bug 1744300 - More efficiently style content select entries. r=mconley
We're already batching similar styles, so by using classes instead of
style attributes and :nth-child selectors we allow the elements to share
styles, and make their styling more efficient over-all.

Differential Revision: https://phabricator.services.mozilla.com/D132829
2021-12-06 22:04:02 +00:00
raquelvargas
782eaca77b Bug 1738229 - Stop using the second argument to ChromeUtils.import in various files in browser. r=Standard8,webcompat-reviewers,twisniewski
Differential Revision: https://phabricator.services.mozilla.com/D129842
2021-11-02 17:21:07 +00:00
Emilio Cobos Alvarez
5c5b0deb3d Bug 1734115 - Fix Windows-specific select popup test that was relying on -moz-Combobox to be exactly white. CLOSED TREE
MANUAL PUSH: Orange fix CLOSED TREE
2021-10-05 21:27:40 +02:00
Emilio Cobos Álvarez
fe6daf51b4 Bug 1734040 - Select input event should be composed. r=edgar,annevk
This matches other browsers and input elements.

Differential Revision: https://phabricator.services.mozilla.com/D127554
2021-10-05 16:53:48 +00:00
Emilio Cobos Alvarez
c946015d10 Bug 1708735 - Make the arrowpanel code more generic. r=dao,zombie
Share the concept of a panel content with all other menupopups / panels.

This avoids importing global.css in the shadow tree, and renames the
arrowcontent part to just "content", since we want to introduce a
"content" part for other panels.

This shouldn't change behavior but makes bug 1708136 a matter of
tweaking a couple CSS rules and fixing up test failures.

Differential Revision: https://phabricator.services.mozilla.com/D113990
2021-05-30 12:31:49 +00:00
Butkovits Atila
0cd2df1600 Backed out changeset 229e905d571e (bug 1708735) for multiple regressions. CLOSED TREE 2021-05-30 14:27:20 +03:00
Emilio Cobos Alvarez
33b5b3ec17 Bug 1708735 - Make the arrowpanel code more generic. r=dao,zombie
Share the concept of a panel content with all other menupopups / panels.

This avoids importing global.css in the shadow tree, and renames the
arrowcontent part to just "content", since we want to introduce a
"content" part for other panels.

This shouldn't change behavior but makes bug 1708136 a matter of
tweaking a couple CSS rules and fixing up test failures.

Differential Revision: https://phabricator.services.mozilla.com/D113990
2021-05-28 11:56:07 +00:00
Gijs Kruitbosch
71ebc9493a Bug 1708985 - enforce the default background colour on the ContentSelect menulist's menupopup when custom option foreground colours are used, r=emilio,jaws
Broadly, this patch does 2 things:

- it mirrors the logic bug 1702258 introduced for <select> styling for <option> styling
- it enforces that if the website specifies custom foreground colours for options,
  we use the website-specified colour for the option background, too (even if it
  matches the UA/select style).

I also added automated testing for 3 cases:
1. the default dark mode situation (where we expect dark mode styles),
2. the case from the bug where the website specifies `#fff` for the background
of the select and the background of the options, but specifies a custom
foreground colour for the option (but not the select).
3. a very similar case where the website only specifies the background on the
select, and only the foreground on the option.

Differential Revision: https://phabricator.services.mozilla.com/D114382
2021-05-06 21:16:12 +00:00
Neil Deakin
3f1ebf3227 Bug 1667235, fix various issues with the browser_selectpopup.js test, mostly on Windows, r=Gijs
Change the height of a window opened during the test now that menus on windows 10 are larger. Make sure that the zoom level is reset after the test so that running the test again doesn't use the old zoom level. The default value of 'ignorekeys' is 'shortcuts' on Windows so reset this properly otherwise the test fails if run again.

Differential Revision: https://phabricator.services.mozilla.com/D112407
2021-04-19 17:22:08 +00:00
Butkovits Atila
1e7d77464a Bug 1667235 - disable browser_selectpopup.js on Windows for frequent failures. r=intermittent-reviewers,jmaher DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D111716
2021-04-12 21:35:48 +00:00
Neil Deakin
2cbab9aae4 Bug 1701963, fix some menu related tests on Windows 10 that fail with the larger menu size, r=Gijs
Account for the border and padding now on the inner arrowscrollbox, and increase some window and margin
sizes to account for the menu being larger in Windows 10.

Differential Revision: https://phabricator.services.mozilla.com/D110587
2021-04-05 16:00:32 +00:00
Emilio Cobos Alvarez
5f7b937abf Bug 1702847 - Ensure we set the select background from content if either background or color is set. r=Gijs
This is also an issue with proton in dark mode, and I think that this solution
is sensible.

Differential Revision: https://phabricator.services.mozilla.com/D110733
2021-04-05 09:28:21 +00:00
Emilio Cobos Alvarez
9298192d52 Bug 1702258 - Fix interaction of proton with custom styles. r=Gijs
If the site specifies the background-color, we also specify the color to the
HTML UA style. This fixes the msn issue in a better way.

Unstyled selects would still get dark mode.

Differential Revision: https://phabricator.services.mozilla.com/D110586
2021-04-01 19:29:44 +00:00
Emilio Cobos Álvarez
6850430ece Bug 1701792 - Also use standins for graytext with the non-native theme, as it's used for disabled controls. r=mstange
Also remove a fixed FIXME comment, while I was going through the select code to
fix browser_selectpopup_colors.

Differential Revision: https://phabricator.services.mozilla.com/D110154
2021-03-30 04:24:40 +00:00
Gijs Kruitbosch
0180ad464d Bug 1693406 - fix select dropdown styling in proton when the page customizes it, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D105642
2021-02-18 16:33:20 +00:00
Andrew Nicols
230a1c5499 Bug 1686663: Set the value of buttons based on provided event r=smaug
Currently the default value of buttons is set to
MOUSE_BUTTONS_NOT_SPECIFIED, which defers calculation of the value to
the DOMWindowUtils GetButtonsFlagForButton function. This calculates a
default value based upon the value of the button key.

By specifying a default button value of 0, which has a meaning of
ePrimary, the buttons value is calculated as the
ePrimaryFlag (1), suggesting that a button was pressed.

This patch changes the behaviour to set the value of buttons based on
the original value of button before the default was applied. The value
of buttons also considers the event type to ensure that a mousedown
event has a default value calculated by DOMWindowUtils.

With the new behaviour:
- if a value was explicitly set for buttons, this is used
- if a value was explicitly set for button, then the not-specified
  constant is used to defer calculation to DOMWindowUtils
- if an event type was specified and that event type was not the
  'mousedown' event, then the no-button constant is used
- if an event type was not specified or it was for the 'mousedown'
  event, then the not-specified constant is used to defer calculation to
  DOMWindowUtils

Differential Revision: https://phabricator.services.mozilla.com/D101690
2021-02-04 00:59:54 +00:00
Nika Layzell
ed9e85fc9a Bug 1671983 - Part 4: Stop awaiting BrowserTestUtils.loadURI, r=annyG,remote-protocol-reviewers,extension-reviewers,preferences-reviewers,whimboo,zombie
This method only is async in order to allow callers to wait for a process switch
triggered by the call to `loadURI` to be finished before resolving. With
DocumentChannel, we should never trigger a process switch eagerly like this
again, so we don't need any of the async behaviour here anymore.

This part is largely mechanical changes to tests, removing the `await` calls on
`loadURI`, and a follow-up part will remove the actual async logic from
`BrowserTestUtils.loadURI`.

Differential Revision: https://phabricator.services.mozilla.com/D94641
2020-11-12 18:01:03 +00:00
Emilio Cobos Alvarez
6ed590a4f8 Bug 1675323 - Apply scrollbar-width to the content select scrollbox. r=mconley
(Instead of applying it directly to the menulist).

Since it's not inherited, we need to get the right value over to the scrollbox.
For that, export it from the arrowscrollbox, with the same name as the places
menupopup uses for the same purpose.

Differential Revision: https://phabricator.services.mozilla.com/D95887
2020-11-05 21:11:54 +00:00
Razvan Maries
beb7584870 Backed out 7 changesets (bug 1658084, bug 1671983) for perma failures on browser_async_remove_tab.js and browser_e10s_chrome_process.js. CLOSED TREE
Backed out changeset 2e6309c1cdbd (bug 1658084)
Backed out changeset 99aafd9304ef (bug 1671983)
Backed out changeset 80280b85280a (bug 1671983)
Backed out changeset 008db2659002 (bug 1671983)
Backed out changeset 32bd45c7fe3a (bug 1671983)
Backed out changeset 56e227e6580c (bug 1671983)
Backed out changeset a404f809f79d (bug 1671983)
2020-11-04 04:23:47 +02:00
Nika Layzell
f6849f1603 Bug 1671983 - Part 4: Stop awaiting BrowserTestUtils.loadURI, r=annyG,remote-protocol-reviewers,extension-reviewers,preferences-reviewers,whimboo,zombie
This method only is async in order to allow callers to wait for a process switch
triggered by the call to `loadURI` to be finished before resolving. With
DocumentChannel, we should never trigger a process switch eagerly like this
again, so we don't need any of the async behaviour here anymore.

This part is largely mechanical changes to tests, removing the `await` calls on
`loadURI`, and a follow-up part will remove the actual async logic from
`BrowserTestUtils.loadURI`.

Differential Revision: https://phabricator.services.mozilla.com/D94641
2020-11-04 00:55:36 +00:00
Emilio Cobos Alvarez
6eb1ea3bbe Bug 1394491 - Don't override menucaption background for content selects. r=mconley
So that they use the select background color by default. The code in
SelectParent expects this when figuring out whether to set background colors
too. This matches other browsers and MacOS, see:

  data:text/html,<select style="background: red"><optgroup label="foo"><option>Bar</option><option>Baz</option></optgroup></select>

Differential Revision: https://phabricator.services.mozilla.com/D95690
2020-11-03 17:56:23 +00:00
Jonathan Kew
9b72ad96e4 Bug 1533462 - Run font-info loader immediately for accessiblecaret and forms tests, for more consistent behavior. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D88545
2020-08-30 22:59:57 +00:00
Joel Maher
534301ae86 Bug 1661132 - disable a few mochitests on osx opt. r=bc
disable a few mochitests on osx opt

Differential Revision: https://phabricator.services.mozilla.com/D88193
2020-08-25 21:48:25 +00:00
Emilio Cobos Álvarez
a846c9c4ed Bug 1650703 - Don't double-apply text zoom for <select> popups. r=Gijs
The computed font-size already has the zoom value in that case.

Differential Revision: https://phabricator.services.mozilla.com/D83275
2020-07-13 10:36:09 +00:00
Emilio Cobos Álvarez
9c19b06691 Bug 1643522 - follow-up: Allow some floating point inaccuracies.
MANUAL PUSH: Orange on a CLOSED TREE
2020-06-05 15:43:51 +02:00
Emilio Cobos Álvarez
88580a19f0 Bug 1643522 - Use a sensible way to get the zoom for a browser in SelectParent.jsm. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D78471
2020-06-05 10:48:59 +00:00
Emilio Cobos Álvarez
58f95a9a17 Bug 1634109 - Support scrollbar customization on the <select> dropdown. r=Gijs
This needs another platform fix (bug 1571376), but I'll make sure that's
fixed before landing this.

Differential Revision: https://phabricator.services.mozilla.com/D73184
2020-04-30 13:12:50 +00:00
Edgar Chen
11ec3fb80d Bug 1628186 - Mouse event on <select> elements should be composed; r=mconley
Differential Revision: https://phabricator.services.mozilla.com/D71073
2020-04-17 16:25:34 +00:00
Bogdan Tara
87c11c1d7e Bug 40545 - Fix prettier errors on browser_selectpopup.js and SelectChild.jsm CLOSED TREE 2020-04-06 21:32:59 +03:00