Граф коммитов

14058 Коммитов

Автор SHA1 Сообщение Дата
Butkovits Atila c1d171544c Backed out 2 changesets (bug 1763644, bug 1762474) for causing failures at test_interfaces.html. CLOSED TREE
Backed out changeset 6a588f6d08f7 (bug 1762474)
Backed out changeset ff486de30883 (bug 1763644)
2022-04-08 02:26:22 +03:00
Emilio Cobos Álvarez fc117ea85d Bug 1763644 - Add basic @container rule parsing and boilerplate. r=firefox-style-system-reviewers,layout-reviewers,boris
For now parse a MediaFeatureCondition. That needs being made more
specific, but that is probably worth its own patch.

Differential Revision: https://phabricator.services.mozilla.com/D143192
2022-04-07 22:06:15 +00:00
Emilio Cobos Álvarez 6553f27967 Bug 1762298 - Inherit used color-scheme from embedder <browser> elements. r=nika,dao,Gijs
This allows popups and sidebars to use the chrome preferred
color-scheme.

This moves the responsibility of setting the content-preferred color
scheme to the appropriate browsers to the front-end (via tabs.css).

We still return the PreferredColorSchemeForContent() when there's no
pres context (e.g., for display:none in-process iframes). We could
potentially move a bunch of the pres-context data to the document
instead, but that should be acceptable IMO as for general web content
there's no behavior change in any case.

Differential Revision: https://phabricator.services.mozilla.com/D142578
2022-04-04 18:22:04 +00:00
Emilio Cobos Álvarez f5cdddf6ef Bug 1762796 - Deduplicate TokenList values faster. r=smaug
Remember whether we have already de-duplicated them once and avoid doing
that again.

This is an alternative approach that doesn't add overhead to attribute
setting in the general case.

Differential Revision: https://phabricator.services.mozilla.com/D142813
2022-04-04 14:23:23 +00:00
David Shin 1fc2ad0158 Bug 1759621 - Migrate `<th>` `text-align` behaviour from presentation hint to UA CSS. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D142494
2022-04-01 22:57:05 +00:00
Molnar Sandor 8c2a7b41fb Backed out changeset caf3fd368a8e (bug 1759621) for causing xpc failures in /test_css-properties-db.js CLOSED TREE 2022-04-02 00:18:00 +03:00
David Shin e75208ec5b Bug 1759621 - Migrate `<th>` `text-align` behaviour from presentation hint to UA CSS. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D142494
2022-04-01 20:24:19 +00:00
Emilio Cobos Álvarez f9cf190188 Bug 1762088 - Remove assert that doesn't hold for text-decorations because of presentation hints.
MANUAL PUSH: Orange fix CLOSED TREE
2022-04-01 02:27:35 +02:00
Emilio Cobos Álvarez b9e7c7653c Bug 1762088 - Implement parsing / serialization for container{,-type,-name} CSS properties. r=firefox-style-system-reviewers,layout-reviewers,boris
Two noteworthy details that may seem random otherwise:

 * Moving values around in nsStyleDisplay is needed so that the struct
   remains under the size limit that we have to avoid jumping allocator
   buckets.

 * All the test expectation churn is because tests depend on
   `container-type: size` parsing to run, and now they run. Tests for
   the relevant bits I implemented are passing, with the only exception
   of some `container-name-computed.html` failures which are
   https://github.com/w3c/csswg-drafts/issues/7181. Safari agrees with
   us there.

Other notes when looking at the spec and seeing how it matches the
implementation:

 * `container` syntax doesn't match spec, but matches tests and sanity:
   https://github.com/w3c/csswg-drafts/issues/7180

 * `container-type` syntax doesn't _quite_ match spec, but matches tests
   and I think it's a spec bug since the definition for the missing
   keyword is gone:
   https://github.com/w3c/csswg-drafts/issues/7179

Differential Revision: https://phabricator.services.mozilla.com/D142419
2022-03-31 22:56:20 +00:00
Emilio Cobos Álvarez bfde1cd835 Bug 1762088 - Allow to derive Parse/ToCss/SpecifiedValueInfo on bitflags. r=firefox-style-system-reviewers,layout-reviewers,boris
We keep getting this pattern of properties that have a set of joint and
disjoint flags, and copy-pasting or writing the same parsing and
serialization code in slightly different ways.

container-type is one such type, and I think we should have a single way
of dealing with this, thus implement deriving for various traits for
bitflags, with an attribute that says which flags are single vs mixed.

See docs and properties I ported. The remaining ones I left TODOs with,
they are a bit trickier but can be ported with some care.

