Commit Graph

13911 Commits

Author SHA1 Message Date
Alexandru Michis
ef8f129df5 Backed out changeset 82c80c6c8090 (Bug 1739464) for causing mochitest plain failures in test_bug496275.html
CLOSED TREE
2021-11-12 03:45:59 +02:00
Emilio Cobos Álvarez
3b4c3ed152 Bug 1739464 - Use first generic rather than only generic to determine fallback font family. r=jfkthame
This seems like more sensible behavior. We have another use of
only_generic(), but that affects font sizing and other browsers agree
with us there:

  <div style="font-family: monospace">Should be 13px</div>
  <div style="font-family: something, monospace">Should be 16px</div>

So not touching that one.

Differential Revision: https://phabricator.services.mozilla.com/D130732
2021-11-11 17:48:55 +00:00
Emilio Cobos Álvarez
4d6ee249dc Bug 1739925 - Add a foreground color to attention selection. r=jfkthame
In some platforms (like macOS, windows dark mode, android, and some gtk
themes) the foreground selection color might be `currentcolor`, and that
doesn't generally guarantee enough contrast with the attention
background.

Remove HeadlessLookAndFeelGTK's handling of this color since it's
useless (always overridden by prefs in all.js)

Differential Revision: https://phabricator.services.mozilla.com/D130617
2021-11-11 11:14:13 +00:00
Marian-Vasile Laza
6d3bafd66a Backed out changeset 2ed757d5dd76 (bug 1739464) for causing reftest failures on brackets-3b-rtl.html. CLOSED TREE 2021-11-10 22:54:06 +02:00
Emilio Cobos Álvarez
4dabed3c51 Bug 1739464 - Use first generic rather than only generic to determine fallback font family. r=jfkthame
This seems like more sensible behavior. We have another use of
only_generic(), but that affects font sizing and other browsers agree
with us there:

  <div style="font-family: monospace">Should be 13px</div>
  <div style="font-family: something, monospace">Should be 16px</div>

So not touching that one.

Differential Revision: https://phabricator.services.mozilla.com/D130732
2021-11-10 17:58:18 +00:00
Emilio Cobos Álvarez
a5f66c95e1 Bug 1740230 - Remove some prefs for pseudo-classes that we have shipped/unshipped successfully. r=dholbert
And remove code for :-moz-submit-invalid completely.

Differential Revision: https://phabricator.services.mozilla.com/D130737
2021-11-10 13:27:47 +00:00
Emilio Cobos Álvarez
f2318b3299 Bug 1740230 - Unexpose :-moz-locale-dir and :-moz-lwtheme* from content. r=dholbert
Behind a pref for now. Given these selectors do nothing on non-chrome
documents (they just don't match) it seems worth trying.

A cursory search seems to indicate they're not used for UA detection or
something like that (or at least I haven't found such an usage).

Differential Revision: https://phabricator.services.mozilla.com/D130736
2021-11-10 13:00:17 +00:00
Emilio Cobos Álvarez
bd406d8841 Bug 1740230 - Allow matches() / querySelector() / etc on chrome docs to access chrome-only selectors. r=boris
Without this some tests fail with the previous patch because code like:

  https://searchfox.org/mozilla-central/rev/267682a8f45221bf0bfe999d4a0239706a43bc56/browser/base/content/browser-gestureSupport.js#651

starts throwing. Unfortunately I had missed that on my try run, because
the error message didn't include that exception (it seemed like an
intermittent browser-chrome failure instead).

We could expose a ChromeOnly API for this, but this seems better. This
fixes it trivially, and also removes the "no url data" situation from
the selector parser, which is nice.

Differential Revision: https://phabricator.services.mozilla.com/D130818
2021-11-10 12:56:35 +00:00
Butkovits Atila
3a33d047e8 Backed out 2 changesets (bug 1740230) for causing build bustages.
Backed out changeset ba8e644ee9d2 (bug 1740230)
Backed out changeset 180d03015fd1 (bug 1740230)
2021-11-10 02:12:26 +02:00
Emilio Cobos Álvarez
620bd78775 Bug 1740230 - Allow matches() / querySelector() / etc on Chrome docs to access chrome-only selectors. r=boris
Without this some tests fail with the previous patch because code like:

  https://searchfox.org/mozilla-central/rev/267682a8f45221bf0bfe999d4a0239706a43bc56/browser/base/content/browser-gestureSupport.js#651

starts throwing. Unfortunately I had missed that on my try run, because
the error message didn't include that exception (it seemed like an
intermittent browser-chrome failure instead).

