Commit Graph
53 Commits
Author SHA1 Message Date
tannal 99bf93b6a1 Bug 1895391 - Remove widget.non-native-theme.solid-outline-style pref r=gregp,emilio
Differential Revision: https://phabricator.services.mozilla.com/D210276
2024-05-14 10:05:49 +00:00
Gregory Pappas 76549dd4aa Bug 1873138 - Remove widget.non-native-theme.webrender pref r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D209605
2024-05-06 21:55:36 +00:00
Emilio Cobos Álvarez 7de669cb54 Bug 1750072 - Allow to opt-out of password reveal using appearance: textfield. r=jwatt
Much like we do for the number input spinners.

Differential Revision: https://phabricator.services.mozilla.com/D208673
2024-05-06 15:13:35 +00:00
Emilio Cobos Álvarez 305f7c58ae Bug 1893949 - Don't use a semi-transparent autofill background. r=issammani
This was needed because we didn't use to override the color of the
textfield, so it needed to work with whatever color was there already.

Now that we enforce the color however, there's no point on it being
semi-transparent.

Add a darker version of the color so that it also works on dark mode
(<input style="color-scheme: dark"> or so).

Now that it's opaque, there's no need for Theme.cpp to blend with the
field background.

Differential Revision: https://phabricator.services.mozilla.com/D209021
2024-04-30 23:34:27 +00:00
Ting-Yu Lin cf7be78eb0 Bug 1892778 Part 2 - Convert InlineDir and BlockDir to enum classes. r=dholbert
Also, rewrite GetInlineDir() and GetBlockDir() to remove bit operations for
computing the InlineDir and BlockDir enum variants.

Differential Revision: https://phabricator.services.mozilla.com/D208176
2024-04-23 03:56:42 +00:00
Mike Hommey c55fa3a8a0 Bug 1882900 - Fix build failures in widget/uikit. r=nika
This only really takes care of making it compile, although there are
still missing pieces for other directories to rely on it. This is enough
to unblock a bunch of other work.

While here, remove `virtual` on methods with `override`.

Differential Revision: https://phabricator.services.mozilla.com/D203198
2024-03-04 21:03:24 +00:00
Emilio Cobos Álvarez 70c3b51082 Bug 1871535 - Use a less opaque check color for dark disabled checkboxes. r=spohl
On a darker background this should be fine.

Differential Revision: https://phabricator.services.mozilla.com/D197875
2024-01-08 08:00:37 +00:00
Emilio Cobos Álvarez 58cf7baa59 Bug 1868338 - Improve non-native toolbarbutton appearance. r=dao,stransky
Differential Revision: https://phabricator.services.mozilla.com/D195546
2023-12-06 08:33:33 +00:00
Emilio Cobos Álvarez 1b1835b4aa Bug 1866022 - Teach GTK to render non-native tree columns and toolbars. r=dao,stransky,desktop-theme-reviewers
This fixes various things, like sort arrows not working, even in regular
non-mixed-color-scheme settings, and is a lot less code.

