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

9856 Коммитов

Автор SHA1 Сообщение Дата
Glenn Watson a9ef6ad97d Bug 1734282 - Remove some unused scroll frame APIs and code r=gfx-reviewers,jrmuizel
ScrollSensitivity is not used by Gecko. Also remove some remnants
of the old code to combine scroll frames when display lists swap.

Differential Revision: https://phabricator.services.mozilla.com/D127609
2021-10-06 06:43:03 +00:00
Emilio Cobos Álvarez e50c80851e Bug 1734115 - Add basic support for dark form controls to nsNativeBasicTheme. r=mstange
For that:

 * Tweak the standin system colors to match the non-native theme.

 * Use those system colors for button and field backgrounds.

 * Rename the "should use system colors" bit to "is high contrast",
   which is what it really is (specially now that we use system colors
   also in non-high-contrast).

Border colors and other colors like the <input type=range> and such
might need some extra tweaking perhaps, but this is a decent start and
looks good in https://crisal.io/tmp/form-controls.html afaict (dark mode
toggle needs the color-scheme pref enabled of course).

Differential Revision: https://phabricator.services.mozilla.com/D127533
2021-10-05 14:40:52 +00:00
Harry Twyford 5a88e54daf Bug 1732322 - Part 1 - Enable color-scheme CSS property in chrome sheets. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D127300
2021-10-03 00:10:17 +00:00
Emilio Cobos Álvarez 3899f8f87d Bug 1733475 - Ensure to copy over the viewport/font units invalidation bits when reusing reset properties. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D127262
2021-10-01 19:53:30 +00:00
Emilio Cobos Alvarez 21a3f0049f Bug 1733565 - Clean up button active system colors. r=mstange,desktop-theme-reviewers,dao
This patch does three things:

 * Unifies mac and gtk's buttonactivetext system colors (unships mac's from
   content, but it was never meant to be exposed).

 * Simplifies the forms.css rules, since <input type=color>'s color property
   value doesn't affect its rendering in any meaningful way.

 * Adds a buttonactiveface color, which we'll use to provide dark backgrounds
   for buttons in Windows dark mode (and is good practice, since generally
   every text system color should have a corresponding background).

So as-is it shouldn't change content-exposed behavior (except we stop exposing
the -moz-mac-buttonactivetext to content), but it's a worthy cleanup.

Depends on D127246

Differential Revision: https://phabricator.services.mozilla.com/D127259
2021-10-01 19:42:16 +00:00
Emilio Cobos Álvarez 390ddc27d6 Bug 1733339 - Remove NS_AUTHOR_SPECIFIED_PADDING. r=mstange
There's only one meaningful usage of it, which is to disable native
appearance of the <input type=range> (the windows native theme is no
longer exposed to content).

<input type=range> is inconsistent with every other native widget, which
only disables native appearance if the author specifies backgrounds or
borders. So make it match literally all other widgets and simplify a bit
the code.

