servo/components/style/gecko
Emilio Cobos Álvarez f70b0e7108 style: Make Canvas/CanvasText and Link colors color-scheme-aware
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
2023-05-31 00:50:34 +02:00
..
arc_types.rs style: Part 3: Add CSSScrollTimelineRule for CSSOM 2023-05-30 23:26:02 +02:00
boxed_types.rs Implement Animation.commitStyles. 2019-05-29 16:14:16 +02:00
conversions.rs style: Reformat recent changes. 2020-04-16 17:50:17 +02:00
data.rs style: Don't EnsureUniqueInner from the cssRules getter 2023-05-24 18:32:38 +02:00
media_features.rs style: Make browser.tabs.drawInTitlebar a tri-state 2023-05-31 00:50:33 +02:00
media_queries.rs style: Make Canvas/CanvasText and Link colors color-scheme-aware 2023-05-31 00:50:34 +02:00
mod.rs style: Remove the old profiler label frames code in the servo codebase and replace it with the new API 2023-05-24 18:32:40 +02:00
non_ts_pseudo_class_list.rs style: Implement :user-valid and :user-invalid. 2021-02-26 16:44:05 +01:00
pseudo_element.rs style: Remove layout.css.file-selector-button.enabled pref. 2021-02-26 16:44:05 +01:00
pseudo_element_definition.mako.rs style: Remove layout.css.unknown-webkit-pseudo-element. 2021-02-26 16:44:05 +01:00
regen_atoms.py Standardize on Black for Python code in mozilla-central. 2021-02-26 16:44:05 +01:00
restyle_damage.rs style: Speed up custom property diffing. 2021-02-26 16:44:05 +01:00
selector_parser.rs style: Add attributes to the rule hash 2023-05-26 21:49:57 +02:00
snapshot.rs style: Avoid some allocations in selector serialization. 2021-02-26 16:44:05 +01:00
snapshot_helpers.rs Rustfmt. 2021-02-26 16:44:05 +01:00
traversal.rs Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
url.rs Rustfmt. 2021-02-26 16:44:05 +01:00
values.rs style: Use cbindgen for content property. 2020-02-12 02:43:08 +01:00
wrapper.rs style: Don't use nsContentUtils::sNamespaceManager in servo 2023-05-31 00:50:32 +02:00