Commit graph

13629 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
a3e653759b Bug 1696447 - Share CascadeData instances across ShadowRoots. r=boris
This should be both a memory and speed win for pages using a lot of
Shadow DOM.

In order to make the cache properly work we need to start keying media query
results on the actual StyleSheetContents, as that's what we share on Gecko, but
that should all be fine.

Differential Revision: https://phabricator.services.mozilla.com/D107266
2021-03-10 12:34:09 +00:00
Emilio Cobos Álvarez
874380cfb8 Bug 1696447 - Make the cascade data cache generic. r=boris
We're going to use it both for UA sheets and for author styles in Shadow
DOM.

Differential Revision: https://phabricator.services.mozilla.com/D107265
2021-03-10 12:34:09 +00:00
Xidorn Quan
7427d420ad Bug 1694748 part 1 - Support parsing ruby-position: alternate. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D107382
2021-03-10 10:46:14 +00:00
Emilio Cobos Álvarez
12b75a5e93 Bug 1696409 - Paper over a crash in non-nightly. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D107400
2021-03-08 23:29:30 +00:00
Micah Tigley
1fd9e9b229 Bug 1695403 - Support image-set in the content property. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D107397
2021-03-08 23:27:49 +00:00
Micah Tigley
9d0923ec27 Bug 1696677 - Have collect_completion_keywords return url and image-set for CursorImage. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D107381
2021-03-07 21:38:20 +00:00
Emilio Cobos Álvarez
15ccc7ae4e Bug 1696434 - Address spec changes re. color-mix. r=boris,desktop-theme-reviewers
It was clarified that the percentages are weights, and two weights are
now allowed. Missing percentages are computed as 100% - the other or
50%. Other than that, commas are required etc, which is good since
that's how I implemented it originally.

Differential Revision: https://phabricator.services.mozilla.com/D107295
2021-03-05 02:30:23 +00:00
Micah Tigley
99ac1f352b Bug 1695402 - Support image-set() on the cursor property. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D106745
2021-03-03 18:34:46 +00:00
Csoregi Natalia
de702c9eb1 Backed out changeset 78567f53575e (bug 1695402) for failures on test_css-properties-db.js. CLOSED TREE 2021-03-03 19:54:08 +02:00
Emilio Cobos Álvarez
8cc760e83a Bug 1695376 - Implement basic color-mix() functionality, behind a pref, but exposed to chrome code. r=boris
This is straight-forward and builds on the color animation code. This
implements only the <percentage> syntax, not the whole <color-adjuster>
syntax, which seems fairly more complex.

Of course, this only uses sRGB because that's all the colors we support,
but it should be feasible to extend to lab() / lch() colors once we
support those.

I believe this subset of syntax is useful and worth implementing, so
people can play with it and say if it's useful.

Differential Revision: https://phabricator.services.mozilla.com/D106698
2021-03-03 16:35:53 +00:00
Micah Tigley
dee15c3162 Bug 1695402 - Support image-set() on the cursor property. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D106745
2021-03-03 16:34:39 +00:00
Emilio Cobos Álvarez
c17b1c2e53 Bug 1695390 - Move extremum lengths to the individual Size / MaxSize types. r=boris
This will prevent growing them when introducing fit-content(<length>).

This can _almost_ be derived, if it wasn't because of the quirky stuff.
I think the macro is probably good enough for now but let me know if you
disagree.

Differential Revision: https://phabricator.services.mozilla.com/D106713
2021-03-02 12:11:35 +00:00
Brindusan Cristian
82efbb80e1 Backed out changeset be6d9849825d (bug 1695390) for wr failures in col-definite-max-size-001.html. CLOSED TREE 2021-03-02 13:41:40 +02:00
Emilio Cobos Álvarez
b5686164be Bug 1695390 - Move extremum lengths to the individual Size / MaxSize types. r=boris
This will prevent growing them when introducing fit-content(<length>).

This can _almost_ be derived, if it wasn't because of the quirky stuff.
I think the macro is probably good enough for now but let me know if you
disagree.

Differential Revision: https://phabricator.services.mozilla.com/D106713
2021-03-02 10:34:39 +00:00
Emilio Cobos Álvarez
f482ffa15d Bug 1695369 - Simplify StyleColor representation. r=jwatt
There's no need for CurrentColor / Numeric variants when we can
represent them with the complex form.