The toolbarbutton appearance on the problematic case described in
comment 0 could get some work (the extra borders aren't exactly pretty),
but it's still a much better improvement.

Differential Revision: https://phabricator.services.mozilla.com/D195345
2023-12-04 18:57:35 +00:00
Emilio Cobos Álvarez accc450cdf Bug 1861671 - Remove some dead macOS menu drawing code. r=mac-reviewers,bradwerth
Some of it was already dead like the arrow-button-{up,down} stuff.

Depends on D192082

Differential Revision: https://phabricator.services.mozilla.com/D192083
2023-10-31 18:57:12 +00:00
Emilio Cobos Álvarez 24fe7cd3cc Bug 1858349 - Remove now-unused menuarrow code. r=spohl,mac-reviewers,win-reviewers,rkraesig
The windows bits were already unused.

Depends on D190663

Differential Revision: https://phabricator.services.mozilla.com/D190664
2023-10-11 19:37:40 +00:00
Emilio Cobos Álvarez 6fd3d0e73c Bug 1857513 - Clean up document state setup. r=smaug
Now that we have a DocumentState type we can be a bit less explicit
(before this used EventStates, so the extra Document in the names was
useful).

Differential Revision: https://phabricator.services.mozilla.com/D190602
2023-10-11 08:24:14 +00:00
Morgan Rae Reschenberg 45d0be38d9 Bug 1791024: Make focus ring use Canvastext and Selecteditem when HCM is enabled r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D189849
2023-10-03 20:22:17 +00:00
Emilio Cobos Álvarez 8acb9034cb Bug 1849793 - Use non-native rendering for menuarrows on Linux. r=dholbert,stransky
Differential Revision: https://phabricator.services.mozilla.com/D186712
2023-08-29 11:16:36 +00:00
Jonathan Kew e8e38af098 Bug 1802687 - Account for direction:rtl in vertical writing-mode <input type=range> controls. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D171375
2023-07-08 13:19:45 +00:00
Iulian Moraru 4912cbdce2 Backed out changeset 2a8a95dd8ab8 (bug 1802687) for causing wpt failures on range-snap-to-tick-marks-03.html. 2023-07-08 07:12:57 +03:00
Jonathan Kew fca8422a0d Bug 1802687 - Account for direction:rtl in vertical writing-mode <input type=range> controls. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D171375
2023-07-07 17:36:36 +00:00
Noemi Erli 7c9b4eb20f Backed out changeset 811d8bd2f7f9 (bug 1802687) for causing failures in range-vlr.html CLOSED TREE 2023-07-07 19:32:17 +03:00
Jonathan Kew c28228a72e Bug 1802687 - Account for direction:rtl in vertical writing-mode <input type=range> controls. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D171375
2023-07-07 15:22:12 +00:00
Emilio Cobos Álvarez dd9cf52d9c Bug 1838731 - Fix scrollbar kind computation for scrollcorner. r=mstange
The scrollcorner isn't a child of a scrollbar so we don't find it.
Instead, check for the scrollable node. This info is only used on macOS,
this fixes the rendering of rtl scrollcorners with non-overlay
scrollbars, e.g.:

  <div style="border: 1px solid; width: 100%; height: 100%; overflow: scroll; direction: rtl"></div>

Or so.

Differential Revision: https://phabricator.services.mozilla.com/D181259
2023-06-16 17:30:24 +00:00
Emilio Cobos Álvarez 13b01ff69f Bug 1813046 - Simplify scrollbar sizing code. r=spohl
This removes the capability of having differently-sized vertical and
horizontal scrollbars (which is only potentially used in windows, and in
practice almost-never used). For that case, we choose the larger of
vertical/horizontal scrollbar sizes.

This is in order to be able to realistically expose the scrollbar size
to CSS, see blocked bug.

We make RecomputeScrollbarParams the central place where each scrollbar
style decides its sizes, and make GetDPIRatioForScrollbarPart handle the
cocoa special-case of scaling to 1 or 2, but nothing else.

Differential Revision: https://phabricator.services.mozilla.com/D168080
2023-01-28 21:35:51 +00:00
Emilio Cobos Álvarez 59e7b13fee 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 16528aebb2 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 dd6fd3a3b0 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
Emilio Cobos Álvarez 6c10ebd508 Bug 1802314 - Use non-native tooltips in the cocoa non-native theme too. r=spohl
We implemented a basic ThemeGeometry-based tooltip in
https://hg.mozilla.org/integration/autoland/rev/e8d65866112f, but now
that we have non-native theme support for these it seems ok to just use
it.

Differential Revision: https://phabricator.services.mozilla.com/D163023
2022-12-07 18:47:53 +00:00
Zach Hoffman a316eff7b0 Bug 1803303 - Do not display input range tick marks that are step mismatches r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D163521
2022-12-02 16:48:40 +00:00
Zach Hoffman 67f7af1ef8 Bug 841942 - Display tick marks for <input type=range> when @list/<datalist> is used r=emilio,credential-management-reviewers,sgalich
Differential Revision: https://phabricator.services.mozilla.com/D162882
2022-11-28 22:06:33 +00:00
Razvan Cojocaru 363946e17f Bug 1060421 - Change the type of [Int]PointTyped::[x|y] back to [Int]CoordTyped. r=botond
[Int]CoordTyped no longer inherits Units because otherwise
instances of [Int]IntPointTyped may get one Base subobject because
it inherits Units, and others because of BasePoint's Coord members,
which end up increasing the [Int]CoordTyped's objects size (since
according to the ISO C++ standard, different Base subobject are
required to have different addresses).

Differential Revision: https://phabricator.services.mozilla.com/D160713
2022-11-04 18:29:35 +00:00
Emilio Cobos Álvarez 17995a1298 Bug 1796849 - Teach the non-native theme to draw tooltips. r=stransky
We haven't seen this with Adwaita because it uses dark tooltips in both
light and dark mode, so stuff kinda worked out in the end.

