Commit Graph

13879 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
8b39ce0241 Bug 1734570 - Update layer ordering to follow the spec. r=boris
The bitfield approach worked when the layer order was in pre-order, but
the spec was changed to make it work like post-order and I don't think
there's a way to keep it working like that, so keep the layer order in a
separate data structure that we look up when going from Rule to
ApplicableDeclarationBlock.

This is just a vector index operation so hopefully shouldn't be too bad.

This patch intentionally regresses @keyframe handling to some extent,
since we need a bit more complicated approach and it seemed worth
implementing in a separate patch.

Depends on D129380

Differential Revision: https://phabricator.services.mozilla.com/D129381
2021-10-26 23:00:29 +00:00
Emilio Cobos Álvarez
aacd5cb566 Bug 1734570 - Store a LayerOrder in ApplicableDeclarationBlock. r=boris
This shouldn't change behavior jut yet.

Differential Revision: https://phabricator.services.mozilla.com/D129380
2021-10-26 23:00:29 +00:00
Emilio Cobos Álvarez
f317384568 Bug 1736518 - Make browser.tabs.drawInTitlebar a tri-state. r=stransky,Gijs
To more properly support Linux having a different default at runtime.

Expose the resolved value in appinfo for convenience, and use it in the
front-end as needed.

Differential Revision: https://phabricator.services.mozilla.com/D129004
2021-10-21 09:07:12 +00:00
stransky
aecdcaacb9 Bug 1736795 [Linux] Export titlebar radius as int from LookAndFeel, r=emilio
Titlebar radius is exported as integer from Gtk so there's no need to use floats here.

Differential Revision: https://phabricator.services.mozilla.com/D128993
2021-10-20 18:01:02 +00:00
Emilio Cobos Álvarez
9ec6b27649 Bug 1736848 - Don't use nsContentUtils::sNamespaceManager in servo. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D129030
2021-10-20 15:25:10 +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
db97a652b6 Bug 1509931 - Fix rebase mistake.
MANUAL PUSH: Bustage fix CLOSED TREE
2021-10-18 21:16:07 +02:00
Emilio Cobos Álvarez
2cdb78d6a6 Bug 1509931 - Remove -moz-gtk-csd-transparent-background. r=stransky,desktop-theme-reviewers,dao
We always use alpha visual for WebRender, and appearance: none is
unnecessary (root element has no intrinsic appearance).

Differential Revision: https://phabricator.services.mozilla.com/D128682
2021-10-18 18:51:41 +00:00
Emilio Cobos Álvarez
b742f680db Bug 1509931 - Expose titlebar radius as a chrome-only CSS environment variable. r=stransky
Mostly plumbing.

Differential Revision: https://phabricator.services.mozilla.com/D128680
2021-10-18 16:22:13 +00:00
Emilio Cobos Álvarez
c676353b72 Bug 1509931 - Add support for chrome-only environment variables. r=stransky
This bit is taken straight from D73454 (I reviewed it but I guess
another pair of eyes is ok, it's really straight-forward).

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

Differential Revision: https://phabricator.services.mozilla.com/D128679
2021-10-18 16:22:13 +00:00
Mats Palmgren
cce3f3a286 Bug 1736129 - Make #[css(represents_keyword)] convert underscore in the field name to dash. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D128668
2021-10-16 20:09:24 +00:00
Emilio Cobos Álvarez
c4b7109fac Bug 1736038 - Remove -moz-toolbar-prefers-color-scheme. r=dao
By making prefers-color-scheme return the ColorSchemeForChrome(), which
accounts for the Firefox theme.

Differential Revision: https://phabricator.services.mozilla.com/D128611
2021-10-15 16:53:08 +00:00
Emilio Cobos Álvarez
37660aa996 Bug 1730503 - Make anonymous scrollbar caching work on mac by default, and unify scrollbars.css across platforms. r=mstange,desktop-theme-reviewers,dao
We make it work on macOS by setting pointer-events: none + opacity: 0 rather
than visibility: hidden, and tweaking the caching setup to be Android-like.

Now that the scrollbars sheet is the same across platforms, move it to where
the rest of the UA sheets are. This way we guarantee that the RDM vs. Android
difference is less (just the ifdef at the top of the sheet).

Depends on D128084

Differential Revision: https://phabricator.services.mozilla.com/D128085
2021-10-12 09:21:18 +00:00
Emilio Cobos Álvarez
ca970e3818 Bug 1735083 - Clean up GTK titlebar colors. r=desktop-theme-reviewers,dao
Apparently ActiveCaption/CaptionText/InactiveCaption/InactiveCaptionText
are supposed to be used for titlebars, so implement them properly and
remove the GTK-specific colors.

Differential Revision: https://phabricator.services.mozilla.com/D128028
2021-10-11 22:16:58 +00:00
Boris Chiou
33ba1b4ed4 Bug 1734472 - Tweak the serialization of rotate property. r=emilio
The serialization of rotate should be updated to match the current spec.

1. If a rotation about the z axis (that is, in 2D) is specified, the property
   must serialize as just an <angle>.

2. If any other rotation is specified, the property must serialize with an axis
   specified. If the axis is parallel with the x or y axes, it must serialize
   as the appropriate keyword.

Also, we need to handle the zero length vector separately because it is
parallel to every other vector but different from x axis, y axis, or z axis.

Differential Revision: https://phabricator.services.mozilla.com/D127747
2021-10-07 20:05:10 +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
445c7b4297 Bug 1734455 - Remove support for -moz-system-color() as chrome code no longer uses it (in favor of color-scheme). r=xidorn
Differential Revision: https://phabricator.services.mozilla.com/D127802
2021-10-07 11:56:17 +00: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
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
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
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