Граф коммитов

141 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez 7875df041f Bug 1560702 - Improve hit boxes of titlebar buttons. r=stransky,desktop-theme-reviewers,dao
In order to do it, expose the button padding to CSS via env(), and make
the buttons just use the regular drawing.

This slightly changes the padding to the end of the titlebar to match
one half of the inter-button spacing, rather that however much padding
the headerbar has.

We could improve on this slightly by also exposing the headerbar padding
and applying that to the last button, but that's not terribly easy to do
due to us supporting re-ordering of the titlebar buttons, and reversing
their placement, so it'd involve some rather hacky CSS. Not impossible,
but not trivial, and this looks good enough IMO.

Differential Revision: https://phabricator.services.mozilla.com/D202616
2024-02-27 10:28:56 +00:00
Emilio Cobos Álvarez 7fb6dc20f7 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 4d0e714795 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 0cc423b3e3 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 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 4b3775e6ac 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
Emilio Cobos Álvarez bdce6101d4 Bug 1846859 - Remove appearance: {checkbox,radio}-{label,container}. r=desktop-theme-reviewers,dao
I didn't find a single GTK theme that drew something useful for this:

 * The container appearance isn't needed. It is a hack needed to get the
   right styles for the native checkbox, but that's it, we don't need to
   expose it to CSS.

 * The label appearance was meant to draw the focus outline but since it
   didn't work reliably we've been doing it manually since seven years
   ago (see bug 582951 and bug 1312169).

Other platforms also don't use these so this simplifies the code a bit.

Depends on D185279

Differential Revision: https://phabricator.services.mozilla.com/D185286
2023-08-03 16:36:39 +00:00
Emilio Cobos Álvarez 55478c757e Bug 1845636 - Allow browser chrome to enable the non-native theme. r=dshin
I tried to reftest this, but actually the non-native-theme is already
enabled on all reftests, so...

Differential Revision: https://phabricator.services.mozilla.com/D184740
2023-07-27 22:09:10 +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 825b7b76e5 Bug 1833403 - Simplify some appearance code. r=stransky,mac-reviewers,handyman,devtools-reviewers,mstange
I was looking into simplifying our scrollbar styles:

 * StyleAppearance::Resizer is not used in content, and some of the
   values were only for <xul:window> which are not supported anymore.

 * Statusbarpanel and Resizerpanel aren't used. Statusbar is only used
   once on macOS so we only need to keep it there.

Differential Revision: https://phabricator.services.mozilla.com/D178374
2023-05-24 11:13:58 +00:00
Iulian Moraru 729b189a97 Backed out changeset f020820671c4 (bug 1833403) for causing reftest failures on resizer-bottomend.xhtml. CLOSED TREE 2023-05-24 01:48:48 +03:00
Emilio Cobos Álvarez 6a17b5fdf8 Bug 1833403 - Simplify some appearance code. r=stransky,mac-reviewers,handyman,devtools-reviewers,mstange
I was looking into simplifying our scrollbar styles:

 * StyleAppearance::Resizer is not used in content, and some of the
   values were only for <xul:window> which are not supported anymore.

 * Statusbarpanel and Resizerpanel aren't used. Statusbar is only used
   once on macOS so we only need to keep it there.

Differential Revision: https://phabricator.services.mozilla.com/D178374
2023-05-23 15:43:45 +00:00
Norisz Fay 52188d9733 Backed out changeset e2d6154400a7 (bug 1833403) for causing reftest failures on resizer-bottomend.xhtml 2023-05-23 01:03:26 +03:00
Emilio Cobos Álvarez 05b4470d2d Bug 1833403 - Simplify some appearance code. r=stransky,mac-reviewers,handyman,devtools-reviewers,mstange
I was looking into simplifying our scrollbar styles:

 * StyleAppearance::Resizer is not used in content, and some of the
   values were only for <xul:window> which are not supported anymore.

 * Statusbarpanel and Resizerpanel aren't used. Statusbar is only used
   once on macOS so we only need to keep it there.

Differential Revision: https://phabricator.services.mozilla.com/D178374
2023-05-22 20:39:11 +00:00
Emilio Cobos Álvarez fa37578f52 Bug 1828413 - Use more non-native rendering of menus. r=stransky
This makes our menus closer to GTK4, and depends less on the native menu
rendering etc. Thunderbird already does this to some extent.

Leave the old code behind a pref for now (just in case). Also fix some
code in nsNativeTheme::GetContentState (fixes rendering of radio menu
items).