Differential Revision: https://phabricator.services.mozilla.com/D159966
2022-10-24 09:05:31 +00:00
Emilio Cobos Álvarez a83371b226 Bug 1793700 - follow-up: Make color control styling match Chromium. r=TYLin
The previous patch made me realize that we have this widget-imposed size
for color controls which doesn't match any other browser. This patch
removes it.

I don't feel strongly whether we should land this other than "it matches
other browsers, and removes a special case from Gecko". Behavior might
be simpler to understand for authors this way.

Differential Revision: https://phabricator.services.mozilla.com/D158620
2022-10-05 21:32:59 +00:00
Emilio Cobos Álvarez 99a3719f8e Bug 1793689 - Make GetMinimumWidgetSize work properly on non-XUL flexbox. r=TYLin,layout-reviewers
The XUL behavior in nsBox.cpp is fairly different to what the non-XUL
layout code paths do. In particular, canOverride=false means that the
min-{width,height} properties cannot go under the min widget size of the
widget, but that doesn't mean that intrinsic sizes don't affect the
final size of the widget.

This is very visible if you turn on flex emulation on Windows or macOS,
where the toolbar has an appearance that returns
width=0,height=N,canOverride=false.

With flex emulation we'd collapse the item to be zero-width, which is
not good at all.

The good thing is that this is no longer exposed to the web
(non-native-theme always returns canOverride=true), and our front-end
code doesn't seem to rely on this, so we can just remove support for
canOverride=false.

Differential Revision: https://phabricator.services.mozilla.com/D158608
2022-10-05 19:09:29 +00:00
Emilio Cobos Álvarez d664cd5939 Bug 1790670 - Fix color of high-contrast checkboxes. r=morgan
This restores behavior from before my patch, and makes it so that it's
easier to see which color pair ends up getting used.

Differential Revision: https://phabricator.services.mozilla.com/D157271
2022-09-14 23:14:30 +00:00
Emilio Cobos Álvarez fca075b1c4 Bug 1784855 - Add basic support for drawing non-native appearance: menuitem items. r=stransky
This allows us to correctly draw items with mismatched color-scheme
on GTK.

This is a reasonably simple fix. A more elaborate fix could be not using
appearance to draw menuitems on Linux at all, just like we don't use it
to draw menupopups anymore. But in practice it's a bit harder because we
use it also to draw menubar items (which probably should be its own
appearance type instead). I can look into that, but this seems
reasonable for now.

Differential Revision: https://phabricator.services.mozilla.com/D154680
2022-08-16 09:48:07 +00:00
Emilio Cobos Álvarez 45bade4ea5 Bug 1776592 - Make auto outline draw two differently-colored strokes instead of one. r=mstange
Behind a pref, just in case.

Differential Revision: https://phabricator.services.mozilla.com/D150466
2022-07-20 11:43:35 +00:00
criss 98d2dff322 Backed out changeset 99d1caaa88e2 (bug 1776592) for causing reftest failures on outline-auto-002.html. CLOSED TREE 2022-07-20 02:08:55 +03:00
Emilio Cobos Álvarez 6736f5d085 Bug 1776592 - Make auto outline draw two differently-colored strokes instead of one. r=mstange
Behind a pref, just in case.

Differential Revision: https://phabricator.services.mozilla.com/D150466
2022-07-19 21:53:45 +00:00
Emilio Cobos Álvarez 2ee6a213c3 Bug 1776858 - Cleanup and add some missing unit conversion methods. r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D150465
2022-06-28 18:52:19 +00:00
smolnar d03fa3b71c Backed out changeset d1e0b50deab6 (bug 1776858) for causing crashtest assertion failures in nsAlgorithm CLOSED TREE 2022-06-28 18:57:04 +03:00
Emilio Cobos Álvarez b78351bb5b Bug 1776858 - Cleanup and add some missing unit conversion methods. r=gfx-reviewers,jrmuizel
This also makes stuff like `CSSPixel::ToAppUnits(<integer>)` not do
floating point math, which should be slightly faster.

Differential Revision: https://phabricator.services.mozilla.com/D150465
2022-06-28 13:26:02 +00:00
Emilio Cobos Álvarez fb118ad24e Bug 1773070 - Rename/remove some eventState/s variables. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D148558
2022-06-07 23:09:54 +00:00
Emilio Cobos Álvarez 1c58e2a928 Bug 1773070 - Unify Gecko and Servo EventState/ElementState bits. r=smaug
Add a dom/base/rust crate called just "dom" where we can share these.