We had no tests for this special behavior, let me know if you think it's
worth adding one (but I don't feel very strongly about it).

Differential Revision: https://phabricator.services.mozilla.com/D127082
2021-10-01 11:48:17 +00:00
Cristian Tuns b56ca950cf Backed out changeset a19e4f8a75d7 (bug 1733339) for causing reftest failures. CLOSED TREE 2021-10-01 03:54:08 -04:00
Emilio Cobos Álvarez b53a78f446 Bug 1733339 - Remove NS_AUTHOR_SPECIFIED_PADDING. r=mstange
There's only one meaningful usage of it, which is to disable native
appearance of the <input type=range> (the windows native theme is no
longer exposed to content).

<input type=range> is inconsistent with every other native widget, which
only disables native appearance if the author specifies backgrounds or
borders. So make it match literally all other widgets and simplify a bit
the code.

We had no tests for this special behavior, let me know if you think it's
worth adding one (but I don't feel very strongly about it).

Differential Revision: https://phabricator.services.mozilla.com/D127082
2021-10-01 06:31:09 +00:00
Boris Chiou ac12e63d6f Bug 1676784 - Part 2: Add animation-timeline into animation shorthand. r=emilio
We use the same rule as blink: serialize the animation-timeline if
it is not the default value.

Differential Revision: https://phabricator.services.mozilla.com/D126451
2021-10-01 00:38:55 +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
Emilio Cobos Álvarez a74c41b569 Bug 1732523 - Order keyframe rules by layer. r=firefox-style-system-reviewers,boris
@counter-style/@font-face/@scroll-timeline need similar fixes, but tests
for those haven't been synced yet so waiting for that before writing
them.

Differential Revision: https://phabricator.services.mozilla.com/D126616
2021-09-30 09:59:14 +00:00
Emilio Cobos Álvarez e5a8824eaf Bug 1732759 - Unprefix -moz-fit-content. r=dholbert
I'm not aware of any reason we shouldn't do this, as it is interoperable
with other browsers, and it causes compat issues from sites that forget
to use the prefixed version.

Note this removes some #[parse(aliases)]. These only affect devtools
autocomplete behavior, and we avoid autocompleting -moz-prefixed
keywords when possible, so even though it's a slight behavior change,
it's worth it.

Differential Revision: https://phabricator.services.mozilla.com/D126718
2021-09-28 11:44:33 +00:00
Stephen A Pohl 87f63ab1b8 Bug 1633860: Place window control buttons on the right side on macOS when using an RTL system locale, regardless of the Firefox locale. r=mstange,emilio,harry
Differential Revision: https://phabricator.services.mozilla.com/D116921
2021-09-22 18:51:20 +00:00
Emilio Cobos Álvarez a2247a143d Bug 1731142 - Print lock address on assert. r=firefox-style-system-reviewers,layout-reviewers,boris
Note that the crash reason is sanitized so we're not exposing anything
sensitive.

I think my patch just changed the signature of the stack, as it didn't
change anything related to guards or what not. But without knowing why
is failing or a repro it's hard to know what's going on.

Printing the address at list would give us some indication of what might
be going wrong (perhaps we're using a static lock when we don't expect
one or such?).

Differential Revision: https://phabricator.services.mozilla.com/D125948
2021-09-21 01:56:30 +00:00
Csoregi Natalia 5232f16dc4 Backed out changeset 5523334143d9 (bug 1719938) for failures on browser_parsable_css.js. CLOSED TREE 2021-09-21 02:39:55 +03:00
lamoure6 5c23ae0374 Bug 1719938 - Removed remaining (non-negated) -moz-proton media queries. r=mhowell,mtigley,emilio
Differential Revision: https://phabricator.services.mozilla.com/D125328
2021-09-20 22:40:42 +00:00
Csoregi Natalia 592741b7e0 Backed out changeset 0711ae54877b (bug 1719938) for bustages on media_features.rs. CLOSED TREE 2021-09-20 23:29:05 +03:00
lamoure6 a4e720c69d Bug 1719938 - Removed remaining (non-negated) -moz-proton media queries. r=mhowell,mtigley,emilio
Differential Revision: https://phabricator.services.mozilla.com/D125328
2021-09-20 19:21:50 +00:00
Emilio Cobos Álvarez 0873ed43bc Bug 1596184 - Get rid of nsStackFrame. r=layout-reviewers,mats
There are no legacy-stack uses anymore.

Differential Revision: https://phabricator.services.mozilla.com/D126077
2021-09-20 12:05:32 +00:00
Boris Chiou 27c108353e Bug 1676782 - Part 5: Drop the unused effective_xxx_rules. r=emilio
It seems only effective_style_rules() and effective_viewport_rules() are
used. Let's drop the unused ones.

Differential Revision: https://phabricator.services.mozilla.com/D125905
2021-09-17 20:25:37 +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
Boris Chiou 63df6026b6 Bug 1676782 - Part 2: Hook @scroll-timeline rule into style system. r=emilio
We add scroll-timeline rule into the stylesheet rule type, and add a new
perference to protect it: layout.css.scroll-linked-animations.enabled.

We will use this perference for animation-timeline property as well.

Differential Revision: https://phabricator.services.mozilla.com/D125765
2021-09-17 20:25:36 +00:00
Boris Chiou 9bf39f52dc Bug 1676782 - Part 1: Implement @scroll-timeline in style system. r=emilio
Define the data structure for @scroll-timeline rule, the parsing code,
and the serialization.

Differential Revision: https://phabricator.services.mozilla.com/D125764
2021-09-17 20:25:35 +00:00
Mike Hommey 7e36533f7a Bug 1730397 - Remove unnecessary semi-colons in some macros. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D125503
2021-09-15 07:53:20 +00:00
criss 54043ff723 Backed out changeset 4c5f2e282204 (bug 1729421) for bc failures 2021-09-14 17:42:03 +03:00
Emilio Cobos Álvarez 5f285c94eb Bug 1729421 - Do not key rule tree children by cascade level. r=jwatt
This was needed before, since we used to optimize empty style rules away
(and thus we could get confused between the important and non-important
block for two different elements).

But now we always keep them, and thus there's no way for the same
declaration block to appear in two similar paths of the rule tree
without different cascade levels.

I found this because if we want to implement the revert-layer CSS-wide
keyword, we need to put the layer order in the rule tree. However the
same thing applies: The same style source will always have the same
layer for a given cascade-data rebuild, so I believe this should be
fine.

Differential Revision: https://phabricator.services.mozilla.com/D124740
2021-09-14 13:24:37 +00:00
Emilio Cobos Álvarez e53d06167c Bug 1730123 - Fix anonymous name handling in presence of stylesheet sharing. r=firefox-style-system-reviewers,boris
We need to compute the anonymous name on the fly while building the
CascadeData, otherwise we may see the same layer rule in two places due
to stylehseet sharing and make them incorrectly share a name.

Differential Revision: https://phabricator.services.mozilla.com/D125175
2021-09-11 00:04:18 +00:00
Emilio Cobos Álvarez b31a2c497f Bug 1730134 - Add some parsing and serialization tests for @layer. r=boris
This uncovers some serialization bugs, and some missing null-checks
given the statement layer doesn't have a rule list.

Differential Revision: https://phabricator.services.mozilla.com/D125176
2021-09-10 23:16:02 +00:00
Emilio Cobos Álvarez c2b9557652 Bug 1729804 - Add experimental support for "e", "pi", and various trigonometric functions in calc(). r=firefox-style-system-reviewers,boris
I'll add some tests before enabling. Also, WebKit folks (who have
implemented cos() / tan() / sin()) said they will upstream their tests
to WPT, so I'll extend those with the inverse functions before landing
as well.

Differential Revision: https://phabricator.services.mozilla.com/D124990
2021-09-10 18:22:36 +00:00
Emilio Cobos Álvarez ba14a8c91c Bug 1730098 - Don't consider system-ui valid for user font prioritization. r=jfkthame
Since the user can't configure it, at least from the UI (we could add UI
for it but it's unclear it'd be worth it).