Differential Revision: https://phabricator.services.mozilla.com/D106690
2021-03-01 16:05:14 +00:00
Emilio Cobos Álvarez
50404c19c1 Bug 1695251 - Cherry-pick various servo changes.
All formatting and not-part-of-the-gecko-build changes.

Differential Revision: https://phabricator.services.mozilla.com/D106634
2021-02-26 17:00:55 +00:00
Simon Sapin
8a93c0d3bd Bug 1695165 - Fix warnings introduced in newer Rust Nightly. r=jdm,emilio
This cherry-picks https://github.com/servo/servo/pull/28202

MANUAL PUSH: Otherwise review information gets lost.
2021-02-26 10:55:26 +01:00
Emilio Cobos Álvarez
18f0466bc6 Bug 1694864 - Remove prefers-contrast: forced as per CSSWG resolution. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D106485
2021-02-25 18:05:08 +00:00
Boris Chiou
3bb28a3f45 Bug 1670155 - Implement Animate trait and ComputeSquaredDistance trait for <ratio>. r=emilio
I also update the wpt becasue it seems the original one lets <ratio>
support the addition. However, the spec says "Addition of <ratio>s is not
possible".

Differential Revision: https://phabricator.services.mozilla.com/D106219
2021-02-25 01:50:55 +00:00
Boris Chiou
13fe2773c1 Bug 1670155 - Move Ratio into independent files. r=emilio
Based on https://drafts.csswg.org/css-values/#ratios, <ratio> should be
a general types in css values, and now the media query and the position use
this type, so let's move it into the independent files.

Differential Revision: https://phabricator.services.mozilla.com/D106218
2021-02-25 01:50:55 +00:00
Emilio Cobos Álvarez
97e19087ff Bug 1694141 - Implement :user-valid and :user-invalid. r=xidorn
And alias :-moz-ui-valid and :-moz-ui-invalid to them.

There are CSSWG resolutions for these for quite a while, and spec for
user-invalid.

Differential Revision: https://phabricator.services.mozilla.com/D105966
2021-02-24 01:11:40 +00:00
Emilio Cobos Álvarez
722a19defe Bug 1693886 - Increase custom property size limit a bit. r=xidorn
Differential Revision: https://phabricator.services.mozilla.com/D105978
2021-02-23 10:43:03 +00:00
Emilio Cobos Álvarez
89b87d3c09 Bug 1694129 - Hide :-moz-submit-invalid behind a pref. r=hiro
No other browser supports anything like this and we don't even have
internal users. Only uses of this I've found on the wild were just
resetting the box shadow internal styling we added in bug 582277 (and
since removed in bug 600151).

Differential Revision: https://phabricator.services.mozilla.com/D105955
2021-02-23 00:46:36 +00:00
Emily McDonough
59e9b91289 Bug 1454294 - Rename alias to aliases in Longhand and Shorthand r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D105810
2021-02-19 18:29:33 +00:00
Emily McDonough
052e5ac04a Bug 1693835 - Use a base class for Shorthand and Longhand r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D105797
2021-02-19 18:29:32 +00:00
Markus Stange
3c57a55638 Bug 1693196 - Remove -moz-mac-fullscreen-button value. r=emilio
Depends on D105379

Differential Revision: https://phabricator.services.mozilla.com/D105380
2021-02-17 01:40:04 +00:00
Emilio Cobos Álvarez
306af38824 No bug - remove useless semicolon that causes a rust nightly warning. DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D105387
2021-02-17 00:30:52 +00:00
Emilio Cobos Álvarez
c0d75d9d0e Bug 1690836 - Reduce the amount of code generated by UnparsedValues::substitute_variables. r=boris
This reduces the amount of assembly instructions generated by this
function from 18k+ to ~800.

This should make reasoning about its stack space usage sane, and should
fix the ASAN stack overflows, but also we should take this regardless,
because it's saner and makes reading it simpler.

I also think that the writing_mode shenanigans is fixing a bug (I think
before this, we'd pick the first physical value which mapped to any of
the properties, which is wrong), but I haven't bothered looking for a
test-case that fails before my patch. The relevant WPTs
(css/css-logical/animation*) still pass.