Most of the changes are automatic:

  s/mozilla::EventStates/mozilla::dom::ElementState/
  s/EventStates/ElementState/
  s/NS_EVENT_STATE_/ElementState::/
  s/NS_DOCUMENT_STATE_/DocumentState::/

And so on. This requires a new cbindgen version to avoid ugly casts for
large shifts.

Differential Revision: https://phabricator.services.mozilla.com/D148537
2022-06-07 23:09:52 +00:00
Ray Kraesig 6a45050a36 Bug 1209411 - adjust dropdown-arrow orientation r=emilio
Adjust the dropdown-arrow to take into account the orientation of the
dropdown itself, so as to point in the direction the dropdown should
emerge from.

Differential Revision: https://phabricator.services.mozilla.com/D139091
2022-06-02 15:11:01 +00:00
Emilio Cobos Álvarez 942d7c929a Bug 1769012 - Deal with <xul:tree> scrollbars in Theme.cpp. r=mstange
Tree has a non-anonymous scrollbar whose mediator is the
nsTreeBodyFrame:

  https://searchfox.org/mozilla-central/rev/b72e9d7d63bf499d1d8168291b93d4ec7fde236e/toolkit/content/widgets/tree.js#601

So use the scrollbar mediator interface rather than poking at the scroll
frame directly.

Differential Revision: https://phabricator.services.mozilla.com/D146158
2022-05-12 23:21:05 +00:00
Emilio Cobos Álvarez 4b3f9b7a6e Bug 1764435 - Fix scrollbar drawing when scrollbars are on the left. r=spohl
Our scrollbar drawing code had various RTL checks for the writing mode.

These checks were busted since bug 1554571 (where the writing-mode of
the scrollbar frames and so on is reset). However, they also wouldn't be
correct (we allow to customize scrollbar position via pref).

Instead, look at the scrollable frame to really know if the scrollbar is
on the right or not. Compute that once in Theme.cpp and pass it around
light we were doing for the "is horizontal" bit.

Differential Revision: https://phabricator.services.mozilla.com/D145865
2022-05-09 17:09:24 +00:00
Emilio Cobos Álvarez 09b4742921 Bug 1756210 - Let native theme focus outline be controlled only by CSS. r=mstange
This might be a bit more controversial, but matches Chromium at least,
and it makes sense to me... Would've also fixed this particular bug,
though I think the previous patch is also desirable if devtools ever
wants to add `:disabled` locked states or so.

Depends on D140529

Differential Revision: https://phabricator.services.mozilla.com/D140530
2022-03-09 11:45:10 +00:00
Butkovits Atila 06ca8f0e97 Backed out changeset 3c67de8ae3fd (bug 1756210) for causing failures at test_focusrings.xhtml. CLOSED TREE 2022-03-09 01:43:11 +02:00
Emilio Cobos Álvarez 5a1422347d Bug 1756210 - Let native theme focus outline be controlled only by CSS. r=mstange
This might be a bit more controversial, but matches Chromium at least,
and it makes sense to me... Would've also fixed this particular bug,
though I think the previous patch is also desirable if devtools ever
wants to add `:disabled` locked states or so.

Depends on D140529

Differential Revision: https://phabricator.services.mozilla.com/D140530
2022-03-08 18:13:52 +00:00
Emilio Cobos Álvarez ae16e4da83 Bug 1754225 - Allow using dark themed scrollbars on GTK too. r=stransky,mstange
This is faster and more straight-forward code than the old
ShouldUseDarkScrollbar shenanigans, and allows to have dark-themed
scrollbars.

Differential Revision: https://phabricator.services.mozilla.com/D138077
2022-02-09 11:27:16 +00:00
Andi-Bogdan Postelnicu 3387e49cfb Bug 1519636 - Reformat recent changes to the Google coding style. r=sylvestre
Updated with clang-format version 13.0.0 (taskcluster-dIIauZE0TkuXy6_23BQhcw)

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D137147
2022-01-31 17:00:21 +00:00
Emilio Cobos Álvarez 230cc5ddea Bug 1749531 - Allow to override native theme scrollbar styles. r=mstange
Depends on D136129

Differential Revision: https://phabricator.services.mozilla.com/D136130
2022-01-25 21:31:44 +00:00