We could expose a ChromeOnly API for this, but this seems better. This
fixes it trivially, and also removes the "no url data" situation from
the selector parser, which is nice.

Differential Revision: https://phabricator.services.mozilla.com/D130818
2021-11-09 23:28:48 +00:00
Emilio Cobos Álvarez
c11619252a Bug 1740230 - Unexpose :-moz-locale-dir and :-moz-lwtheme* from content. r=dholbert
Behind a pref for now. Given these selectors do nothing on non-chrome
documents (they just don't match) it seems worth trying.

A cursory search seems to indicate they're not used for UA detection or
something like that (or at least I haven't found such an usage).

Differential Revision: https://phabricator.services.mozilla.com/D130736
2021-11-09 22:51:05 +00:00
Emilio Cobos Álvarez
a3a1b27924 Bug 1740230 - Refactor :-moz-lwtheme pseudo-classes to get invalidated correctly. r=dholbert
Use the same document state mechanism we have for :moz-locale-dir. Also,
simplify the setup of the later to be the same as :dir(), allowing the
matching code to be less repetitive.

This should fix some flakiness in chrome mochitests, but we have no existing
tests for these pseudo-classes more generally and since they're just
chrome-only I'm not super-excited about adding more.

Differential Revision: https://phabricator.services.mozilla.com/D130735
2021-11-09 20:59:11 +00:00
Emilio Cobos Álvarez
9b27f32101 Bug 1740230 - Simplify :dir() implementation. r=dholbert
This I noticed while working on the following patches. Shouldn't have
any behavior change: the behavior does in fact match the element state
flag semantics correctly if we do this. We did split the dir flags into
two element bits a while ago.

:not(:dir()) still behaves correctly of course, and we have tests for that.

Differential Revision: https://phabricator.services.mozilla.com/D130734
2021-11-09 20:53:13 +00:00
Butkovits Atila
4af43f1399 Backed out changeset da181def7b07 (bug 1739464) for causing failures at test_dont_use_document_fonts.html. 2021-11-09 21:10:28 +02:00
Emilio Cobos Álvarez
4c24a1ca7d Bug 1739464 - Use first generic rather than only generic to determine fallback font family. r=jfkthame
This seems like more sensible behavior. We have another use of
only_generic(), but that affects font sizing and other browsers agree
with us there:

  <div style="font-family: monospace">Should be 13px</div>
  <div style="font-family: something, monospace">Should be 16px</div>

So not touching that one.

Differential Revision: https://phabricator.services.mozilla.com/D130732
2021-11-09 17:22:07 +00:00
Emilio Cobos Álvarez
890026f19b Bug 1739357 - Merge branches in some ComputedValues functions. r=boris
This should mitigate the code size impact. Also make get_resolved_value
non-generic to avoid monomorphizing it multiple times.

Differential Revision: https://phabricator.services.mozilla.com/D130354
2021-11-06 10:14:40 +00:00
Mats Palmgren
039e1146f4 Bug 1738520 - Make #[css(field_bound)] and #[css(iterable)] work properly. r=mats
For now, use IntoIterator to figure the right type to add the bound.

If we need this on types that are iterable but don't provide
IntoIterator, we can add another attribute field or something.

Differential Revision: https://phabricator.services.mozilla.com/D129962
2021-11-04 18:31:55 +00:00
Emilio Cobos Álvarez
c308704902 Bug 1738614 - Remove other Widget* colors. r=mstange
These are only used for frameset painting and the non-e10s <select>
dropdown focus codepath. We have other more appropriate standard
colors for this.

Differential Revision: https://phabricator.services.mozilla.com/D129992
2021-11-02 18:08:07 +00:00
Emilio Cobos Álvarez
923cf5df84 Bug 1738614 - Remove TextForeground/Background system colors. r=mstange
Same thing, there's nor reason these should be different from other
CSS-exposed colors.

Differential Revision: https://phabricator.services.mozilla.com/D129991
2021-11-02 18:08:07 +00:00
Emilio Cobos Álvarez
ac14d7e42d Bug 1738614 - Remove WindowBackground/Foreground system colors. r=mstange
There's no reason for these to be different to the CSS-exposed
Window/WindowText.

Differential Revision: https://phabricator.services.mozilla.com/D129990
2021-11-02 18:08:07 +00:00
Emilio Cobos Álvarez
7c1b2c19fd Bug 1738658 - Serialize text-decoration using Servo. r=layout-reviewers,mats
The code introduced in the preceding patch deals with currentColor correctly,
so we should be able to do this now.

This uncovers a bug in the existing serialization code when a non-auto
text-decoration-thickness was used, caught by
css/css-text-decor/parsing/text-decoration-computed.html.

Differential Revision: https://phabricator.services.mozilla.com/D130018
2021-11-02 14:21:38 +00:00
Emilio Cobos Álvarez
ac72dbe343 Bug 1738658 - Generalize resolved style code to deal with all shorthands. r=jwatt
This removes the various assumptions that the animation code does.

Code size might be a concern, we can optimize if it is a problem,
but let's do the obvious thing for now.

Differential Revision: https://phabricator.services.mozilla.com/D130017
2021-11-02 14:21:38 +00:00
Emilio Cobos Álvarez
e7fd7303e1 Bug 1738791 - Treat empty root margin as zero as per spec. r=AlaskanEmily
Differential Revision: https://phabricator.services.mozilla.com/D130131
2021-11-02 10:44:17 +00:00
Noemi Erli
d6a163adba Backed out changeset f8c0561be4db (bug 1738791) for causing failures in observer-attributes.html CLOSED TREE 2021-11-02 04:30:37 +02:00
Emilio Cobos Álvarez
7dc130a7a8 Bug 1738791 - Treat empty root margin as zero as per spec. r=AlaskanEmily
Differential Revision: https://phabricator.services.mozilla.com/D130131
2021-11-01 22:46:02 +00:00
Emilio Cobos Álvarez
69eeb9cb6c Bug 1738608 - Make autofill background configurable via system color prefs. r=mstange
And remove the autofill.background pref for 95 (or 96, depending on
when this lands) assuming nothing terrible causes us to turn it off on
94.

Differential Revision: https://phabricator.services.mozilla.com/D129988
2021-10-31 21:28:58 +00:00
Emilio Cobos Álvarez
1421e7f545 Bug 1525107 - Make Canvas/CanvasText and Link colors color-scheme-aware. r=dholbert
For that, add `.dark` version of the browser.display* prefs that control
the light version of these colors.

The default for background/foreground colors are taken from the
GenericDarkColors used in LookAndFeel.

The defaults for links are based on this discussion:

  https://github.com/whatwg/html/issues/5426#issuecomment-904021675

(So they effectively match Chrome).

Whether the dark colors should be exposed in about:preferences (like the
light colors are) is TBD.

With this patch, we pass all the tests in:

  /html/semantics/document-metadata/the-meta-element/color-scheme/

Use the colors to paint the default canvas background and the default
colors.

There are three "regressions", though they are really progressions: we
now render the reference as the test expects (before we rendered a light
canvas background even for the reference).

Apart of these iframe tests (which we should look into, I filed
https://bugzilla.mozilla.org/show_bug.cgi?id=1738380), there are three
remaining test failures.

Two of them are due to `color: initial` not changing based on the
color-scheme. Safari also fails these tests, and the thing they're
really testing is whether system colors are preserved at computed-value
time:

  https://github.com/w3c/csswg-drafts/issues/3847

Regarding that change, I'm not so sure the trade-offs there are worth
it, as that not only complicates interpolation (we wouldn't be able to
use system colors in color-mix among others, see
https://github.com/w3c/csswg-drafts/issues/5780) plus it changes
inheritance behavior in sorta unexpected ways, see:

  https://github.com/w3c/csswg-drafts/issues/6773

Which I just filed because apparently no browser implements this
correctly. So for now will punt on those (keep matching Safari).

There's an svg-as-image test:

  https://searchfox.org/mozilla-central/rev/f8576fec48d866c5f988baaf1fa8d2f8cce2a82f/testing/web-platform/tests/css/css-color-adjust/rendering/dark-color-scheme/svg-as-image.html

Which isn't using the feature at all and I'm not sure why is it supposed
to pass (why prefers-color-scheme: dark is supposed to match that SVG
image). This test fails in all browsers apparently:

  https://wpt.fyi/results/css/css-color-adjust/rendering/dark-color-scheme/svg-as-image.html?label=master&label=experimental&aligned

I sent https://github.com/web-platform-tests/wpt/pull/31407 to remove
it and hopefully get it reviewed by some Chromium folks.

Differential Revision: https://phabricator.services.mozilla.com/D129746
2021-10-29 19:58:25 +00:00
Emilio Cobos Álvarez
933c5ad884 Bug 1525107 - Move Canvas/Link color computation to C++-land. r=dholbert
This doesn't change behavior but will allow us to deduplicate some
logic given we compute the effective color-scheme in C++.

Differential Revision: https://phabricator.services.mozilla.com/D129744
2021-10-29 19:58:24 +00:00
Emilio Cobos Álvarez
f85c48f96d Bug 1525107 - Implement <meta name=color-scheme>. r=dholbert
There are still tests failing because
https://bugzilla.mozilla.org/show_bug.cgi?id=1736034 hasn't been synced
yet.

Once that lands, they will still fail because we don't change
Canvas/CanvasText based on color-scheme, but that I'm attaching
patches for after this one.

Differential Revision: https://phabricator.services.mozilla.com/D129743
2021-10-29 19:58:24 +00:00
Mats Palmgren
1169c0cdc1 Bug 1738296 - Fix broken 'list-style' serialization. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D129847
2021-10-28 17:06:53 +00:00
Emilio Cobos Álvarez
5b31eea4fd Bug 1737676 - Use GTK menu radius on native context menus and panels. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D129439
2021-10-28 10:52:31 +00:00
Emilio Cobos Álvarez
f488c2d7b8 Bug 1737654 - Allow parsing layer statements inside nested rules. r=boris
This fixes https://wpt.live/css/css-cascade/layer-media-query.html once
it syncs.

Differential Revision: https://phabricator.services.mozilla.com/D129424
2021-10-26 23:03:19 +00:00
Emilio Cobos Álvarez
8b39ce0241 Bug 1734570 - Update layer ordering to follow the spec. r=boris
The bitfield approach worked when the layer order was in pre-order, but
the spec was changed to make it work like post-order and I don't think
there's a way to keep it working like that, so keep the layer order in a
separate data structure that we look up when going from Rule to
ApplicableDeclarationBlock.

This is just a vector index operation so hopefully shouldn't be too bad.

This patch intentionally regresses @keyframe handling to some extent,
since we need a bit more complicated approach and it seemed worth
implementing in a separate patch.

Depends on D129380

Differential Revision: https://phabricator.services.mozilla.com/D129381
2021-10-26 23:00:29 +00:00
Emilio Cobos Álvarez
aacd5cb566 Bug 1734570 - Store a LayerOrder in ApplicableDeclarationBlock. r=boris
This shouldn't change behavior jut yet.

Differential Revision: https://phabricator.services.mozilla.com/D129380
2021-10-26 23:00:29 +00:00
Emilio Cobos Álvarez
f317384568 Bug 1736518 - Make browser.tabs.drawInTitlebar a tri-state. r=stransky,Gijs
To more properly support Linux having a different default at runtime.

Expose the resolved value in appinfo for convenience, and use it in the
front-end as needed.

Differential Revision: https://phabricator.services.mozilla.com/D129004
2021-10-21 09:07:12 +00:00
stransky
aecdcaacb9 Bug 1736795 [Linux] Export titlebar radius as int from LookAndFeel, r=emilio
Titlebar radius is exported as integer from Gtk so there's no need to use floats here.

Differential Revision: https://phabricator.services.mozilla.com/D128993
2021-10-20 18:01:02 +00:00
Emilio Cobos Álvarez
9ec6b27649 Bug 1736848 - Don't use nsContentUtils::sNamespaceManager in servo. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D129030
2021-10-20 15:25:10 +00:00
Mike Hommey
4aa571147f Bug 1736477 - Remove unused import_rule::PendingSheet. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D128823
2021-10-19 23:31:04 +00:00
Emilio Cobos Álvarez
db97a652b6 Bug 1509931 - Fix rebase mistake.
MANUAL PUSH: Bustage fix CLOSED TREE
2021-10-18 21:16:07 +02:00
Emilio Cobos Álvarez
2cdb78d6a6 Bug 1509931 - Remove -moz-gtk-csd-transparent-background. r=stransky,desktop-theme-reviewers,dao
We always use alpha visual for WebRender, and appearance: none is
unnecessary (root element has no intrinsic appearance).

Differential Revision: https://phabricator.services.mozilla.com/D128682
2021-10-18 18:51:41 +00:00
Emilio Cobos Álvarez
b742f680db Bug 1509931 - Expose titlebar radius as a chrome-only CSS environment variable. r=stransky
Mostly plumbing.

Differential Revision: https://phabricator.services.mozilla.com/D128680
2021-10-18 16:22:13 +00:00
Emilio Cobos Álvarez
c676353b72 Bug 1509931 - Add support for chrome-only environment variables. r=stransky
This bit is taken straight from D73454 (I reviewed it but I guess
another pair of eyes is ok, it's really straight-forward).

Co-authored-by: Nicklas Boman <smurfd@gmail.com>

Differential Revision: https://phabricator.services.mozilla.com/D128679
2021-10-18 16:22:13 +00:00
Mats Palmgren
cce3f3a286 Bug 1736129 - Make #[css(represents_keyword)] convert underscore in the field name to dash. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D128668
2021-10-16 20:09:24 +00:00
Emilio Cobos Álvarez
c4b7109fac Bug 1736038 - Remove -moz-toolbar-prefers-color-scheme. r=dao
By making prefers-color-scheme return the ColorSchemeForChrome(), which
accounts for the Firefox theme.

Differential Revision: https://phabricator.services.mozilla.com/D128611
2021-10-15 16:53:08 +00:00
Emilio Cobos Álvarez
37660aa996 Bug 1730503 - Make anonymous scrollbar caching work on mac by default, and unify scrollbars.css across platforms. r=mstange,desktop-theme-reviewers,dao
We make it work on macOS by setting pointer-events: none + opacity: 0 rather
than visibility: hidden, and tweaking the caching setup to be Android-like.

Now that the scrollbars sheet is the same across platforms, move it to where
the rest of the UA sheets are. This way we guarantee that the RDM vs. Android
difference is less (just the ifdef at the top of the sheet).

Depends on D128084

Differential Revision: https://phabricator.services.mozilla.com/D128085
2021-10-12 09:21:18 +00:00
Emilio Cobos Álvarez
ca970e3818 Bug 1735083 - Clean up GTK titlebar colors. r=desktop-theme-reviewers,dao
Apparently ActiveCaption/CaptionText/InactiveCaption/InactiveCaptionText
are supposed to be used for titlebars, so implement them properly and
remove the GTK-specific colors.

Differential Revision: https://phabricator.services.mozilla.com/D128028
2021-10-11 22:16:58 +00:00
Boris Chiou
33ba1b4ed4 Bug 1734472 - Tweak the serialization of rotate property. r=emilio
The serialization of rotate should be updated to match the current spec.

1. If a rotation about the z axis (that is, in 2D) is specified, the property
   must serialize as just an <angle>.

2. If any other rotation is specified, the property must serialize with an axis
   specified. If the axis is parallel with the x or y axes, it must serialize
   as the appropriate keyword.

Also, we need to handle the zero length vector separately because it is
parallel to every other vector but different from x axis, y axis, or z axis.

Differential Revision: https://phabricator.services.mozilla.com/D127747
2021-10-07 20:05:10 +00:00
Emilio Cobos Álvarez
9fbc18ca4c Bug 1733384 - Make inert not modify the computed style. r=sefeng,layout-reviewers,jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D127422
2021-10-07 17:00:36 +00:00
Butkovits Atila
4d927c1fb4 Backed out 4 changesets (bug 1733384) for causing failures at browser_windowPrompt.js. CLOSED TREE
Backed out changeset fa609fadac26 (bug 1733384)
Backed out changeset dd1936d9fe17 (bug 1733384)
Backed out changeset 1a073e40ab1a (bug 1733384)
Backed out changeset 65708a4c708f (bug 1733384)
2021-10-07 17:52:51 +03:00
Emilio Cobos Álvarez
445c7b4297 Bug 1734455 - Remove support for -moz-system-color() as chrome code no longer uses it (in favor of color-scheme). r=xidorn
Differential Revision: https://phabricator.services.mozilla.com/D127802
2021-10-07 11:56:17 +00:00