Differential Revision: https://phabricator.services.mozilla.com/D175664
2023-04-20 11:42:44 +00:00
Cristina Horotan 8b53b2373f Backed out changeset c099d64b17e6 (bug 1828413) for causing multiple Menu related failures. CLOSED TREE 2023-04-19 14:51:33 +03:00
Emilio Cobos Álvarez a71dc7a55b Bug 1828413 - Use more non-native rendering of menus. r=stransky
This makes our menus closer to GTK4, and depends less on the native menu
rendering etc. Thunderbird already does this to some extent.

Leave the old code behind a pref for now (just in case). Also fix some
code in nsNativeTheme::GetContentState (fixes rendering of radio menu
items).

Differential Revision: https://phabricator.services.mozilla.com/D175664
2023-04-19 10:08:30 +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
Emilio Cobos Álvarez 69535154e5 Bug 1792802 - Fix tree column picker. r=aminomancer
This element had a really weird dependency on the order of the command
events from the menuitems and the button which broke in bug 1790920.

Instead of keeping this element as a XULButtonElement, have a separate
button and popup. That's simpler and less prone to breakage, and allows
to get rid of special cases in Gecko.

Differential Revision: https://phabricator.services.mozilla.com/D158438
2022-10-05 06:59:13 +00:00
Norisz Fay 167133ff80 Backed out changeset f9249f760526 (bug 1792802) for causing mochitest failures on test_struct_tree.xhtml CLOSED TREE 2022-10-05 05:58:02 +03:00
Emilio Cobos Álvarez 5c4de29d0e Bug 1792802 - Fix tree column picker. r=aminomancer
This element had a really weird dependency on the order of the command
events from the menuitems and the button which broke in bug 1790920.

Instead of keeping this element as a XULButtonElement, have a separate
button and popup. That's simpler and less prone to breakage, and allows
to get rid of special cases in Gecko.

Differential Revision: https://phabricator.services.mozilla.com/D158438
2022-10-05 02:09:03 +00:00
Emilio Cobos Álvarez 87ca092596 Bug 1782623 - Rename nsNativeTheme::IsDarkBackground to IsDarkBackgroundForScrollbar, and clean up a bit surrounding code. r=dholbert
This patch shouldn't change behavior. The Cocoa changes in particular
just save useless frame tree walks, since ThemeColors already computes
the color scheme in ColorSchemeForWidget.

Differential Revision: https://phabricator.services.mozilla.com/D153424
2022-08-02 13:20:40 +00:00
Nika Layzell c15823d075 Bug 1772006 - Part 5: Simplify and move the string searching APIs from ns[T]StringObsolete, r=xpcom-reviewers,necko-reviewers,eeejay,dragana,barret
The biggest set of APIs from ns[T]StringObsolete which are still heavily used
are the string searching APIs. It appears the intention was for these to be
replaced by the `FindInReadable` APIs, however that doesn't appear to have
happened.

In addition, the APIs have some quirks around their handling of mixed character
widths. These APIs generally supported both narrow strings and the native
string type, probably because char16_t string literals weren't available until
c++11. Finally they also used easy-to-confuse unlabeled boolean and integer
optional arguments to control behaviour.

These patches do the following major changes to the searching APIs:

1. The ASCII case-insensitive search method was split out as
   LowerCaseFindASCII, rather than using a boolean. This should be less
   error-prone and more explicit, and allows the method to continue to use
   narrow string literals for all string types (as only ASCII is supported).
2. The other [R]Find methods were restricted to only support arguments with
   matching character types. I considered adding a FindASCII method which would
   use narrow string literals for both wide and narrow strings but it would've
   been the same amount of work as changing all of the literals to unicode
   literals.
   This ends up being the bulk of the changes in the patch.
3. All find methods were re-implemented using std::basic_string_view's find
   algorithm or stl algorithms to reduce code complexity, and avoid the need to
   carry around the logic from nsStringObsolete.cpp.
4. The implementations were moved to nsTStringRepr.cpp.
5. An overload of Find was added to try to catch callers which previously
   called `Find(..., false)` or `Find(..., true)` to set case-sensitivity, due
   to booleans normally implicitly coercing to `index_type`. This should
   probably be removed at some point, but may be useful during the transition.

Differential Revision: https://phabricator.services.mozilla.com/D148300
2022-07-30 00:12:48 +00:00
Emilio Cobos Álvarez 482d8239cb Bug 1777135 - Part 2: Improve nsNativeTheme::IsDarkBackground by accounting for default bg color. r=dholbert
Since callers want just an effective color to compute whether it's dark,
we simplify the API a bit too.

This makes sure we find the dark background in plain text documents.