Differential Revision: https://phabricator.services.mozilla.com/D142418
2022-03-31 22:05:02 +00:00
Hiroyuki Ikezoe 25d4e998dd Bug 1760222 - Ignore unchanged property for scroll-linked effect detector. r=hiro
I think this is cleaner.

Differential Revision: https://phabricator.services.mozilla.com/D141737
2022-03-27 23:40:24 +00:00
Emilio Cobos Álvarez 1162a3c578 Bug 1666059 - Really honor background-color: transparent in HCM even for form controls. r=morgan
I forgot we were doing this "revert-or-initial" shenanigans (which is needed
for stuff like link colors to be honored), so we need to early-return.

Use a more explicit test rather than a reftest for this.

Differential Revision: https://phabricator.services.mozilla.com/D142063
2022-03-25 18:15:43 +00:00
Emilio Cobos Álvarez 829400449f Bug 1760579 - layout.css.moz-locale-dir.content.enabled. r=dholbert
We successfully removed these from content in bug 1740230 (Firefox 96).

Differential Revision: https://phabricator.services.mozilla.com/D141727
2022-03-25 14:59:00 +00:00
Emilio Cobos Álvarez dd020d602a Bug 1760342 - Remove :-moz-lwtheme-{brighttext,darktext}. r=dao,Gijs
They are just convenience for :root[lwthemetextcolor="light"] (and dark,
respectively), but they generally shouldn't be used for dark mode
theming. In the past it was the only way to do it but now we have
prefers-color-scheme.

While at it, change lwthemetextcolor to be "lwtheme-brighttext" for
consistency with similar code we have for popups etc, and move it to
_setDarkModeAttributes.

While at it, remove layout.css.moz-lwtheme.content.enabled (which is
false always, we unshipped these from content successfully).

Differential Revision: https://phabricator.services.mozilla.com/D141593
2022-03-25 14:58:59 +00:00
Brad Werth 99d39f2636 Bug 1751217 Part 1: Support media queries for dynamic-range and video-dynamic-range. r=emilio
This is a stub that only matches "standard" for all platforms.

Differential Revision: https://phabricator.services.mozilla.com/D141053
2022-03-24 18:19:49 +00:00
Emilio Cobos Álvarez 80fa6eae2f Bug 1680285 - Simplify selector flag setting now that flag setting is atomic. r=nika,decoder
These bits are write-only, actually, and we don't even need to read
them.

Differential Revision: https://phabricator.services.mozilla.com/D141888
2022-03-24 15:09:47 +00:00
Emilio Cobos Álvarez a801665d19 Bug 1758223 - Remove some no longer used use statements.
MANUAL PUSH: Bustage fix CLOSED TREE
2022-03-24 11:14:06 +01:00
Emilio Cobos Álvarez 597c2fe947 Bug 1758223 - Use atomic ops to read / write node flags from stylo. r=nika
The flags stylo cares about reading and writing potentially at the same
time are disjoint, so there's no need for any strong memory ordering.

Differential Revision: https://phabricator.services.mozilla.com/D141829
2022-03-24 10:03:12 +00:00
Cristian Tuns f0ccbd470c Backed out 4 changesets (bug 1760222) for causing reftest failures on disable-apz-for-sle-pages.html CLOSED TREE
Backed out changeset 1bf5e1ca3746 (bug 1760222)
Backed out changeset aff6bf37365d (bug 1760222)
Backed out changeset e9b3e3f52aec (bug 1760222)
Backed out changeset f65d2d719277 (bug 1760222)
2022-03-24 02:36:42 -04:00
Butkovits Atila 004df17a21 Backed out changeset 8a3be63619de (bug 1758223) for causing bustages. CLOSED TREE 2022-03-24 06:31:29 +02:00
Emilio Cobos Álvarez ec82ced641 Bug 1758223 - Use atomic ops to read / write node flags from stylo. r=nika
The flags stylo cares about reading and writing potentially at the same
time are disjoint, so there's no need for any strong memory ordering.

Differential Revision: https://phabricator.services.mozilla.com/D141829
2022-03-24 04:08:18 +00:00
Hiroyuki Ikezoe da3af8126d Bug 1760222 - Ignore unchanged property for scroll-linked effect detector. r=hiro
I think this is cleaner.