Differential Revision: https://phabricator.services.mozilla.com/D105342
2021-02-17 00:21:36 +00:00
Emilio Cobos Álvarez
109f0ef782 Bug 1690836 - Cache substituted values from shorthand properties during the cascade. r=xidorn
This brings the time down to 1.6ms from 4.8ms on the test-case in the
bug. This should be improvable too, but I think this is a nice
improvement for regular styling as well.

Differential Revision: https://phabricator.services.mozilla.com/D105187
2021-02-17 00:21:36 +00:00
Emilio Cobos Álvarez
db9bf3dfcc Bug 1690836 - Rustfmt cascade.rs. r=xidorn
Differential Revision: https://phabricator.services.mozilla.com/D105186
2021-02-17 00:21:35 +00:00
Emily McDonough
5a53c4b892 Bug 1692356 - Switch properties to use a bitfield to determine validity in rules. r=emilio
This doesn't use a full bitmap for every single rule type, as we only expect
that keyframe, page, and style rules will be checked.

Differential Revision: https://phabricator.services.mozilla.com/D104949
2021-02-16 21:36:57 +00:00
smolnar
76fb2f0549 Backed out 2 changesets (bug 1690836) for causing bc failures in browser_editAddressDialog. CLOSED TREE
Backed out changeset 834a980cbd49 (bug 1690836)
Backed out changeset 9455553189d2 (bug 1690836)
2021-02-16 17:00:05 +02:00
Emilio Cobos Álvarez
3f6e4504ad Bug 1690836 - Cache substituted values from shorthand properties during the cascade. r=xidorn
This brings the time down to 1.6ms from 4.8ms on the test-case in the
bug. This should be improvable too, but I think this is a nice
improvement for regular styling as well.

Differential Revision: https://phabricator.services.mozilla.com/D105187
2021-02-16 13:38:08 +00:00
Emilio Cobos Álvarez
5f48d0cc86 Bug 1690836 - Rustfmt cascade.rs. r=xidorn
Differential Revision: https://phabricator.services.mozilla.com/D105186
2021-02-16 13:38:08 +00:00
Pierre TALLOTTE
cc28f15d09 Bug 1688695 - Hide non-standard values of caption-side. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D104321
2021-02-12 15:45:48 +00:00
Emilio Cobos Álvarez
5a6d8228c8 Bug 1691858 - Minor cleanup of our @page rule setup. r=AlaskanEmily
Actually, there's not so much we can improve right now, in the sense
that:

 * We need the ::-moz-page-content pseudo-element to be able to set
 `display` on the page, since that's a style rule rather than a @page
 rule. We could get away without it.

 * Keeping the current code-path (slightly cleaned up) is less code, for
 now at least. We can have a separate code-path or what not that
 actually performs the @page rule selector-matching and what not if
 needed when we get to named pages or other page selectors. Selectors
 like :first should be pretty trivial to implement, actually.

We make some paged mode anon boxes non-inheriting anon boxes. This
allows us to share the styles and is generally nicer. They don't need to
inherit from anywhere.

We could remove the origin handling and don't look at UA rules or what
not, but it seems pretty harmless to do that.

We also fix the name of the pseudo-elements to match the capitalization.

Differential Revision: https://phabricator.services.mozilla.com/D104772
2021-02-12 15:42:38 +00:00
Butkovits Atila
2ec7c8684f Backed out changeset 80d28bc966b1 (bug 1691858) for causing failures on nsIFrame.cpp. CLOSED TREE 2021-02-12 00:10:31 +02:00
Emilio Cobos Álvarez
216b9a6afb Bug 1691858 - Minor cleanup of our @page rule setup. r=AlaskanEmily
Actually, there's not so much we can improve right now, in the sense
that:

 * We need the ::-moz-page-content pseudo-element to be able to set
 `display` on the page, since that's a style rule rather than a @page
 rule. We could get away without it.

 * Keeping the current code-path (slightly cleaned up) is less code, for
 now at least. We can have a separate code-path or what not that
 actually performs the @page rule selector-matching and what not if
 needed when we get to named pages or other page selectors. Selectors
 like :first should be pretty trivial to implement, actually.

