Commit graph

1717 commits

Author SHA1 Message Date
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
35b080e021 style: Implement :user-valid and :user-invalid.
And alias :-moz-ui-valid and :-moz-ui-invalid to them.

There are CSSWG resolutions for these for quite a while, and spec for
user-invalid.

Differential Revision: https://phabricator.services.mozilla.com/D105966
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
b90f5f099f style: Hide :-moz-submit-invalid behind a pref.
No other browser supports anything like this and we don't even have
internal users. Only uses of this I've found on the wild were just
resetting the box shadow internal styling we added in bug 582277 (and
since removed in bug 600151).

Differential Revision: https://phabricator.services.mozilla.com/D105955
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
e084d8e9d2 style: Remove focus-visible feature flag.
This shipped in 85, we can remove the feature flag now. Keep
:-moz-focusring as an alias to :focus-visible at parse time.

Differential Revision: https://phabricator.services.mozilla.com/D103752
2021-02-26 16:44:05 +01:00
Mats Palmgren
1927a676fd Bug 1687239 part 3 - Remove the PluginProblem UA Widget and related CSS pseudos.
Differential Revision: https://phabricator.services.mozilla.com/D102901
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
Emilio Cobos Álvarez
f16305d25a style: Remove layout.css.unknown-webkit-pseudo-element.
Enabled since bug 1486325 (Firefox 64).

Depends on D101290

Differential Revision: https://phabricator.services.mozilla.com/D101291
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
70edd2318c style: Remove layout.css.file-selector-button.enabled pref.
On by default since bug 1662478 (Firefox 82)

Depends on D101289

Differential Revision: https://phabricator.services.mozilla.com/D101290
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
ad8ac70ae8 style: Remove the moz-focus-outer code.
This pseudo does nothing and we successfully removed it in bug 1655859
(firefox 81).

Differential Revision: https://phabricator.services.mozilla.com/D101289
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
4f28a8cd31 style: Implement parsing and serialization for most of image-set().
This implements the basic image-set notation without the format()
function (for simplicity).

There's a remaining serialization issue (we should probably skip 1x
resolutions), but that's fine for now, I'll address this in a follow-up
when the feature is testable.

The intention is to do the image selection at computed value time
(keeping a selected index or such), but same, follow-up.

This also fixes an issue where the cors-mode for -moz-image-rect and
cross-fade() was getting ignored when parsing.

Differential Revision: https://phabricator.services.mozilla.com/D100640
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
a4506d94ec style: Remove some dead plugins code.
Differential Revision: https://phabricator.services.mozilla.com/D100472
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
892b0ffb5d style: Use an AutoTArray for atom arrays in attributes (class / part).
These are never empty, and storing 4 elements inline seems worth it
given we also heap-allocate the array itself.

Depends on D100592

Differential Revision: https://phabricator.services.mozilla.com/D100593
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
610ebe2e25 style: Reorder some conditions when handling class/part attributes.
Empty class attributes are uncommon.

Differential Revision: https://phabricator.services.mozilla.com/D100592
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
a3f84f85e3 style: Remove layout.css.moz-any-is-is.enabled.
We shipped this, let's remove the MozAny code.

Differential Revision: https://phabricator.services.mozilla.com/D99607
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
72a0dbacc7 style: Expose :autofill behind a pref to content, and add :-webkit-autofill as a compat alias.
Nightly only until we get resolutions on the relevant spec issues.

Differential Revision: https://phabricator.services.mozilla.com/D99296
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
019e6a3e2a style: Rename -moz-autofill to just autofill.
No compat impact, as this remains an internal pseudo-class for the time
being.

Differential Revision: https://phabricator.services.mozilla.com/D99295
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
45af831c82 style: Remove layout.css.xul-tree-pseudos.content.enabled.
We unshipped these a while ago and left the pref just for testing
purposes. But now all the reftests using it were conveniently migrated
to chrome:// tests, so we no longer need it.

Differential Revision: https://phabricator.services.mozilla.com/D56950
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
5277275263 style: Make CssUrl::is_fragment marginally more efficient.
No need to do utf8 shenanigans for what this function does.

Differential Revision: https://phabricator.services.mozilla.com/D97473
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
9f40b9ba38 style: Avoid some allocations in selector serialization.
The allocations in display_to_css_identifier show up in the profiles of
bug 1675628.

Differential Revision: https://phabricator.services.mozilla.com/D97856
2021-02-26 16:44:05 +01:00
David Parks
178e627500 style: Replace plugin behavior with a basic fallback
The browser currently only enables plugin behavior for Flash and our internal test plugins.  This patch replaces support for those plugins with a simple fallback that shows a transparent region where the plugin would have been.  It removes the file system search(es) for the plugin dynamic libraries and short-circuits the logic to determine if plugins should do something special -- all implementations now behave the same in the presence of plugin elements.

The new behavior is:
1. If the <object> or <embed> element lists a type of something other than "x-shockwave-flash" or "x-test" then the behavior is unchanged.  This means that non-plugin types behave properly and unknown types (for example, typos) are also unaffected (they reduce to 0x0 elements).
2. If the <object> element has an HTML fallback in the DOM (see spec for <object> elements) then the fallback is always shown.
3. Otherwise, the element is shown as a transparent region with the size specified in attributes.

