Commit graph

25052 commits

Author SHA1 Message Date
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
Shinichi Morimoto
5d5d4f4429 style: Remove layout.css.offset-logical-properties.enabled.
Differential Revision: https://phabricator.services.mozilla.com/D87297
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
9d55296893 style: Fix two minor issues with scrollbar style caching.
Add -moz-inert and -moz-script-level to the set of internal properties
that aren't included in "all".

-moz-inert may need to be uncacheable in the future if we make it not
change the pointer-events computed value. Left a comment to that effect.

Differential Revision: https://phabricator.services.mozilla.com/D87115
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
2167a0c099 style: Remove layout.css.comparison-functions.enabled.
Shipped since FF75 (bug 1519519).

Differential Revision: https://phabricator.services.mozilla.com/D86693
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
Emilio Cobos Álvarez
ca7e1ecfd8 style: Invalidate for CSSOM changes in a more fine-grained way.
Also, for changes in CSS declarations, like changing
cssRules[i].style.color or something, we end up avoiding a lot of the
work we were doing.

This page still trips us in the sense that they add a stylesheet, then
call getBoundingClientRect(), then insert more rules in the stylesheet,
which causes us to rebuild a lot of the cascade data.

We could try to detect appends to the last stylesheet on the list or
something I guess, and avoid rebuilding the cascade data in some cases.

Depends on D85615

Differential Revision: https://phabricator.services.mozilla.com/D85616
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
dfa715a8d8 style: Fix a silly mistake in which we'd prefer a local name / tag invalidation to an id invalidation.
ID invalidations should always win.

This also prefers invalidations deeper in the subtree to higher up.

Differential Revision: https://phabricator.services.mozilla.com/D85615
2021-02-26 16:44:05 +01:00
Nicolas Silva
1f36216b59 style: Update euclid in stylo.
Differential Revision: https://phabricator.services.mozilla.com/D85762
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
687fc20274 style: Use Overflow::is_scrollable in StyleAdjuster.
It was introduced in the overflow: clip work but this standalone
equivalent remained.

Differential Revision: https://phabricator.services.mozilla.com/D85778
2021-02-26 16:44:05 +01:00
Mats Palmgren
b29824bf75 style: Implement overflow:clip/visible combinations.
Differential Revision: https://phabricator.services.mozilla.com/D73717
2021-02-26 16:44:05 +01:00
Jeremy Ir
9bfcb3d741 style: Rename overflow:-moz-hidden-unscrollable to overflow:clip.
Differential Revision: https://phabricator.services.mozilla.com/D73716
2021-02-26 16:44:05 +01:00
Zeke Medley
8f89ebffec style: Add parsing for cross-fade from CSS Image Values and Replaced Content Module Level 4.
This is the first of what will likely be a couple patches for
cross-fade's implementation. Bug 546052 tracks it's complete
implementation.

Differential Revision: https://phabricator.services.mozilla.com/D81889
2021-02-26 16:44:05 +01:00
Brian Birtles
7c3d815f78 style: Make text-combine-upright not animatable.
Differential Revision: https://phabricator.services.mozilla.com/D84935
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
Philipp Zech
cd8c07abac style: Convert writing-modes #defines to an enum class.
Differential Revision: https://phabricator.services.mozilla.com/D84016
2021-02-26 16:44:05 +01:00
Brian Birtles
ad22c7a369 style: Allow animations and transitions on ::marker
As per the following change to the spec:

6b3d7240b5

The additional failure annotation is added because we don't currently treat
text-combine-upright as non-animatable and this patch exposes the existing bug
(bug 1654195).

Differential Revision: https://phabricator.services.mozilla.com/D84308
2021-02-26 16:44:05 +01:00
Mats Palmgren
5382a99adb style: [css-grid] Make empty and all-whitespace strings in 'grid-template-areas' invalid.
Differential Revision: https://phabricator.services.mozilla.com/D84398
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
780beace00 style: Make stylesheet invalidation faster.
This fixes performance issues when there's a massive number of rules and
a massive DOM.

Instead of going through all rules for all the DOM, we now look stuff in
hashmaps.

Differential Revision: https://phabricator.services.mozilla.com/D83506
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
Cameron McCormack
a2b016157e style: Hide range and number-input appearance values from content.
Forgot to follow up on these two remaining non-standard values that may have
been being used to reset a <meter> or <input type=number> back to its
original appearance, but which telemetry showed no usage of.

Differential Revision: https://phabricator.services.mozilla.com/D83598
2021-02-26 16:44:05 +01:00
Cameron McCormack
da503c4b48 style: Re-order Appearance values.
Differential Revision: https://phabricator.services.mozilla.com/D83437
2021-02-26 16:44:05 +01:00
Cameron McCormack
862b7d1249 style: Make appearance: button behave like auto on various elements.
Differential Revision: https://phabricator.services.mozilla.com/D83434
2021-02-26 16:44:05 +01:00
Cameron McCormack
f03883774b style: Avoid exposing appearance: range-thumb to content.
Differential Revision: https://phabricator.services.mozilla.com/D83433
2021-02-26 16:44:05 +01:00
Cameron McCormack
ab3791234e style: Mark appearance values that are only used internally as chrome-only.
Differential Revision: https://phabricator.services.mozilla.com/D83432
2021-02-26 16:44:05 +01:00
Cameron McCormack
21b6c69322 style: Remove appearance values not used by the browser or Web content.
Differential Revision: https://phabricator.services.mozilla.com/D83431
2021-02-26 16:44:05 +01:00
Cameron McCormack
8457666204 style: Change internal uses of -moz-appearance to appearance and -moz-default-appearance.
Uses of `-moz-appearance: none` are changed to `appearance: none`.

