Commit Graph

1438 Commits

Author SHA1 Message Date
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
bd406d8841 Bug 1740230 - Allow matches() / querySelector() / etc on chrome docs to access chrome-only selectors. r=boris
Without this some tests fail with the previous patch because code like:

  https://searchfox.org/mozilla-central/rev/267682a8f45221bf0bfe999d4a0239706a43bc56/browser/base/content/browser-gestureSupport.js#651

starts throwing. Unfortunately I had missed that on my try run, because
the error message didn't include that exception (it seemed like an
intermittent browser-chrome failure instead).

We could expose a ChromeOnly API for this, but this seems better. This
fixes it trivially, and also removes the "no url data" situation from
the selector parser, which is nice.

Differential Revision: https://phabricator.services.mozilla.com/D130818
2021-11-10 12:56:35 +00:00
Butkovits Atila
3a33d047e8 Backed out 2 changesets (bug 1740230) for causing build bustages.
Backed out changeset ba8e644ee9d2 (bug 1740230)
Backed out changeset 180d03015fd1 (bug 1740230)
2021-11-10 02:12:26 +02:00
Emilio Cobos Álvarez
620bd78775 Bug 1740230 - Allow matches() / querySelector() / etc on Chrome docs to access chrome-only selectors. r=boris
Without this some tests fail with the previous patch because code like:

  https://searchfox.org/mozilla-central/rev/267682a8f45221bf0bfe999d4a0239706a43bc56/browser/base/content/browser-gestureSupport.js#651

starts throwing. Unfortunately I had missed that on my try run, because
the error message didn't include that exception (it seemed like an
intermittent browser-chrome failure instead).

We could expose a ChromeOnly API for this, but this seems better. This
fixes it trivially, and also removes the "no url data" situation from
the selector parser, which is nice.

Differential Revision: https://phabricator.services.mozilla.com/D130818
2021-11-09 23:28:48 +00:00
Emilio Cobos Álvarez
890026f19b Bug 1739357 - Merge branches in some ComputedValues functions. r=boris
This should mitigate the code size impact. Also make get_resolved_value
non-generic to avoid monomorphizing it multiple times.

Differential Revision: https://phabricator.services.mozilla.com/D130354
2021-11-06 10:14:40 +00:00
Emilio Cobos Álvarez
ac72dbe343 Bug 1738658 - Generalize resolved style code to deal with all shorthands. r=jwatt
This removes the various assumptions that the animation code does.

Code size might be a concern, we can optimize if it is a problem,
but let's do the obvious thing for now.

Differential Revision: https://phabricator.services.mozilla.com/D130017
2021-11-02 14:21:38 +00:00
Emilio Cobos Álvarez
f85c48f96d Bug 1525107 - Implement <meta name=color-scheme>. r=dholbert
There are still tests failing because
https://bugzilla.mozilla.org/show_bug.cgi?id=1736034 hasn't been synced
yet.

Once that lands, they will still fail because we don't change
Canvas/CanvasText based on color-scheme, but that I'm attaching
patches for after this one.

Differential Revision: https://phabricator.services.mozilla.com/D129743
2021-10-29 19:58:24 +00:00
Mike Hommey
4aa571147f Bug 1736477 - Remove unused import_rule::PendingSheet. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D128823
2021-10-19 23:31:04 +00:00
Emilio Cobos Álvarez
9fbc18ca4c Bug 1733384 - Make inert not modify the computed style. r=sefeng,layout-reviewers,jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D127422
2021-10-07 17:00:36 +00:00
Butkovits Atila
4d927c1fb4 Backed out 4 changesets (bug 1733384) for causing failures at browser_windowPrompt.js. CLOSED TREE
Backed out changeset fa609fadac26 (bug 1733384)
Backed out changeset dd1936d9fe17 (bug 1733384)
Backed out changeset 1a073e40ab1a (bug 1733384)
Backed out changeset 65708a4c708f (bug 1733384)
2021-10-07 17:52:51 +03:00
Emilio Cobos Álvarez
bfdd0fcc77 Bug 1733384 - Make inert not modify the computed style. r=sefeng,layout-reviewers,jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D127422
2021-10-07 11:47:34 +00:00
Boris Chiou
397e076032 Bug 1676784 - Part 1: Add animation-timeline longhand property in style system. r=emilio
This patch adds the animation-timeline longhand property. For
shorthand, we will do that in the next patch.