Differential Revision: https://phabricator.services.mozilla.com/D95902
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
Emilio Cobos Álvarez
4771d7ddf0 style: Make focus-visible match the spec more closely.
The spec text has been improved a while ago, so I think we should do
this. This keeps the current moz-focusring behavior when the pref is
disabled, but when enabled it becomes effectively an alias of
focus-visible.

Differential Revision: https://phabricator.services.mozilla.com/D96697
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
20d2a06967 style: Use document quirks mode rather than sheet quirks mode for stylesheet invalidation.
In order to determine whether classes or ids are case insensitive we
need the document quirks mode. The sheet quirks mode almost always
matches, but may not match when sheets are added by privileged APIs.

Differential Revision: https://phabricator.services.mozilla.com/D95061
2021-02-26 16:44:05 +01:00
Ricky Stewart
8a723d48d5 Standardize on Black for Python code in mozilla-central.
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).


Differential Revision: https://phabricator.services.mozilla.com/D94045
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
Emilio Cobos Álvarez
384fd59ad0 style: Use Option::as_deref() in style code.
And drive-by simplify another function that was only doing
Option::clone().

Differential Revision: https://phabricator.services.mozilla.com/D92839
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
f2e765296a style: Allow :is() and :where() to have better error recovery.
Adjust is-where-parsing.html to work with both the new and old behavior,
and add a test for the new behavior.

Depends on D90049

Differential Revision: https://phabricator.services.mozilla.com/D90050
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
83448b6889 style: Remove -moz-suppressed.
Per spec we shouldn't behave differently depending on how we blocked the
image/object/etc.

This may have made sense in the past when ad blockers were implemented
via nsIContentPolicy, but I think nowadays it doesn't make sense, and
showing fallback is preferred.

There's a couple extra cleanups we can do after this lands, like
removing HTMLImageElement.imageBlockingStatus and simplifying a bit that
code. But I'll do that in a separate bug.

Differential Revision: https://phabricator.services.mozilla.com/D89912
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
19c24075b4 style: Remove -moz-user-disabled.
We treat it exactly the same as -moz-broken. The pseudo-class is not
exposed to content, so I don't think we have a reason to keep it around.

Differential Revision: https://phabricator.services.mozilla.com/D89904
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
ad0f63769c style: Speed up custom property diffing.
When entering or leaving fullscreen in youtube, we spend most of the
restyle time diffing custom properties, under IndexMap::eq.

Turns out that IndexMap equality is not order-aware, and thus you
actually need to make a hashmap lookup for each entry in the map, which
is unnecessarily inefficient.

Instead, just compare the iterators.

See https://github.com/bluss/indexmap/issues/153.

Differential Revision: https://phabricator.services.mozilla.com/D89434
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
74c449c04c style: Rename ::file-chooser-button to ::file-selector-button, and enable it in all channels.
See https://github.com/w3c/csswg-drafts/issues/5049

Differential Revision: https://phabricator.services.mozilla.com/D88995
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
Masatoshi Kimura
16e0fd3e1f style: Replace :-moz-native-anonymous-no-specificity with :where(:-moz-native-anonymous).
Differential Revision: https://phabricator.services.mozilla.com/D88255
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
Sean Feng
cf496e4727 style: Make the document blocked by the topmost element in the top layer.
Spec: https://html.spec.whatwg.org/multipage/#blocked-by-a-modal-dialog

Depends on D86392

Differential Revision: https://phabricator.services.mozilla.com/D86227
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
73a9c57c3b style: Implement :-moz-any() as an alias of :is().
This is strictly better and more flexible, but can change specificity so
have a pref in case it causes trouble. I doubt it will though, the
specificity rules of :is() make more sense, and my gut feeling is that
:-moz-any is not very used on the wild.

Make it early-beta-or-earlier for now to minimize risk, once this is on
nightly for a bit we can enable it everywhere.

Differential Revision: https://phabricator.services.mozilla.com/D86696
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
5ba426ae6f style: Remove layout.css.is-where-selectors.enabled.
Shipped since 78 (bug 1632646).

Differential Revision: https://phabricator.services.mozilla.com/D86662
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
0d7922cb53 style: Remove layout.css.shadow-parts.enabled.
Shipped since 72 (bug 1559074).

Differential Revision: https://phabricator.services.mozilla.com/D86661
2021-02-26 16:44:05 +01:00
Alexander Surkov
32f92d18a8 style: implement -moz-inert CSS property.
-moz-inert CSS property reflects inert subtrees concept and can be used to implement HTML:dialog element and HTML:inert attribute

Differential Revision: https://phabricator.services.mozilla.com/D81701
2021-02-26 16:44:05 +01:00
Cameron McCormack
5752e4a3a2 style: Don't use attribute selectors for determining if a select is a drop down or a list box.
Instead add a pseudo-class that does the expected size="" attribute parsing.

Removing the Gtk-specific rule setting the text color since it doesn't
seem to have any effect currently.

Differential Revision: https://phabricator.services.mozilla.com/D83448
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
46df06b3e2 style: Use mozilla::Length rather than nscoord to store font sizes.
This avoids arbitrary precision loss when computing REM units and so on,
which is particularly important if we ever change the base of our app
units (but useful regardless).

Differential Revision: https://phabricator.services.mozilla.com/D79928
2021-02-26 16:44:05 +01:00
Simon Sapin
479a42a980 Reformat with rustfmt 1.4.36-nightly (7de6968 2021-02-07) 2021-02-25 20:31:42 +01:00