Differential Revision: https://phabricator.services.mozilla.com/D151018
2022-07-12 09:51:47 +00:00
criss c6b2c5db61 Backed out 9 changesets (bug 1772006) causing build bustages on nsTString.cpp. CLOSED TREE
Backed out changeset f17c7565707b (bug 1772006)
Backed out changeset c725fe1f5882 (bug 1772006)
Backed out changeset d19663161261 (bug 1772006)
Backed out changeset b6611ab002d9 (bug 1772006)
Backed out changeset 790f42b64af9 (bug 1772006)
Backed out changeset 79a734b4e4d9 (bug 1772006)
Backed out changeset 42730aae16ea (bug 1772006)
Backed out changeset b2542aef3054 (bug 1772006)
Backed out changeset 962bfea4a309 (bug 1772006)
2022-06-11 01:13:42 +03:00
Nika Layzell b3c13bf114 Bug 1772006 - Part 6: Simplify and move the string searching APIs from ns[T]StringObsolete, r=xpcom-reviewers,necko-reviewers,eeejay,dragana,barret
The biggest set of APIs from ns[T]StringObsolete which are still heavily used
are the string searching APIs. It appears the intention was for these to be
replaced by the `FindInReadable` APIs, however that doesn't appear to have
happened.

In addition, the APIs have some quirks around their handling of mixed character
widths. These APIs generally supported both narrow strings and the native
string type, probably because char16_t string literals weren't available until
c++11. Finally they also used easy-to-confuse unlabeled boolean and integer
optional arguments to control behaviour.

These patches do the following major changes to the searching APIs:

1. The ASCII case-insensitive search method was split out as
   LowerCaseFindASCII, rather than using a boolean. This should be less
   error-prone and more explicit, and allows the method to continue to use
   narrow string literals for all string types (as only ASCII is supported).
2. The other [R]Find methods were restricted to only support arguments with
   matching character types. I considered adding a FindASCII method which would
   use narrow string literals for both wide and narrow strings but it would've
   been the same amount of work as changing all of the literals to unicode
   literals.
   This ends up being the bulk of the changes in the patch.
3. All find methods were re-implemented using std::basic_string_view's find
   algorithm or stl algorithms to reduce code complexity, and avoid the need to
   carry around the logic from nsStringObsolete.cpp.
4. The implementations were moved to nsTStringRepr.cpp.
5. An overload of Find was added to try to catch callers which previously
   called `Find(..., false)` or `Find(..., true)` to set case-sensitivity, due
   to booleans normally implicitly coercing to `index_type`. This should
   probably be removed at some point, but may be useful during the transition.

Differential Revision: https://phabricator.services.mozilla.com/D148300
2022-06-10 21:12:08 +00:00
Emilio Cobos Álvarez adc65b1456 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 255763ef57 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
Emilio Cobos Álvarez e47024038c Bug 1762018 - Derive a color scheme when forcing preference colors. r=morgan
This patch is a bit bigger than I'd like, but it's mostly moving code
around to centralize the color/color-scheme decisions we make when
forcing colors.

In practice, the only behavior change should be that when "use system
colors" is false and we force colors, we force a color-scheme that
matches the user-chosen background (via the LookAndFeel::IsDarkColor
check).

That should make sure that text from system colors is light and matches
the user expectations.

Before this patch, we used to force the color-scheme to light, but that
was just so that we ended up looking at mLightColors. Instead, we
achieve that via a separate bit (mForcedLightColorSet, naming up for
debate, not a fan), so that we can use the right system colors
otherwise.

Another alternative I considered is making all non-link system colors
return mDefaultBackground / mDefault depending on whether they are
background / foreground colors. That seemed a lot more work and
potentially a regression in various ways. I think this should be
strictly an improvement instead.

Differential Revision: https://phabricator.services.mozilla.com/D142423
2022-04-01 01:21:22 +00:00
Cristian Tuns da85cd4a66 Backed out changeset 5d97c7b1b9b5 (bug 1762018) for causing mochitest failures in test_bug232227.html CLOSED TREE 2022-03-31 19:12:48 -04:00
Emilio Cobos Álvarez 0555de1ae2 Bug 1762018 - Derive a color scheme when forcing preference colors. r=morgan
This patch is a bit bigger than I'd like, but it's mostly moving code
around to centralize the color/color-scheme decisions we make when
forcing colors.

In practice, the only behavior change should be that when "use system
colors" is false and we force colors, we force a color-scheme that
matches the user-chosen background (via the LookAndFeel::IsDarkColor
check).

That should make sure that text from system colors is light and matches
the user expectations.