This patch includes the aut-generated code in
devtools/shared/css/generated/properties-db.js, by `./mach devtools-css-db`.

Note:
1. we will use this property in Bug 1676791. For now, only make sure
   we parse it and serialize it correctly.
2. The syntax of animation-timeline may be updated, based on the spec
   issue: https://github.com/w3c/csswg-drafts/issues/6674.
   However, it's not a big problem to update it later, so we still can
   prototype this property based on the current version of spec.

Differential Revision: https://phabricator.services.mozilla.com/D126450
2021-10-01 00:38:54 +00:00
Boris Chiou
b9289ab606 Bug 1676782 - Part 3: Add CSSScrollTimelineRule for CSSOM. r=emilio
Implement CSSScrollTimelineRule CSSOM API.
https://drafts.csswg.org/scroll-animations-1/#the-css-scroll-timeline-rule-interface

We rely on the CSSOM API for testing. However, the wpt doesn't match the
current spec and it has some errors. We update the wpt and enable the
preference for testing in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D125766
2021-09-17 20:25:36 +00:00
Chris Peterson
c9530ebe28 Bug 1729598 - Replace MOZ_MUST_USE_TYPE with [[nodiscard]]. r=static-analysis-reviewers,andi
Differential Revision: https://phabricator.services.mozilla.com/D125504
2021-09-15 05:10:51 +00:00
Emilio Cobos Álvarez
597b7bc37d Bug 1729330 - Add a simple CSSLayerRule implementation. r=smaug
The specifics of how this is going to work are still getting spec'd /
discussed in https://github.com/w3c/csswg-drafts/issues/6576, but this
allows DevTools to work fine and the feature to be complete enough for
Nightly experimentation (with the other in-flight patches).

Otherwise devtools crashes when trying to inspect pages that use them.

Differential Revision: https://phabricator.services.mozilla.com/D124656
2021-09-08 11:18:32 +00:00
Emilio Cobos Álvarez
9309bf97fc Bug 1699217 - Implement @import layer|layer(<name>). r=boris
This works modulo the existing nested layer order bug. Will be covered
by WPT /css/css-cascade/layer-import.html once the feature is enabled (I
can probably enable it right away for those tests, but I'd rather fix
the obvious bugs first).

Differential Revision: https://phabricator.services.mozilla.com/D124538
2021-09-06 16:43:04 +00:00
Sandor Molnar
b2955e8a9d Backed out changeset 34c1b1078f03 (bug 1699217) for causing wpt failures in /css/css-cascade/layer-import. CLOSED TREE 2021-09-06 19:32:53 +03:00
Emilio Cobos Álvarez
1bd2094286 Bug 1699217 - Implement @import layer|layer(<name>). r=boris
This works modulo the existing nested layer order bug. Will be covered
by WPT /css/css-cascade/layer-import.html once the feature is enabled (I
can probably enable it right away for those tests, but I'd rather fix
the obvious bugs first).

