Commit graph

59 commits

Author SHA1 Message Date
Michelle Goossens
d2a7ebf789 style: Remove browser.proton.modals.enabled pref
Differential Revision: https://phabricator.services.mozilla.com/D116903
2023-05-24 18:32:34 +02:00
Michelle Goossens
77cab0edc3 style: Remove browser.proton.doorhangers.enabled pref
Differential Revision: https://phabricator.services.mozilla.com/D117091
2023-05-24 18:32:32 +02:00
Emilio Cobos Álvarez
44b94f66f9 style: Use a nicer media query for proton context menus
Differential Revision: https://phabricator.services.mozilla.com/D116736
2023-05-24 18:32:31 +02:00
Oriol Brufau
90781493fc style: Make the -moz-toolbar-prefers-color-scheme a tri-state
This will allow detecting the system theme, which allows fixing some of
the blocked bugs.

Note that when using the system theme we will still match light or dark
appropriately, so this shouldn't change behavior just yet.

Differential Revision: https://phabricator.services.mozilla.com/D113516
2023-05-19 19:06:08 +02:00
Oriol Brufau
d12cb17d73 style: -moz-toolbar-prefers-color-scheme for dark theme detection
This adds a new @media query -moz-toolbar-prefers-color-scheme which works like
prefers-color-scheme but is set based on the browser theme rather than the OS
theme. The background colour of the toolbar is used to determine the theme
dark/light preference. This will be used for in-content common.css pages and
other UI elements that include that stylesheet in the browser-chrome through
shadow DOM.

The end result is that about: pages, infobars, and modals will now "match" the
browser theme (just light/dark mode, not LWT theming support).

Differential Revision: https://phabricator.services.mozilla.com/D111486
2023-05-19 19:06:07 +02:00
Oriol Brufau
693c2f0d27 style: Remove -moz-proton-infobars media query support
Differential Revision: https://phabricator.services.mozilla.com/D110963
2023-05-16 23:15:26 +02:00
Oriol Brufau
bbc03a2577 style: Enable Proton Urlbar
Differential Revision: https://phabricator.services.mozilla.com/D110998
2023-05-16 23:13:14 +02:00
Oriol Brufau
7bb15f19f1 style: Remove dead prefers-color-scheme: no preference code
It was removed in bug 1643656.

Differential Revision: https://phabricator.services.mozilla.com/D111461
2023-05-16 23:12:19 +02:00
Oriol Brufau
f44a6909df style: Reduce boilerplate needed to add system-metric media features
There's no reason we can't just query LookAndFeel and we need to use
sSystemMetrics. In the past, LookAndFeel queries were not cached, but
this is no longer the case, so perf wise should be pretty equivalent.

Note that we don't need the NS_SUCCEEDED checks because the default
value from GetInt if the platform doesn't support it is 0 anyways.

Differential Revision: https://phabricator.services.mozilla.com/D110805
2023-05-16 23:02:50 +02:00
Oriol Brufau
3d9eabcccb style: Convert proton pref checks from @supports rules to media features
This means that dynamic changes will be handled correctly, we can use
StaticPrefs, etc.

Differential Revision: https://phabricator.services.mozilla.com/D110816
2023-05-16 23:01:29 +02:00
Emilio Cobos Álvarez
31e8e418ea Miscellaneous build / tidy fixes. 2021-02-26 17:53:55 +01:00
Emilio Cobos Álvarez
80dae5bc59 Rustfmt. 2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
a5cb6c6927 style: Remove prefers-contrast: forced as per CSSWG resolution.
Differential Revision: https://phabricator.services.mozilla.com/D106485
2021-02-26 16:44:05 +01:00
Boris Chiou
52d39fc1bc style: Move Ratio into independent files.
Based on https://drafts.csswg.org/css-values/#ratios, <ratio> should be
a general types in css values, and now the media query and the position use
this type, so let's move it into the independent files.

Differential Revision: https://phabricator.services.mozilla.com/D106218
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
f4a8acc558 style: Add a non-native-theme media query.
Differential Revision: https://phabricator.services.mozilla.com/D102457
2021-02-26 16:44:05 +01:00
Markus Stange
1e815ab3c3 style: Replace obsolete -moz-mac-yosemite-theme media query with a new -moz-mac-big-sur-theme media query.
Differential Revision: https://phabricator.services.mozilla.com/D97089
2021-02-26 16:44:05 +01:00
Boris Chiou
61685ca9b3 style: Serialize a 0/0 ratio as 0/0 in all value stages.
Based on the update of github.com/w3c/csswg-drafts/issues/5084,
a 0/0 ratio will serialize as 0/0 in all value stages.