Before this patch, we used to force the color-scheme to light, but that
was just so that we ended up looking at mLightColors. Instead, we
achieve that via a separate bit (mForcedLightColorSet, naming up for
debate, not a fan), so that we can use the right system colors
otherwise.

Another alternative I considered is making all non-link system colors
return mDefaultBackground / mDefault depending on whether they are
background / foreground colors. That seemed a lot more work and
potentially a regression in various ways. I think this should be
strictly an improvement instead.

Differential Revision: https://phabricator.services.mozilla.com/D142423
2022-03-31 22:03:09 +00:00
Emilio Cobos Álvarez 340de6fd0f Bug 1756210 - Use pseudo-class locks in nsNativeTheme::GetContentState. r=mstange
Seems harmless, and more in line with what authors would expect when
toggling DevTools pseudo-classes.

Differential Revision: https://phabricator.services.mozilla.com/D140529
2022-03-09 11:45:10 +00:00
Butkovits Atila 9692831c13 Backed out changeset 5d94320c8ec2 (bug 1756210) for causing failures at test_focusrings.xhtml. CLOSED TREE 2022-03-08 23:29:15 +02:00
Emilio Cobos Álvarez 2b6f586ab8 Bug 1756210 - Use pseudo-class locks in nsNativeTheme::GetContentState. r=mstange
Seems harmless, and more in line with what authors would expect when
toggling DevTools pseudo-classes.

Differential Revision: https://phabricator.services.mozilla.com/D140529
2022-03-08 18:13:51 +00:00
Emilio Cobos Álvarez f25b45a97f Bug 1751644 - Don't shrink padding of non-native menulist items. r=stransky
Native ones also have a big-ish padding (set by the theme).

Differential Revision: https://phabricator.services.mozilla.com/D136813
2022-02-11 18:41:46 +00:00
Emilio Cobos Álvarez 288890e8bb Bug 1749645 - Remove unused native scrollbar drawing on gtk. r=stransky
We decided to keep it when initially making scrollbars non-native, but I think
it's time for it to go, since it's pretty much untested.

Nobody has complained about the non-native scrollbars in chrome documents, and
the GTK scrollbar implementation is not suitable for content because it doesn't
support scrollbar-width among other things.

Differential Revision: https://phabricator.services.mozilla.com/D135670
2022-01-12 17:06:12 +00:00
Emilio Cobos Álvarez 0d7b041298 Bug 1744195 - Centralize XUL state checks in nsNativeTheme::GetContentState. r=mstange
This makes sure that the non-native theme and the native theme agree on
what's e.g. disabled.

Differential Revision: https://phabricator.services.mozilla.com/D133195
2021-12-09 01:11:58 +00:00
Emilio Cobos Alvarez 62fe0b09dd Bug 1734367 - Teach windows to draw dark widgets using the non-native theme. r=mstange,desktop-theme-reviewers,dao
This should be more flexible / less footgunny, always ensuring there's enough
contrast. If the front-end wants to override the non-native appearance they can
still do it using appearance: none of course.

This reverts my other CSS fixes for Windows dark mode for buttons / textfields,
as those are supported by nnt.

Patch incoming for Linux in bug 1733968, as Linux has a similar issue when it
can't draw mismatched widgets with the system theme (and we can fix it now).