Uses of other values that are simply reverting the appearance back to
its default are changed to `appearance: auto`.

Uses of values in UA sheets that are defining the inherent appearance of
widgets are changed to:

  appearance: auto;
  -moz-default-appearance: <value>;

since those values are either no longer supported on (-moz-)appearance,
or are still supported but only in some limited form.

There are some uses of `-moz-appearance: textfield` on <input
type=number> elements that are renamed to `appearance: textfield`.

Differential Revision: https://phabricator.services.mozilla.com/D83430
2021-02-26 16:44:05 +01:00
Cameron McCormack
7ae2f8602e style: Defer to -moz-default-appearance when appearance is auto.
Differential Revision: https://phabricator.services.mozilla.com/D83429
2021-02-26 16:44:05 +01:00
Cameron McCormack
01efe3a459 style: Add unprefixed appearance property and make -moz-appearance and -webkit-appearance be aliases.
Differential Revision: https://phabricator.services.mozilla.com/D83428
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
Emilio Cobos Álvarez
1c8d4be6b2 style: Fix an off-by-one in the transition property iterator.
By the time we get to iterate over the longhands of a shorthand, we've
already advanced the range iterator, so we look at the next duration and
such, which causes this bug.

I'm seriously baffled that no existing test caught this when it
landed, neither in our internal test suite nor wpt...  :/

Differential Revision: https://phabricator.services.mozilla.com/D82396
2021-02-26 16:44:05 +01:00
Cameron McCormack
1f9d6ad5ef style: Remove unused function on Appearance.
Differential Revision: https://phabricator.services.mozilla.com/D82124
2021-02-26 16:44:05 +01:00
Cameron McCormack
87612b65c5 style: Remove unused StyleAppearance values.
The parsing of these values was disabled in bug 1554150.

Differential Revision: https://phabricator.services.mozilla.com/D82122
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
75b38efefd style: Have the destructor of CalcNode be never inline.
You tell me which other things need it... Copy-constructor? operator==?
and such?

Differential Revision: https://phabricator.services.mozilla.com/D73385
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
Josh Matthews
3f39dde189 Adjust size test for debug/release differences. 2021-02-26 04:20:23 -05:00
Josh Matthews
3ce71cda73 Add build github actions workflows for mac/windows/linux. 2021-02-26 04:20:22 -05:00
bors-servo
5916911281
Auto merge of #28201 - servo:rustup, r=jdm
Upgrade to rustc 1.52.0-nightly (a8486b64b 2021-02-24)
2021-02-25 18:40:03 -05:00
Simon Sapin
aa854ec2d2 Upgrade to rustc 1.52.0-nightly (a8486b64b 2021-02-24) 2021-02-25 20:31:43 +01:00
Simon Sapin
479a42a980 Reformat with rustfmt 1.4.36-nightly (7de6968 2021-02-07) 2021-02-25 20:31:42 +01:00
bors-servo
6e1350f3aa
Auto merge of #27647 - jdm:build-std, r=SimonSapin
Use build-std instead of xargo.

The changes to num-integer and indexmap are to work around https://github.com/cuviper/autocfg/issues/34.
2021-02-25 14:28:24 -05:00
bors-servo
30f927f67b
Auto merge of #28203 - jdm:update-truetype, r=SimonSapin
Update truetype dependency.

Closes https://github.com/servo/servo/issues/28101
2021-02-25 13:22:05 -05:00
Josh Matthews
47fc8f9697 Force indexmap to rely on libstd. 2021-02-25 10:15:09 -05:00
Josh Matthews
b29a8a21f7 Update truetype dependency. 2021-02-25 10:10:40 -05:00
Simon Sapin
a0d9f97c8e Fix warnings introduced in newer Rust Nightly
This does not (yet) upgrade ./rust-toolchain

The warnings:

* dead_code "field is never read"
* redundant_semicolons "unnecessary trailing semicolon"
* non_fmt_panic "panic message is not a string literal, this is no longer accepted in Rust 2021"
* unstable_name_collisions "a method with this name may be added to the standard library in the future"
* legacy_derive_helpers "derive helper attribute is used before it is introduced" https://github.com/rust-lang/rust/issues/79202
2021-02-25 15:36:03 +01:00
bors-servo
19d1544b66
Auto merge of #27619 - servo:rustup, r=jdm
Upgrade to rustc 1.48.0-nightly (623fb90b5 2020-09-26)

https://github.com/rust-lang/hashbrown/pull/159 reduced `size_of::<HashMap>()`
2021-02-25 00:11:29 -05:00