Differential Revision: https://phabricator.services.mozilla.com/D141737
2022-03-24 02:20:46 +00:00
Butkovits Atila fbd6ad4819 Backed out 5 changesets (bug 1751217) for causing failures at dynamic-range.html. CLOSED TREE
Backed out changeset f0a4879c9709 (bug 1751217)
Backed out changeset 50b6310935d4 (bug 1751217)
Backed out changeset bfa455b8bb1a (bug 1751217)
Backed out changeset 277064a1facb (bug 1751217)
Backed out changeset 21e1650b12db (bug 1751217)
2022-03-23 22:22:54 +02:00
Brad Werth 930a7aac22 Bug 1751217 Part 1: Support media queries for dynamic-range and video-dynamic-range. r=emilio
This is a stub that only matches "standard" for all platforms.

Differential Revision: https://phabricator.services.mozilla.com/D141053
2022-03-23 18:23:00 +00:00
Marian-Vasile Laza 77029463ac Backed out 5 changesets (bug 1751217) for causing wpt(Screen-pixelDepth-Screen-colorDepth001.html) and mochitest(test_media_queries.html) failures. CLOSED TREE
Backed out changeset 60a4497fd1f5 (bug 1751217)
Backed out changeset 785f4c5f719d (bug 1751217)
Backed out changeset 81e41f7a1ee4 (bug 1751217)
Backed out changeset d35c5648c936 (bug 1751217)
Backed out changeset f16305c6ec83 (bug 1751217)
2022-03-23 10:11:53 -07:00
Brad Werth 2cd3c4b978 Bug 1751217 Part 1: Support media queries for dynamic-range and video-dynamic-range. r=emilio
This is a stub that only matches "standard" for all platforms.

Differential Revision: https://phabricator.services.mozilla.com/D141053
2022-03-23 15:24:37 +00:00
Emilio Cobos Álvarez b75c39ad35 Bug 1760734 - Put overflow: -moz-hidden-unscrollable behind a pref on Nightly. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D141759
2022-03-23 08:41:51 +00:00
Emilio Cobos Álvarez 6d5d698b6e Bug 1666059 - Honor background-color: transparent in forced colors mode. r=morgan
See comment as for why, and linked bugs, in particular:

  https://bugzilla.mozilla.org/show_bug.cgi?id=1755713#c16

And the following screenshot for example.

Differential Revision: https://phabricator.services.mozilla.com/D141514
2022-03-21 22:36:13 +00:00
Cristian Tuns 416761cf78 Backed out changeset 1b1df0fb2320 (bug 1666059) for causing mochitest failures in test_dont_use_document_colors.html CLOSED TREE 2022-03-21 16:18:59 -04:00
Emilio Cobos Álvarez eebea40065 Bug 1666059 - Honor background-color: transparent in forced colors mode. r=morgan
See comment as for why, and linked bugs, in particular:

  https://bugzilla.mozilla.org/show_bug.cgi?id=1755713#c16

And the following screenshot for example.

Differential Revision: https://phabricator.services.mozilla.com/D141514
2022-03-21 17:54:03 +00:00
Martin Robinson c7ed0eb07c Bug 1759130 - Add support for parsing the `content-visibility` property from the CSS Contain specification r=emilio
Add initial parsing support for the CSS `content-visibility` attribute.
Currently these parsed values have no effect.

Differential Revision: https://phabricator.services.mozilla.com/D140834
2022-03-14 12:33:55 +00:00
Emilio Cobos Álvarez 9399d71846 Bug 1758974 - Reuse inherited custom properties if they didn't change after resolution. r=jwatt
This should be cheap and gives us a lot of memory savings for the page
on the bug, by deduplicating the inherited properties between parent and
children.

WebKit implements a similar optimization.

Differential Revision: https://phabricator.services.mozilla.com/D140826
2022-03-11 18:12:56 +00:00
Emilio Cobos Álvarez 93e19dc4dd Bug 1758974 - Make custom-property substitution only traverse variables which could have references. r=jwatt
If a name is not in self.seen, it means we've inherited it from our
parent. That in turn means that it can't have any variable reference
(because we inherit the computed variables) and we can skip the work of
traversing it, as we'd hit the early-return in traverse() anyways.

This doesn't fix the memory usage issue of the page on the bug, which
has a giant list of properties on the root and then a custom property
specified on all elements, but should significantly reduce the time we
spend iterating over custom properties for all those elements.

Differential Revision: https://phabricator.services.mozilla.com/D140825
2022-03-11 18:12:55 +00:00
Emilio Cobos Álvarez 3c5d0d725e Bug 1757017 - Make keyframes for pseudo-elements inherit from the right style. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D140045
2022-03-02 18:19:18 +00:00
Emilio Cobos Álvarez 5fed8de04b Bug 1754547 - Generalize moz-os-version into moz-platform. r=dao,preferences-reviewers,Gijs
Allow differentiating non-windows platforms on it.