I intentionally didn't override GetWidget{Padding,Border}, as to avoid changing
sizing unnecessarily (the non-native-theme is flexible enough to support
basically whatever size you throw at it, so it doesn't matter).

Differential Revision: https://phabricator.services.mozilla.com/D127645
2021-10-07 06:55:36 +00:00
Emilio Cobos Álvarez 390ddc27d6 Bug 1733339 - Remove NS_AUTHOR_SPECIFIED_PADDING. r=mstange
There's only one meaningful usage of it, which is to disable native
appearance of the <input type=range> (the windows native theme is no
longer exposed to content).

<input type=range> is inconsistent with every other native widget, which
only disables native appearance if the author specifies backgrounds or
borders. So make it match literally all other widgets and simplify a bit
the code.

We had no tests for this special behavior, let me know if you think it's
worth adding one (but I don't feel very strongly about it).

Differential Revision: https://phabricator.services.mozilla.com/D127082
2021-10-01 11:48:17 +00:00
Cristian Tuns b56ca950cf Backed out changeset a19e4f8a75d7 (bug 1733339) for causing reftest failures. CLOSED TREE 2021-10-01 03:54:08 -04:00
Emilio Cobos Álvarez b53a78f446 Bug 1733339 - Remove NS_AUTHOR_SPECIFIED_PADDING. r=mstange
There's only one meaningful usage of it, which is to disable native
appearance of the <input type=range> (the windows native theme is no
longer exposed to content).

<input type=range> is inconsistent with every other native widget, which
only disables native appearance if the author specifies backgrounds or
borders. So make it match literally all other widgets and simplify a bit
the code.

We had no tests for this special behavior, let me know if you think it's
worth adding one (but I don't feel very strongly about it).

Differential Revision: https://phabricator.services.mozilla.com/D127082
2021-10-01 06:31:09 +00:00
Emilio Cobos Álvarez ae847ec44f Bug 1721606 - Improve dark-color check to actually account for luminance. r=mstange
See the discussion in https://groups.google.com/a/chromium.org/g/blink-dev/c/WwYkLjbGhoA/m/EftJoLN_AwAJ
for some background.

Differential Revision: https://phabricator.services.mozilla.com/D120471
2021-07-22 10:29:52 +00:00
Emilio Cobos Álvarez 4d41ec19c2 Bug 1710324 - Tweak dark background detection so that it works for XUL use cases. r=mstange
Two changes:

 * Make it work across document boundaries, so that it works on e.g., the
   bookmarks sidebar.

 * Don't bail out if there's no scrollable frame, as XUL <tree>s use raw
   <scrollbar> elements without any scrollframe (gnarly). In that case, just
   use the target frame, but make sure to skip over themed elements (like the
   scrollbars themselves) so that we can find the right background.

The logic to check the canvas frame background etcetera was simpler in
FindNonTransparentBackgroundFrame. The only caller other than the
scrollbar darkening code is nsTextFrame, which should find a non-canvas frame
before anyways, but it doesn't hurt there.

Differential Revision: https://phabricator.services.mozilla.com/D114697
2021-05-11 13:57:18 +00:00
Csoregi Natalia e000635504 Backed out 3 changesets (bug 1710324) for causing mass failures and crashes. CLOSED TREE
Backed out changeset 7328372519f1 (bug 1710324)
Backed out changeset aa852464d828 (bug 1710324)
Backed out changeset 238a4cfcdc86 (bug 1710324)
2021-05-11 03:27:51 +03:00
Emilio Cobos Álvarez d420cf322f Bug 1710324 - Tweak dark background detection so that it works for XUL use cases. r=mstange
Two changes:

 * Make it work across document boundaries, so that it works on e.g., the
   bookmarks sidebar.

 * Don't bail out if there's no scrollable frame, as XUL <tree>s use raw
   <scrollbar> elements without any scrollframe (gnarly). In that case, just
   use the target frame, but make sure to skip over themed elements (like the
   scrollbars themselves) so that we can find the right background.

The logic to check the canvas frame background etcetera was simpler in
FindNonTransparentBackgroundFrame. The only caller other than the
scrollbar darkening code is nsTextFrame, which should find a non-canvas frame
before anyways, but it doesn't hurt there.

Differential Revision: https://phabricator.services.mozilla.com/D114697
2021-05-10 23:33:33 +00:00
Emilio Cobos Álvarez 34a9a0f457 Bug 1705605 - Implement accent-color in nsNativeBasicTheme. r=mstange
This is a new addition for CSS UI Level 4:

  https://drafts.csswg.org/css-ui-4/#widget-accent

I want to provide feedback on some spec issues, and thought it was a
kinda neat thing to prototype (it also makes testing contrast and such
with random GTK themes easier).

For now enable for Nightly only.

Differential Revision: https://phabricator.services.mozilla.com/D112312
2021-04-27 10:41:00 +00:00
Emilio Cobos Álvarez e65533e909 Bug 1698821 - Simplify native-appearance-disabling for number spinners. r=dholbert
The root cause of this bug is that we're now accidentally using the
native theme for the spinners because GetNumberControlFrameForSpinButton
broke with my changes.

These pseudos are not exposed to content, and there's just one user of
this pseudo-class (the print.css one).

So just disable native appearance explicitly and remove that check.

Differential Revision: https://phabricator.services.mozilla.com/D108653
2021-03-16 21:53:20 +00:00
Emilio Cobos Álvarez 8aefb5feca Bug 1689327 - Resizers for non-themed scrollable content shouldn't be themed. r=NeilDeakin
Right now the resizer inside a random <div style="overflow: hidden"> is
the themed one, and that seems unintended.

I'm not sure how to best test this since resizers are sized to a
scrollbar width, so I can't just position an <img src=resizer.svg>.

I noticed this while looking at bug 1689253.

Differential Revision: https://phabricator.services.mozilla.com/D103304
2021-02-20 00:15:42 +00:00