Differential Revision: https://phabricator.services.mozilla.com/D93182
2021-02-26 16:44:05 +01:00
tobar2018
4a625be8ad style: Remove all references to the preference 'layout.css.moz-touch-enabled.enabled'.
Differential Revision: https://phabricator.services.mozilla.com/D91401
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
35716fd514 style: Only apply grayscale filter for printing on print preview.
Differential Revision: https://phabricator.services.mozilla.com/D88065
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
c200b67395 style: Make media queries and viewport units in print be evaluated against the default page size minus margins.
For that, move the default page margin computation to nsPresContext.

See https://github.com/w3c/csswg-drafts/issues/5437 as to why doing this
and other alternatives.

Differential Revision: https://phabricator.services.mozilla.com/D87311
2021-02-26 16:44:05 +01:00
Zeke Medley
9fd3d9a5e9 style: Support forced colors media feature.
Enabled behind layout.css.forced-colors.enabled pending finalization
of the spec:

<https://drafts.csswg.org/mediaqueries-5/#forced-colors>

Differential Revision: https://phabricator.services.mozilla.com/D87147
2021-02-26 16:44:05 +01:00
Zeke Medley
25de2a406e style: Update the prefers-contrast media query to use the new more/less keywords.
Per the resolution here:
https://github.com/w3c/csswg-drafts/issues/2943#issuecomment-672994920

Differential Revision: https://phabricator.services.mozilla.com/D86848
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
9d3876bda0 style: Apply a grayscale filter to pages when monochrome.
This hooks the "monochrome" media query and co to the
nsIPrintSettings.printInColor setting.

This print setting we're using is not exposed in the print preview UI,
but you can test it setting the print.print_in_color preference to
"false", and then print preview will correctly show up greyscale'd.

Once this lands, the UI folks just have to use it as they see fit :)

I would've liked to add a proper rendering test, but the print reftests
check only whether the PDF text matches.

I could add a test to printpreview_helper.xhtml, but I'm refactoring
that file in bug 1648064 so I'd rather wait a bit and add it in a
separate bug. The test for the media feature should make sure that we
test that code path at least.

Differential Revision: https://phabricator.services.mozilla.com/D83552
2021-02-26 16:44:05 +01:00
Zeke Medley
8ff565c86b style: Implement the prefers-contrast media-query.
Differential Revision: https://phabricator.services.mozilla.com/D79553
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
1f797ca24d
style: Remove prefers-color-scheme: no-preference.
It was removed from the spec.

Differential Revision: https://phabricator.services.mozilla.com/D78834
2020-06-18 23:51:16 +02:00
Emilio Cobos Álvarez
762abbaf9f
style: Rustfmt recent changes. 2020-06-04 02:02:50 +02:00
Emilio Cobos Álvarez
69c7077b3d style: Don't use lazy_static for media feature parsing.
This used to be needed when destructors in statics were not allowed, but
we can get rid of it nowadays.

Differential Revision: https://phabricator.services.mozilla.com/D78109
2020-06-04 01:50:36 +02:00
Boris Chiou
7022f451e1 style: Replace AspectRatio with computed::position::Ratio in media-queries.
Also, we drop the pref, layout.css.aspect-ratio-number.enabled, becacuse
the spec of css-sizing-4 uses Number now.

Differential Revision: https://phabricator.services.mozilla.com/D75233
2020-06-04 01:50:36 +02:00
Emilio Cobos Álvarez
b98ac61a70 style: Hide -moz-touch-enabled media query in Nightly and Early Beta.
This is effectively superseded by the hover / any-hover media queries, which
actually are standard, and is also causing trouble in the wild.

Not even the browser fronted uses it, so we should be able to just remove it
everywhere at once.