Differential Revision: https://phabricator.services.mozilla.com/D125182
2021-09-10 12:08:19 +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 1fc2475b41 Bug 1729289 - Fix layer statement with nested layer names. r=boris
When we had:

  @layer A.B;

We were registering "A" and "B", not "A" and "A.B", which was the intention.

Fix is trivial.

Depends on D124620

Differential Revision: https://phabricator.services.mozilla.com/D124621
2021-09-08 11:17:04 +00:00
Emilio Cobos Álvarez f4095b3242 Bug 1729289 - Fix out of order child layer registration, and enable the tests. r=boris
This makes layer order use a fixed set of bits per nesting level, to "reserve"
bits for children before they are registered.

See the comment in LayerOrder for the implementation limits it imposes, and
potential alternatives if these limits are not enough (but I think they should
be).

Enable the tests, as they mostly pass now (commit incoming to fix the remaining
ones).

Differential Revision: https://phabricator.services.mozilla.com/D124620
2021-09-08 11:17:04 +00:00
Jonathan Kew 6dbef6ba5d Bug 1729147 - Fix the serialization order for the text-decoration shorthand to match the canonical order in the spec. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D124536
2021-09-06 18:22:37 +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 56d7403b70 Bug 1728754 - Tweak recursion in add_rule to only cause a function call per recursion level. r=boris
This code is really hot, and we've had perf regressions in the past for
introducing function calls in the hot path.

After the previous patch, add_rule is recursive and thus it can't be
inlined, causing a function call for each CSS rule.

This reduces the overhead by making the function take a rule list
instead, causing a function call per rule _list_, which should be
unnoticeable in practice.

Depends on D124335

Differential Revision: https://phabricator.services.mozilla.com/D124336
2021-09-04 07:42:46 +00:00
Emilio Cobos Álvarez bb807d90de Bug 1728754 - Compute layer order during CascadeData rebuild. r=boris
For that, deal with children in add_rule recursively, to keep the
current layer name up-to-date in block layer rules.

This is not the final version of this code, as right now something like
this:

  @layer A {
    ...
  }

  @layer B {
    ...
  }

  @layer A.A {
    ...
  }