We make some paged mode anon boxes non-inheriting anon boxes. This
allows us to share the styles and is generally nicer. They don't need to
inherit from anywhere.

We could remove the origin handling and don't look at UA rules or what
not, but it seems pretty harmless to do that.

We also fix the name of the pseudo-elements to match the capitalization.

Differential Revision: https://phabricator.services.mozilla.com/D104772
2021-02-11 20:52:25 +00:00
Emilio Cobos Álvarez
d96854eeb1 Bug 1691781 - Make Linux tab bar use the darker of the highlight / highlighttext colors. r=dao
Some GTK themes use very soft colors for selection backgrounds, using
darker colors for the text. This makes the tab and focus outlines in the
tab bar not have sufficient contrast with usual backgrounds.

I needed to do this for bug 1690778, but it seems worth doing it on the
front-end as well.

Differential Revision: https://phabricator.services.mozilla.com/D104547
2021-02-11 16:36:54 +00:00
Emilio Cobos Álvarez
1691b8a61c Bug 1682607 - Normalize NaN in some other font-related lengths etc. r=jfkthame,layout-reviewers
Depends on D104563

Differential Revision: https://phabricator.services.mozilla.com/D104565
2021-02-10 15:30:40 +00:00
Emilio Cobos Álvarez
fd47e3b3f3 Bug 1691652 - Normalize NaN to zero as a result of calc(). r=layout-reviewers,jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D104563
2021-02-10 15:30:40 +00:00
Emilio Cobos Álvarez
1c151367e0 Bug 1691287 - Remove the need for needs_context in the mako glue. r=boris
It's only used to disambiguate between the one-argument and the trait
version of Keyword::parse. Instead, just explicitly use the trait
version, so that we don't need to specify it.

Differential Revision: https://phabricator.services.mozilla.com/D104328
2021-02-09 00:35:51 +00:00
Dorel Luca
a211f9245e Backed out changeset 786ed9df69ff (bug 1691287) for build bustages in gecko/layout/style/ServoCSSPropList. CLOSED TREE 2021-02-09 02:22:59 +02:00
Emilio Cobos Álvarez
83ba40e9b3 Bug 1691287 - Remove the need for needs_context in the mako glue. r=boris
It's only used to disambiguate between the one-argument and the trait
version of Keyword::parse. Instead, just explicitly use the trait
version, so that we don't need to specify it.

Differential Revision: https://phabricator.services.mozilla.com/D104328
2021-02-08 19:43:10 +00:00
Emilio Cobos Álvarez
bebec20c7a Bug 1690706 - Move caption-side outside of mako. r=TYLin
Make it an enum class, etc.

Differential Revision: https://phabricator.services.mozilla.com/D103978
2021-02-07 12:33:45 +00:00
Emilio Cobos Álvarez
217ddbe75f Bug 1690225 - Remove focus-visible feature flag. r=edgar
This shipped in 85, we can remove the feature flag now. Keep
:-moz-focusring as an alias to :focus-visible at parse time.

Differential Revision: https://phabricator.services.mozilla.com/D103752
2021-02-02 23:45:25 +00:00
Mihai Alexandru Michis
ac5549ffd4 Backed out 2 changesets (bug 1690225) for causing multiple bc failures.
CLOSED TREE

Backed out changeset 381ee01f5034 (bug 1690225)
Backed out changeset cde1d10aae1c (bug 1690225)
2021-02-03 01:42:37 +02:00
Emilio Cobos Álvarez
df079e8f9d Bug 1690225 - Remove focus-visible feature flag. r=edgar
This shipped in 85, we can remove the feature flag now. Keep
:-moz-focusring as an alias to :focus-visible at parse time.

Differential Revision: https://phabricator.services.mozilla.com/D103752
2021-02-02 22:28:40 +00:00
Mats Palmgren
f6ef0ea044 Bug 1683748 - Support Grid/Flex/Table/Column layout for the rendered legend of a fieldset. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D101555
2021-01-30 13:47:10 +00:00
Dorel Luca
689a7c82d0 Backed out changeset 2d16e9e90401 (bug 1683748) for WPT failures in html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-grid-flex-multicol.html. CLOSED TREE 2021-01-29 22:07:09 +02:00