Differential Revision: https://phabricator.services.mozilla.com/D124538
2021-09-06 11:15:57 +00:00
Emilio Cobos Álvarez
d71b30b35d Bug 1728754 - Plumb layer order through ApplicableDeclarationBlock, and make it have an effect. r=boris
Same, I want to land this separately to see if it affects
micro-benchmarks. If so, we might want to pack the layer order
_somewhere_ (though in this case I'm not sure where, tbh).

With this, layer rules should have an effect on the page. There are
a few things missing before being able to enable them:

 * Fix nested layer order in some cases (when parent layers are declared
   out of order, see the previous commit mentioning this).
 * Some kind of OM representation, perhaps.
 * Tests of course, which are coming in bug 1728722 and bug 1727276.

But this should be enough to allow playing with them.

Depends on D124337

Differential Revision: https://phabricator.services.mozilla.com/D124338
2021-09-06 10:02:07 +00:00
Emilio Cobos Álvarez
13245e72d6 Bug 1728754 - Add layer_order to rules. r=boris
I want to land this separately because we might want to get smarter with
the size of the Rule struct (maybe restricting layer order to a u8 per
scope and packing it with the source order, since 255 layers seem
plenty), but I'd rather do the obvious thing for now.

Depends on D124336

Differential Revision: https://phabricator.services.mozilla.com/D124337
2021-09-06 09:54:02 +00:00
Emilio Cobos Álvarez
4b3dc20891 Bug 1728617 - Tweak at-rule parsing APIs to support cascade layers. r=boris
This needs https://github.com/servo/rust-cssparser/pull/287 and a
cssparser update.

Differential Revision: https://phabricator.services.mozilla.com/D124216
2021-09-03 09:26:10 +00:00
Emilio Cobos Álvarez
58c214fd32 Bug 856337 - Move image-rendering out of mako. r=dholbert
It's easier to touch in the future that way, even though the derive list is
massive.

Differential Revision: https://phabricator.services.mozilla.com/D124377
2021-09-03 08:56:42 +00:00
Noemi Erli
f3a236c514 Backed out 2 changesets (bug 856337) for causing xpcshell failures in test_css-properties-db.js CLOSED TREE
Backed out changeset 7070c7cea8ec (bug 856337)
Backed out changeset edc12b36439f (bug 856337)
2021-09-03 01:36:17 +03:00
Emilio Cobos Álvarez
a10cd487f5 Bug 856337 - Move image-rendering out of mako. r=dholbert
It's easier to touch in the future that way, even though the derive list is
massive.

Differential Revision: https://phabricator.services.mozilla.com/D124377
2021-09-02 20:28:39 +00:00
Nazım Can Altınova
6788f940ac Bug 1652560 - Remove the unused "gecko_profiler" feature from servo r=emilio
This was being used when we had special code for gecko profiler in the servo
codebase but we just removed the last one. This is safe to remove now. The
"enabled" feature in the gecko-profiler crate is being controlled by
gkrust-shared directly now.

Differential Revision: https://phabricator.services.mozilla.com/D120796
2021-07-30 21:49:23 +00:00
Nazım Can Altınova
ef8cd9ad96 Bug 1652560 - Remove the old profiler label frames code in the servo codebase and replace it with the new API r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D120795
2021-07-30 21:49:22 +00:00
Emilio Cobos Álvarez
02bbf0389a Bug 1722299 - Initial support for the color-scheme CSS property. r=mstange
Add initial support for the color-scheme CSS property, allowing pages to
choose between light and dark system colors per-element, and such.

Things that are left to do so that this can be enabled by default:

 * Dark system colors on Windows / Android / Standins.
 * Dark Canvas/CanvasText/Link visited colors (which right now are set
   via PreferenceSheet).
 * Dark form controls in nsNativeBasicTheme.
 * Processing the color-scheme meta tag to fill-in
   Document::mColorSchemeBits.

But this seems like enough progress to be landable on its own.

Differential Revision: https://phabricator.services.mozilla.com/D120843
2021-07-27 15:50:48 +00:00
Emilio Cobos Álvarez
f501d497d2 Bug 1720710 - Add system-ui boilerplate. r=jfkthame
Alias -apple-system to it, and put it behind a pref for now. This is
pretty boring (read: uncontroversial hopefully) code. The follow-up work
is modifying StaticPresData to look up the fonts using system APIs,
probably. Maybe a bit more work if on macOS they can't be named.

Differential Revision: https://phabricator.services.mozilla.com/D119984
2021-07-27 11:11:51 +00:00
Emilio Cobos Álvarez
e54b955075 Bug 1718337 - More fine-grained viewport units invalidation. r=layout-reviewers,jfkthame
This should speed up window resize significantly.

Differential Revision: https://phabricator.services.mozilla.com/D118878
2021-07-07 11:16:20 +00:00
Emilio Cobos Álvarez
fb069248c0 Bug 1716045 - Unify font-family storage. r=mats,jfkthame
This changes font-family storage to reuse the rust types, removing a
bunch of code while at it. This allows us to, for example, use a single
static font family for -moz-bullet and clone it, rather than creating a
lot of expensive copies.

Differential Revision: https://phabricator.services.mozilla.com/D118011
2021-06-18 19:35:50 +00:00
Emilio Cobos Álvarez
96038c61cc Bug 1716045 - Implement ArcSlice copy/move-assignment operators. r=jfkthame
We're going to use them.

Differential Revision: https://phabricator.services.mozilla.com/D118015
2021-06-18 19:35:49 +00:00
Emilio Cobos Álvarez
a8f090b432 Bug 1715748 - Add an internal -moz-system-color() function to expose both light and dark system colors. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D117416
2021-06-14 15:01:25 +00:00
Jonathan Kew
00a8f91ec3 Bug 1711479 - Implement CSS support for the optional adjustment-basis metric keywords for the font-size-adjust property (enabled on Nightly only for now). r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D115596
2021-06-14 12:32:36 +00:00
Boris Chiou
5918c183ff Bug 1340422 - Part 7: Notify style system when SMIL animation changes d attribute. r=emilio
So we update d property in the style system as well. This makes sure we
have the correct computed style and the correct rendering result.

Differential Revision: https://phabricator.services.mozilla.com/D115570
2021-06-09 21:17:23 +00:00
Boris Chiou
d61e621388 Bug 1340422 - Part 1: Add SVG d property in CSS. r=emilio
Add d property for style system. d property only supports path() for now
and it has the functional notation without fill rule.

https://github.com/w3c/svgwg/issues/320#issuecomment-414462645

Differential Revision: https://phabricator.services.mozilla.com/D81237
2021-06-09 21:17:21 +00:00
Csoregi Natalia
1fa90cf8b2 Backed out 5 changesets (bug 1711479) for multiple failures e.g. test_css-properties-db.js. CLOSED TREE
Backed out changeset f1b19a0463cd (bug 1711479)
Backed out changeset 3d1d2b4a2713 (bug 1711479)
Backed out changeset 4e689776fe5d (bug 1711479)
Backed out changeset 85b6b2648f60 (bug 1711479)
Backed out changeset a15cec1f0554 (bug 1711479)
2021-06-07 13:55:29 +03:00
Jonathan Kew
57c18282b4 Bug 1711479 - Implement CSS support for the optional adjustment-basis metric keywords for the font-size-adjust property (enabled on Nightly only for now). r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D115596
2021-06-07 08:58:12 +00:00
Emilio Cobos Álvarez
a292bdd58b Bug 1707310 - Refactor the author sheet cache to keep alive the relevant StylesheetContents. r=boris
This prevents incorrectly reusing cached results when the contents go
away and new contents are allocated with the same address.

Note that these keep alive transitively everything else under them, so
all other medialist keys don't need this.

By making this a proper hashmap it should also improve cache lookup
times if the cache grows too big.

Differential Revision: https://phabricator.services.mozilla.com/D115202
2021-05-19 09:00:38 +00:00
Emilio Cobos Álvarez
1cdf344860 Bug 1680387 - Apply intrinsic image resolution as appropriate in layout/style/dom, and update test expectations. r=tnikkel
This should be mostly straight-forward, since we have code for this
anyways for image-set() and srcset.

The only thing is that we were using floats for resolution, but since
EXIF allows you to scale each axis separately, we now need to pass an
image::Resolution instead.

The main outstanding issue is the spec comment mentioned in the previous
patch, about what happens if you have srcset/image-set and the image
density specified together. For now I've implemented what the
image-set() spec says, but this is subject to change before shipping of
course.

Differential Revision: https://phabricator.services.mozilla.com/D113265
2021-05-05 09:41:24 +00:00
Iulian Moraru
b21df91635 Backed out 3 changesets (bug 1680387) for causing browser chrome failures on browser_bug592641.js. CLOSED TREE
Backed out changeset 65616921e520 (bug 1680387)
Backed out changeset 51531850a9a2 (bug 1680387)
Backed out changeset 0c1c5e1f901b (bug 1680387)
2021-05-04 16:28:17 +03:00
Emilio Cobos Álvarez
11ad9c7bcd Bug 1680387 - Apply intrinsic image resolution as appropriate in layout/style/dom, and update test expectations. r=tnikkel
This should be mostly straight-forward, since we have code for this
anyways for image-set() and srcset.

The only thing is that we were using floats for resolution, but since
EXIF allows you to scale each axis separately, we now need to pass an
image::Resolution instead.

The main outstanding issue is the spec comment mentioned in the previous
patch, about what happens if you have srcset/image-set and the image
density specified together. For now I've implemented what the
image-set() spec says, but this is subject to change before shipping of
course.

Differential Revision: https://phabricator.services.mozilla.com/D113265
2021-05-04 10:24:07 +00:00
Emilio Cobos Álvarez
34a9a0f457 Bug 1705605 - Implement accent-color in nsNativeBasicTheme. r=mstange
This is a new addition for CSS UI Level 4:

  https://drafts.csswg.org/css-ui-4/#widget-accent

I want to provide feedback on some spec issues, and thought it was a
kinda neat thing to prototype (it also makes testing contrast and such
with random GTK themes easier).

For now enable for Nightly only.

Differential Revision: https://phabricator.services.mozilla.com/D112312
2021-04-27 10:41:00 +00:00
Emilio Cobos Álvarez
8e47e5abc2 Bug 1705877 - image-set() should influence intrinsic size of the image. r=dholbert,layout-reviewers
https://drafts.csswg.org/css-images-4/#image-set-notation has:

> [...] it also specifies the image’s natural resolution, overriding any other
> source of data that might supply a natural resolution.

Astounding that there was literally no WPT for this at all. I added three: one
for backgrounds, one for list-style-image, and one for `content`. Cursor is not
handled on this patch because that one requires a fair amount of extra work.

Differential Revision: https://phabricator.services.mozilla.com/D112474
2021-04-19 19:55:27 +00:00
Emilio Cobos Álvarez
2bf7e6cfc9 Bug 1704179 - Add a CSS error to the console when using non-featureless :host selectors. r=boris
(which would never match by definition).

Differential Revision: https://phabricator.services.mozilla.com/D111610
2021-04-15 09:33:58 +00:00
Emilio Cobos Álvarez
a4272ff381 Bug 1704332 - Move moz-control-character-visibility out of mako, and remove support for gecko_pref_controlled_initial_value. r=xidorn
No behavior change, just cleanup. Actually seem this technically _adds_ some code even
though it's a cleanup, but that's mostly because of the wrapping of the
derive list.  The resulting code is simpler (more in-line with our usual
things, so I think it's an improvement).

Differential Revision: https://phabricator.services.mozilla.com/D111551
2021-04-11 17:39:12 +00:00
Emilio Cobos Álvarez
30483671c1 Bug 1703984 - Clean up text-justify, and make distribute a parse-time alias. r=xidorn
Since it's simpler, as discussed in the CSSWG issue.

Differential Revision: https://phabricator.services.mozilla.com/D111346
2021-04-10 03:45:51 +00:00
Jonathan Kew
5357cb0d41 Bug 1698495 - Add the size-adjust descriptor to the style system. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D110022
2021-03-29 21:14:43 +00:00
Emilio Cobos Álvarez
f91affad79 Bug 1699088 - Use a single system font definition rather than two. r=cmartin
Follow the pattern we use for system colors.

Differential Revision: https://phabricator.services.mozilla.com/D108822
2021-03-24 22:57:37 +00:00
Jonathan Kew
c34bf0ad4f Bug 1681691 - Also remove unnecessary 'unsafe' from a bunch of FontFaceRule descriptor getters. r=emilio
Depends on D109287

Differential Revision: https://phabricator.services.mozilla.com/D109344
2021-03-23 17:10:23 +00:00
Jonathan Kew
8b75657e88 Bug 1681691 - Add ascent-, descent- and line-gap-override descriptors to the style system. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D109287
2021-03-23 17:10:22 +00:00