Would give A.A more priority over B, which is not correct. There are
tests for this incoming in wpt sync and such, but that can be tweaked
later.

Differential Revision: https://phabricator.services.mozilla.com/D124335
2021-09-04 07:42:46 +00:00
Emilio Cobos Álvarez 367ee8048d Bug 1728754 - Factor out adding a rule in CascadeData::add_rule. r=boris
This shouldn't have any behavior change, but is necessary because for
cascade layers we are going to need to handle the child rules / sheets
ourselves, in order to handle nested layers properly.

Differential Revision: https://phabricator.services.mozilla.com/D124334
2021-09-04 07:42:45 +00:00
Emilio Cobos Álvarez 7bd3a20ff4 Bug 1728851 - Add attributes to the rule hash. r=boris
See the discussion here: https://twitter.com/Rich_Harris/status/1433153204678799365

This should make attribute selectors roughly as fast as class selectors.

I think it's worth trying and see if perf bots complain on
micro-benchmarks and stylebench and such.

I made attributes more specific than local names, but less specific than
classes, which I think makes sense. When doing something like
foo[data-bar], filtering by data-bar seems likely to yield less elements
than filtering by foo.

While at it, remove the bloom filter pref since we shipped it in
bug 1704551 for 87 and we haven't heard complaints.

Differential Revision: https://phabricator.services.mozilla.com/D124383
2021-09-03 15:57:30 +00:00
Emilio Cobos Álvarez c112357ea9 Bug 1728633 - Hook up basic @layer rule parsing. r=boris
Disabled, and of course doing nothing for now still, but this is another
piece that is useful to get reviewed separately.

Don't allow layers to be interleaved with @import / @namespace rules as
per https://github.com/w3c/csswg-drafts/issues/6522.

Differential Revision: https://phabricator.services.mozilla.com/D124229
2021-09-03 09:28:08 +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 fdb57614e0 Bug 1728348 - Restore an #[allow] that will otherwise cause warnings.
MANUAL PUSH: Trivial no-behavior-change CLOSED TREE
2021-09-03 11:20:25 +02:00
Emilio Cobos Álvarez 0f945d081b Bug 1728348 - Add some scaffolding for @layer rules. r=boris
Not hooked anywhere yet, so this doesn't change behavior, but adds the
basic data model etc.

Adding parsing support requires some changes to cssparser to allow the
same at rule to be block and statement-like at the same time, so better
done separately.

Differential Revision: https://phabricator.services.mozilla.com/D124079
2021-09-03 09:12:43 +00:00
criss c6ef85e3b3 Backed out changeset 876e53ec90c4 (bug 1728851) as requested by Emilio. CLOSED TREE 2021-09-03 12:13:11 +03:00
Emilio Cobos Álvarez f28b5935c0 Bug 1728851 - Add attributes to the rule hash. r=boris
See the discussion here: https://twitter.com/Rich_Harris/status/1433153204678799365

This should make attribute selectors roughly as fast as class selectors.

I think it's worth trying and see if perf bots complain on
micro-benchmarks and stylebench and such.

I made attributes more specific than local names, but less specific than
classes, which I think makes sense. When doing something like
foo[data-bar], filtering by data-bar seems likely to yield less elements
than filtering by foo.

While at it, remove the bloom filter pref since we shipped it in
bug 1704551 for 87 and we haven't heard complaints.

Differential Revision: https://phabricator.services.mozilla.com/D124383
2021-09-03 08:58:20 +00:00
Emilio Cobos Álvarez 70f53c85d4 Bug 856337 - Implement image-rendering: smooth and image-rendering: pixelated. r=jrmuizel,dholbert,longsonr
Also, more directly go from StyleImageRendering to wr::ImageRendering.

 * image-rendering: smooth the non-deprecated version of
   OptimizeQuality, which maps to SamplingFilter::LINEAR /
   wr::ImageRendering::Auto (which uses gl::LINEAR).

 * image-rendering: pixelated maps to wr::ImageRendering::Pixelated /
   SamplingFilter::POINT which is the same crisp-edges does.

Note that this uncovers that we were mapping image-rendering:
crisp-edges to wr::ImageRendering::Pixelated.

I'm going to preserve behavior on this patch but we should consider
switching that to map to wr::ImageRendering::CrispEdges on a
follow-up (filed bug 1728831 for this).

Differential Revision: https://phabricator.services.mozilla.com/D124378
2021-09-03 08:56:43 +00:00