Differential Revision: https://phabricator.services.mozilla.com/D138431
2022-02-10 15:50:31 +00:00
Emilio Cobos Álvarez 4a152fdf3e Bug 1746248 - Style system and plumbing for mix-blend-mode: plus-lighter. r=jrmuizel,layout-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D137951
2022-02-09 03:15:52 +00:00
Mike Hommey 2239244615 Bug 1751331 - Use the mozbuild crate in servo. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D136562
2022-01-25 21:29:51 +00:00
Mike Hommey e7c54fc571 Bug 1751331 - Remove MOZ_DIST. r=firefox-build-system-reviewers,mhentges
As mentioned in bug 1747354, the location of the dist directory is
relied to be $topobjdir/dist, so just use that consistently rather
than getting it from a separate variable for rust build scripts.

Differential Revision: https://phabricator.services.mozilla.com/D136556
2022-01-25 21:29:49 +00:00
criss 592389ca2d Backed out 10 changesets (bug 1751331) for causing bustages. CLOSED TREE
Backed out changeset 5ce212465a26 (bug 1751331)
Backed out changeset 14d62b8ffa5a (bug 1751331)
Backed out changeset 76f46bd9afa1 (bug 1751331)
Backed out changeset 147faaad046f (bug 1751331)
Backed out changeset f85b049d12f9 (bug 1751331)
Backed out changeset 16d8d3f8378b (bug 1751331)
Backed out changeset 1cd9386a3927 (bug 1751331)
Backed out changeset 20faacba6db6 (bug 1751331)
Backed out changeset 7d17f75bcb38 (bug 1751331)
Backed out changeset 28b9aab1f174 (bug 1751331)
2022-01-25 13:00:25 +02:00
Mike Hommey 3269a65b4f Bug 1751331 - Use the mozbuild crate in servo. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D136562
2022-01-25 09:03:03 +00:00
Mike Hommey 5999e70213 Bug 1751331 - Remove MOZ_DIST. r=firefox-build-system-reviewers,mhentges
As mentioned in bug 1747354, the location of the dist directory is
relied to be $topobjdir/dist, so just use that consistently rather
than getting it from a separate variable for rust build scripts.

Differential Revision: https://phabricator.services.mozilla.com/D136556
2022-01-25 09:03:01 +00:00
Emily McDonough 7dade2da45 Bug 1750884 - Add style_traits::ToCss for AtomIdent r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D136290
2022-01-24 17:29:20 +00:00
Emily McDonough 8542878028 Bug 1740364 Part 1 - Implement basic @page-rule selector parsing r=emilio
This does not support any of the pseudo page types.

Differential Revision: https://phabricator.services.mozilla.com/D131532
2022-01-21 21:52:43 +00:00
Mike Hommey 56a7d24688 Bug 1751340 - Upgrade darling to 0.13.1. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D136568
2022-01-21 21:23:19 +00:00
Emilio Cobos Álvarez edb8762a6e Bug 1751088 - Choose tabpanel background based on content preferred color-scheme. r=dao
If the theme is dark but user prefers light pages, the background of the
tabpanel should arguably be light, since it can be seen across some
navigations.

Expose a -moz-content-prefers-color-scheme media query to chrome pages
so that our UI can correctly query it (and remove the unused -moz-proton
atom while at it).

Differential Revision: https://phabricator.services.mozilla.com/D136437
2022-01-20 12:09:13 +00:00
Emilio Cobos Álvarez 096bfd3558 Bug 1747934 - Apply line-height to ::marker. r=layout-reviewers,jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D136313
2022-01-19 16:43:34 +00:00
Emilio Cobos Álvarez 4924555d6d Bug 1746084 - Avoid generating InterpolateMatrix operations if there are no size dependencies. r=hiro
The issue here is that we end up with a transition between mismatched
transform lists that ends up generating an InterpolateMatrix {}
operation. So far so good, but we end up interpolating that a lot of
times and generating an unboundedly-deep operation list.