Differential Revision: https://phabricator.services.mozilla.com/D49506
2019-11-04 13:36:32 +01:00
Joel Olsson
1406ae7f39 style: Media Query - Enable single <number> and <number>/<number> for <aspect-ratio>.
Differential Revision: https://phabricator.services.mozilla.com/D41557
2019-09-12 22:34:16 +02:00
Nicolas Silva
239f2da9d9
style: Update to euclid 0.20.
Differential Revision: https://phabricator.services.mozilla.com/D38530
2019-07-23 22:54:08 +02:00
Emilio Cobos Álvarez
c106fb1231 style: Remove comment that is outdated since I fixed it in bug 1483808. 2019-04-12 12:19:56 +02:00
Emilio Cobos Álvarez
39df092bce style: fix some rust-nightly warnings about unused doc comments.
Differential Revision: https://phabricator.services.mozilla.com/D24287
2019-03-27 14:29:16 +01:00
Emilio Cobos Álvarez
e723a5b7d6 style: Make the pres context optional in the style system.
Differential Revision: https://phabricator.services.mozilla.com/D21239
2019-03-13 15:08:32 +01:00
Emilio Cobos Álvarez
dcfe30ff18 style: Remove a couple trivial dependencies on nsPresContext.
Differential Revision: https://phabricator.services.mozilla.com/D20141
2019-02-23 21:04:19 -08:00
Jonathan Kingston
d6750de0c3 style: Add support for CSS prefers-color-scheme media feature.
Bug: 1494034
Reviewed-by: emilio
2019-02-23 21:03:07 -08:00
Martin Stransky
e27c15e2f9 Honour system titlebar button left/right placement.
Differential Revision: https://phabricator.services.mozilla.com/D16466
2019-01-20 14:32:58 +01:00
Martin Stransky
424eb94c7f Enable hidden system titlebar by default on Gnome.
This patch implements -moz-gtk-csd-hide-titlebar-by-default media query
to check if the system titlebar should be disabled by default on Linux systems
(it's already disabled on Window/Mac).

It also removes explicit definition of browser.tabs.drawInTitlebar preference on Linux.
When browser.tabs.drawInTitlebar is missing the -moz-gtk-csd-hide-titlebar-by-default
is used to obtain the titlebar state. When browser.tabs.drawInTitlebar is set
in about:config or by Customize menu, the user peference is used instead of the default.

It also fixes a -moz-gtk-csd-available media query,
it was always true regardless the actual system setting.

Differential Revision: https://phabricator.services.mozilla.com/D16036
2019-01-20 14:32:01 +01:00
Emilio Cobos Álvarez
5f173c463e style: Rustfmt recent changes. 2019-01-07 00:32:54 +01:00
quasicomputational
274845fc14 style: Implement the 'overflow-inline' media query.
Bug: 1422235
Reviewed-by: emilio
2019-01-07 00:32:51 +01:00
quasicomputational
81a07b4351 style: Implement the 'overflow-block' media query.
Bug: 1422235
Reviewed-by: emilio
2019-01-07 00:32:51 +01:00
Simon Sapin
be69f9c3e6 Rustfmt has changed its default style :/ 2018-12-28 13:17:47 +01:00
Jan Andre Ikenmeyer
1d6fe65401
Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
Simon Sapin
b1822a39fa cargo fix --edition --features gecko 2018-11-10 17:47:28 +01:00
Pyfisch
9e92eb205a Reorder imports 2018-11-06 22:35:07 +01:00
Pyfisch
cb07debcb6 Format remaining files 2018-11-06 22:30:31 +01:00
Boris Chiou
cb2533d61a
style: Use alias for StyleDisplay and StyleDisplayMode.
Map these two types to their original rust type in rust-bindgen.

Differential Revision: https://phabricator.services.mozilla.com/D10141
2018-11-05 12:30:38 +01:00
Martin Stransky
6a1078c551
style: [CSD] Enable round corners by default by -moz-gtk-csd-transparent-background media query.
Replace mozilla.widget.use-argb-visuals pref by
-moz-gtk-csd-transparent-background media query at browser.css to draw
transparent background. The media query is set by toolkit code and enabled when
compatible window manager is detected.

Differential Revision: https://phabricator.services.mozilla.com/D6658
2018-10-09 19:43:50 +02:00
Emilio Cobos Álvarez
da5283d066
style: Fix Gecko build. 2018-09-15 19:19:18 +02:00
Hiroyuki Ikezoe
3d909132ba
style: Implement any-hover and any-pointer media queries features.
Differential Revision: https://phabricator.services.mozilla.com/D3609
2018-09-15 17:57:29 +02:00