This implementas an optimization that flattens them to a single matrix
when possible (when there's no dependencies on the containing box).

This is similar to:

  2b89cc4df4

We fix the to_pixel_length() behavior for LenghtPercentage to be
correct (and update callers to preserve behavior).

Differential Revision: https://phabricator.services.mozilla.com/D134784
2022-01-05 19:10:28 +00:00
Emilio Cobos Álvarez 24dc10c691 Bug 1748174 - Remove touch-action pref. r=hiro
It's been enabled by default since ~forever.

Differential Revision: https://phabricator.services.mozilla.com/D134935
2022-01-05 12:28:07 +00:00
Emilio Cobos Álvarez b975e781a1 Bug 1747922 - Rename StyleMathMLMathVariant -> StyleMathVariant.
MANUAL PUSH: Trivial rename.
2021-12-30 02:35:54 +01:00
Neia Finch b205467245 Bug 1747922 - Replace MathML font constants with enum r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D134802
2021-12-30 00:34:27 +00:00
Emilio Cobos Álvarez 6b5a53d800 Bug 1747595 - Make color-adjust an alias of print-color-adjust as per spec. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D134779
2021-12-29 21:52:25 +00:00
Emilio Cobos Álvarez f4a133a1fd Bug 1747037 - Shrink maps if needed after stylist rebuilds. r=bholley
Hashbrown grows a lot sometimes making us waste a lot of memory. Shrink
some of these maps after CascadeData rebuild / stylesheet collection
invalidation.

Differential Revision: https://phabricator.services.mozilla.com/D134716
2021-12-28 17:19:31 +00:00
Emilio Cobos Álvarez 149bb0ed03 Bug 1747349 - Remove ThinBoxedSlice. r=xidorn
The only remaining consumers are ::-moz-tree pseudo-elements (we used to
use ThinBoxedSlice for other data structures in the past).

Those are not particularly performance sensitive so I think just
double-boxing is fine. In the future, if we wanted to avoid the double
indirection, we could probably use the "thin" crate
(https://docs.rs/thin) or similar, which stores the length of the slice
along with the allocation, making the pointer thin in all
configurations, much like "ThinArc" does:

  https://searchfox.org/mozilla-central/rev/1ce2eea39442190a71a1f8f650d098f286bf4a01/servo/components/servo_arc/lib.rs#891

In practice though, I don't think it's particularly worth it for this
specific case.

Differential Revision: https://phabricator.services.mozilla.com/D134672
2021-12-25 06:25:35 +00:00
Emilio Cobos Álvarez 2ac050afaa Bug 1746920 - Use ThreadPool::scope_fifo in style. r=TYLin
It does the same, but it saves an indentation level:

  https://searchfox.org/mozilla-central/rev/a11b63915bd7810a03635d733123448ab5bfcad3/third_party/rust/rayon-core/src/thread_pool/mod.rs#217

Differential Revision: https://phabricator.services.mozilla.com/D134321
2021-12-20 23:55:36 +00:00
Emilio Cobos Álvarez 461f89a0bb Bug 1746683 - Remove hwba since it's not a thing (hwb function supports alpha).
Partially backs out the previous patch.

Differential Revision: https://phabricator.services.mozilla.com/D134256
2021-12-20 02:53:31 +00:00
Emilio Cobos Álvarez 61ea030cc4 Bug 1746683 - Add hwb/a to devtools autocomplete lists. r=dholbert
The changes to the devtools directory were written automatically via ./mach devtools-css-db

Differential Revision: https://phabricator.services.mozilla.com/D134197
2021-12-18 20:09:29 +00:00
Emilio Cobos Álvarez be1a744435 Bug 1744102 - Remove servo/components/{hashglobe,fallible} in favor of try_reserve. r=xidorn
Differential Revision: https://phabricator.services.mozilla.com/D134194
2021-12-18 09:54:24 +00:00
Sandor Molnar e45ac2363d Backed out changeset e9782fd301cc (bug 1746683) for causing mochitest failures in layout/inspector/tests/test_bug877690.html CLOSED TREE 2021-12-18 05:58:39 +02:00
Emilio Cobos Álvarez bd470ae24f Bug 1746683 - Add hwb/a to devtools autocomplete lists. r=dholbert
The changes to the devtools directory were written automatically via ./mach devtools-css-db

Differential Revision: https://phabricator.services.mozilla.com/D134197
2021-12-18 01:09:00 +00:00
Emilio Cobos Álvarez 8fdcc6a236 Bug 1746391 - Deal with layers and at-rules. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D134010
2021-12-17 12:58:32 +00:00
Jonathan Kew 20ec7ce89f Bug 1746187 - Add CSS support for the hyphenate-character property. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D133889
2021-12-16 13:47:55 +00:00
Marian-Vasile Laza e3ec8630b1 Backed out 4 changesets (bug 1746187) for causing xpcshell failures on test_css-properties-db.js.
Backed out changeset fa4f889dd0d3 (bug 1746187)
Backed out changeset e3fce2273109 (bug 1746187)
Backed out changeset 6733677ad35d (bug 1746187)
Backed out changeset a4375ff93414 (bug 1746187)
2021-12-16 04:51:13 +02:00
Jonathan Kew 83df1246c1 Bug 1746187 - Add CSS support for the hyphenate-character property. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D133889
2021-12-15 23:16:49 +00:00
Emilio Cobos Álvarez b4eb3f9643 Bug 1745894 - Don't draw window decorations when painting headerbar on wayland. r=stransky
This is a better fix for the double decorations than clipping them using
CSS.

Differential Revision: https://phabricator.services.mozilla.com/D133871
2021-12-15 13:12:01 +00:00
Emilio Cobos Álvarez f13595acc8 Bug 1745233 - Update CSSOM for layer rules to the spec. r=firefox-style-system-reviewers,layout-reviewers,boris
Pretty mechanical.

Tests are in https://wpt.live/css/css-cascade/layer-rules-cssom.html
which (with a fix for @import tests which I'll submit separately) we
pass.

Sync for that is bug 1743936.

Differential Revision: https://phabricator.services.mozilla.com/D133387
2021-12-14 15:39:38 +00:00
Emilio Cobos Álvarez d84300e6e7 Bug 1699220 - Fix style attribute important and revert-layer behavior. r=firefox-style-system-reviewers,layout-reviewers,boris
By modeling it as a separate layer that behaves somewhat specially.

See https://github.com/w3c/csswg-drafts/issues/6872.

The remaining revert-layer tests that we fail are because either we
don't implement a feature (like @property) or because it's used in
keyframes (where revert is a bit unspecified and we have existing
issues with it).

Differential Revision: https://phabricator.services.mozilla.com/D133373
2021-12-14 15:38:34 +00:00
Emilio Cobos Álvarez dae5c87696 Bug 1699220 - Add support for the revert-layer keyword. r=boris
This patch looks bigger than it is, but it's mostly because
of plumbing.

To implement revert-layer we need not only the cascade origin of the
declaration, but the whole cascade level, plus also the layer order.

In order to do this, encapsulate these two things inside a 32-bit
`CascadePriority` struct and plumb it through the rule tree and so on.
This allows us to remove the packing and unpacking of CascadeLevel,
though I kept the ShadowCascadeOrder limit for now in case we need to
reintroduce it.

Fix `!important` behavior of layers while at it (implementing it in
`CascadeLevel::cmp`, spec quote included since it was tricky to find)
since some revert-layer tests were depending on it.

The style attribute test is failing now, but follow-up commit fixes
it, see spec issue.

In terms of the actual keyword implementation, it's sort of
straight-forward: We implement revert and revert-layer in a shared
way, by storing the cascade priority that reverted it.

Differential Revision: https://phabricator.services.mozilla.com/D133372
2021-12-14 15:38:34 +00:00
Jonathan Kew 9477e32f16 Bug 1531223 - Add support for the 'ic' font-relative unit. r=emilio
This is a "simplified" implementation of 'ic', similar to what Safari Preview
currently supports: it only considers the advance of U+6C34 if found in the
first available font, and otherwise falls back to the default of 1em.

(The spec allows for this "in cases where it is impossible or impractical to
determine the ideographic advance measure".)

Differential Revision: https://phabricator.services.mozilla.com/D132818
2021-12-08 17:07:05 +00:00
Jonathan Kew 719dd66863 Bug 1702924 - Add support for the 'cap' font-relative unit. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D133101
2021-12-08 12:20:40 +00:00
Boris Chiou 1ce11d0155 Bug 1676791 - Part 10: Make source and scroll-offsets accept only default value. r=emilio
Based on our previous patches, we only support default behavior for
source and scroll-offsets:
1. source:auto
2. scroll-offsets: none
3. scroll-offsets: auto, auto, ...

So update the parser for them. We expect to remove whole
@scroll-timeline in Bug 1733260, so now only do a tiny update in parser.

Differential Revision: https://phabricator.services.mozilla.com/D132417
2021-12-08 01:16:31 +00:00
Boris Chiou 74f0bd8a0c Bug 1676791 - Part 8: Hook scroll-timeline rule into Cascade data and use it for CSS animations. r=emilio,hiro
We hook the rule into cascade data, and so we can look it up by timeline
name. Now we only use StyleScrollDirection from @scroll-timeline rule.
`source` and `scroll-offsets` are skipped now and use the default values
instead because I'm pretty sure the syntax will be changed in Bug 1733260,
and `scroll-offsets` may be obsolete because the spec proposal intents to
make it be always 0% ~ 100%.

Also, add some reftests for the default `source` and `scroll-offsets`,
and different `orientation`s.

Besides, we disable at-scroll-timeline-start-end.html in Gecko because
we don't support start/end descriptors, and there are too many
intermittents in it.

Differential Revision: https://phabricator.services.mozilla.com/D126452
2021-12-08 01:16:31 +00:00
Boris Chiou 470f574f58 Bug 1676791 - Part 1: Add ScrollTimeline class. r=hiro
Define a simple version of ScrollTimeline.

Differential Revision: https://phabricator.services.mozilla.com/D129099
2021-12-08 01:16:28 +00:00
Emily McDonough c4d55a9374 Bug 1741973 - Implement parsing of the page property r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D131531
2021-12-07 22:11:53 +00:00
Alexandru Michis 40430b0cce Backed out changeset 66eb52e5da74 (bug 1741973) for causing mochitest failures in test_animation-type-longhand.html
CLOSED TREE
2021-12-07 00:01:55 +02:00
Emily McDonough bd3b879775 Bug 1741973 - Implement parsing of the page property r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D131531
2021-12-06 19:34:43 +00:00
Butkovits Atila 21676cf030 Backed out changeset 145c64b7ac17 (bug 1531223) for causing failures at gfxFontEntry.cpp. CLOSED TREE 2021-12-06 14:57:31 +02:00
Jonathan Kew ed3fd395ba Bug 1531223 - Add support for the 'ic' and 'cap' font-relative units. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D132818
2021-12-06 12:22:09 +00:00
Sandor Molnar 0d095a62b5 Backed out changeset 8fac157c354a (bug 1741973) for causing xpc failures in devtools/shared/tests/xpcshell/test_css-properties-db. CLOSED TREE 2021-12-03 04:17:36 +02:00
Emily McDonough 1de10c57f2 Bug 1741973 - Implement parsing of the page property r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D131531
2021-12-02 23:37:28 +00:00
Emilio Cobos Álvarez 2abc89c41e Bug 1509931 - Use titlebar radius on Linux and make titlebar set-up work for lightweight themes. r=stransky,dao
To do this, we always draw the native titlebar behind the toolbox, and
then make the toolbox adapt to it by using the titlebar radius. This
makes us preserve the shadow properly.

On Wayland we'd double-draw the shadow (see bug 1509931 comment 4) so
this fixes it by trimming it as well using border-radius.

Differential Revision: https://phabricator.services.mozilla.com/D128681
2021-12-01 18:15:12 +00:00
Emilio Cobos Álvarez a9b6db8e3f Bug 1743803 - Remove unnecessary button-focus appearance value on Linux. r=dao
This always draws transparent. Only real thing it does is forcing 0px
padding.

Differential Revision: https://phabricator.services.mozilla.com/D132563
2021-12-01 13:33:02 +00:00
Emilio Cobos Álvarez 4354146592 Bug 1432090 - Honor GTK button layout. r=stransky,desktop-theme-reviewers,dao
This is based off work by smurfd. But this patch doesn't support buttons
both at the left and right, which simplifies a lot the implementation.

Also, clean-up the existing env variables while at it.

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

Differential Revision: https://phabricator.services.mozilla.com/D132073
2021-11-26 11:37:52 +00:00
Emilio Cobos Álvarez 2dca36cb25 Bug 502258 - Add a Show Password button to <input type=password> controls. r=Gijs
It's controlled by the pref:
layout.forms.input-type-show-password-button.enabled

Differential Revision: https://phabricator.services.mozilla.com/D130407
2021-11-25 20:12:05 +00:00
Emilio Cobos Álvarez 24be48359c Bug 1742574 - Keep system fonts when prioritizing user fonts. r=jfkthame,layout-reviewers
This was a subtle behavior change in bug 1739464. The early-return here:

  https://hg.mozilla.org/mozilla-central/rev/2fb74c67b0c5#l11.40

Meant we also bailed out from user font prioritization for system fonts.

It's unclear whether that's really the best behavior but since the
intention of the regressing patch was not to change behavior, preserving
the old behavior seems better.

Differential Revision: https://phabricator.services.mozilla.com/D131899
2021-11-23 12:41:19 +00:00
Emilio Cobos Álvarez e120f9b2b2 Bug 1742393 - Correctly report animation status of pseudo-elements that are not stored in the parent element. r=hiro
We allow animating pseudo-elements like ::-moz-progress-bar (and we
treat them like regular elements).

Ideally we should store animations for these in the parent element as
well, so they survive reframes and such. But treating them as regular
elements right now means that we do animate them, but we never update
animations for them correctly because wrapper.rs assumed them to be
non-animatable.

Since it seems reasonable to keep allowing the animations to happen,
let's just correct the update code and add a test.

Differential Revision: https://phabricator.services.mozilla.com/D131794
2021-11-23 12:36:22 +00:00
lamoure6 3478e8ae47 Bug 1719938 - Removed remaining (non-negated) -moz-proton media queries. r=mhowell,mtigley,emilio
Differential Revision: https://phabricator.services.mozilla.com/D125328
2021-11-22 22:10:33 +00:00
Emilio Cobos Álvarez ff07ef7e17 Bug 1739464 - Simplify language-dependent font fallback code. r=jfkthame
.fallback is always the default font for the lang group unless we're a
system font (in which case it's "none").

The only reason we need that is because we need to react to
language changes (which affect the initial font).

Simplify the model a bit doing the language lookup in gfxTextRun (this
should avoid allocating a few nsStyleFont structs too.

Depends on D130732

Differential Revision: https://phabricator.services.mozilla.com/D131312
2021-11-19 16:11:55 +00:00
Emilio Cobos Álvarez 2f4e4df679 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-19 16:11:54 +00:00
Emilio Cobos Alvarez eef21610c6 Bug 1725721 - Top layer elements that are display:contents should be display: block. r=hiro
As per https://fullscreen.spec.whatwg.org/#new-stacking-layer:

    If its specified display property is contents, it computes to block.

Differential Revision: https://phabricator.services.mozilla.com/D131585
2021-11-19 04:46:42 +00:00
Ting-Yu Lin 5d4998ecf4 Bug 1741774 - Support scrollbar-gutter in the style system. r=emilio
This patch adds `scrollbar-gutter` property in CSS Overflow level 3 [1] to the
style system.

`devtools/shared/css/generated/properties-db.js` is generated by
`./mach devtools-css-db`.

[1] https://drafts.csswg.org/css-overflow-3/#scrollbar-gutter-property

Differential Revision: https://phabricator.services.mozilla.com/D131460
2021-11-19 01:48:07 +00:00
Ting-Yu Lin ca1b688007 Bug 1741990 - Run rustfmt on servo/components/style and servo/ports/geckolib. r=emilio,layout-reviewers
This patch is generated by running `cargo +nightly fmt` under
`servo/components/style/` and `servo/ports/geckolib` against mozilla-central
https://hg.mozilla.org/mozilla-central/rev/b193f2e7a6a5d1f042c957ea4acd5c89bf210512

My nightly version is: 1.58.0-nightly (c9c4b5d72 2021-11-17)

Manually remove the redundant braces in author_styles.rs to fix a warning.

Differential Revision: https://phabricator.services.mozilla.com/D131556
2021-11-19 00:14:27 +00:00
Norisz Fay 09cb6f5caa Backed out changeset 00651c04ba31 (bug 1741990) for causing build bustages CLOSED TREE 2021-11-19 01:03:56 +02:00
Ting-Yu Lin 6d43b0f7b8 Bug 1741990 - Run rustfmt on servo/components/style and servo/ports/geckolib. r=emilio,layout-reviewers
This patch is generated by running `cargo +nightly fmt` under
`servo/components/style/` and `servo/ports/geckolib` against mozilla-central
https://hg.mozilla.org/mozilla-central/rev/b193f2e7a6a5d1f042c957ea4acd5c89bf210512

My nightly version is: 1.58.0-nightly (c9c4b5d72 2021-11-17)

Differential Revision: https://phabricator.services.mozilla.com/D131556
2021-11-18 22:46:24 +00:00
Emilio Cobos Álvarez 1cc0113008 Bug 1740924 - Partially back out bug 1105364. r=morgan
Apparently using transparent borders and outlines is a common
accessibility technique to make those visible in HCM.

Bug 1740924 comment 9 seemed to indicate we were the only browser
rendering those browsers, but I just confirmed that Edge at least does
show them.

Keep respecting system colors as that's per spec.

Differential Revision: https://phabricator.services.mozilla.com/D131412
2021-11-18 21:20:49 +00:00
Emilio Cobos Álvarez 2d8ab09b73 Bug 1739699 - Use preferred color scheme when forcing colors with system colors (except windows HCM). r=morgan
This causes (among other things) pages to be dark when using regular
windows system colors and forcing colors to "always", which is nice.

Differential Revision: https://phabricator.services.mozilla.com/D131165
2021-11-16 22:30:26 +00:00
Mats Palmgren a36baa4d58 Bug 1706346 part 3 - [css-lists] Remove the internal '-moz-list-reversed' CSS property that is no longer needed. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D129957
2021-11-14 03:49:36 +00:00
Mats Palmgren 2e0a36d04d Bug 1706346 part 1 - [css-lists] Style system changes to support 'reversed(<counter-name>)'. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D129955
2021-11-14 03:49:35 +00:00
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