Commit graph

43809 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
c99d6adf01 style: Consider display: none elements as having current style for animation-only traversal.
This is mostly a band-aid, though it also serves sorta as an
optimization.

The issue here is basically bug 1393323. By re-cascading, right now we
can't come up with the right before-change style if CSSOM has mutated
the rules. We really need a better way to come up with the before-change
style, as the animation-only traversal is not really sustainable (nor
fast, for that matter...).

But this avoids crashing and prevents the regression easily, so let's do
that for now.

Differential Revision: https://phabricator.services.mozilla.com/D90700
2021-02-26 16:44:05 +01:00
Mats Palmgren
1f8c9aec88 style: [css-lists-3][css-pseudo-4] Add support for 'text-transform' on ::marker.
Differential Revision: https://phabricator.services.mozilla.com/D90329
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
f2e765296a style: Allow :is() and :where() to have better error recovery.
Adjust is-where-parsing.html to work with both the new and old behavior,
and add a test for the new behavior.

Depends on D90049

Differential Revision: https://phabricator.services.mozilla.com/D90050
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
83448b6889 style: Remove -moz-suppressed.
Per spec we shouldn't behave differently depending on how we blocked the
image/object/etc.

This may have made sense in the past when ad blockers were implemented
via nsIContentPolicy, but I think nowadays it doesn't make sense, and
showing fallback is preferred.

There's a couple extra cleanups we can do after this lands, like
removing HTMLImageElement.imageBlockingStatus and simplifying a bit that
code. But I'll do that in a separate bug.

Differential Revision: https://phabricator.services.mozilla.com/D89912
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
19c24075b4 style: Remove -moz-user-disabled.
We treat it exactly the same as -moz-broken. The pseudo-class is not
exposed to content, so I don't think we have a reason to keep it around.

Differential Revision: https://phabricator.services.mozilla.com/D89904
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
768db078ef style: Make appearance: button behave like auto.
As per https://github.com/w3c/csswg-drafts/issues/5174.

Differential Revision: https://phabricator.services.mozilla.com/D89119
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
ad0f63769c style: Speed up custom property diffing.
When entering or leaving fullscreen in youtube, we spend most of the
restyle time diffing custom properties, under IndexMap::eq.

Turns out that IndexMap equality is not order-aware, and thus you
actually need to make a hashmap lookup for each entry in the map, which
is unnecessarily inefficient.

Instead, just compare the iterators.

See https://github.com/bluss/indexmap/issues/153.

Differential Revision: https://phabricator.services.mozilla.com/D89434
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
cd7619dbf6 style: Make @font-face and @counter-style serialization closer other browsers and style rules.
Style rules serialize on one line and so should @font-face blocks.

Part of https://github.com/w3c/csswg-drafts/issues/4828.

Differential Revision: https://phabricator.services.mozilla.com/D89302
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
74c449c04c style: Rename ::file-chooser-button to ::file-selector-button, and enable it in all channels.
See https://github.com/w3c/csswg-drafts/issues/5049

Differential Revision: https://phabricator.services.mozilla.com/D88995
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
35716fd514 style: Only apply grayscale filter for printing on print preview.
Differential Revision: https://phabricator.services.mozilla.com/D88065
2021-02-26 16:44:05 +01:00
Masatoshi Kimura
16e0fd3e1f style: Replace :-moz-native-anonymous-no-specificity with :where(:-moz-native-anonymous).
Differential Revision: https://phabricator.services.mozilla.com/D88255
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
f2dfe7f08c style: Bail out when collecting invalidations for nested rules if any of them make us fully invalid.
Differential Revision: https://phabricator.services.mozilla.com/D87446
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
c200b67395 style: Make media queries and viewport units in print be evaluated against the default page size minus margins.
For that, move the default page margin computation to nsPresContext.

See https://github.com/w3c/csswg-drafts/issues/5437 as to why doing this
and other alternatives.

Differential Revision: https://phabricator.services.mozilla.com/D87311
2021-02-26 16:44:05 +01:00
Zeke Medley
9fd3d9a5e9 style: Support forced colors media feature.
Enabled behind layout.css.forced-colors.enabled pending finalization
of the spec:

<https://drafts.csswg.org/mediaqueries-5/#forced-colors>

Differential Revision: https://phabricator.services.mozilla.com/D87147
2021-02-26 16:44:05 +01:00
Sean Feng
cf496e4727 style: Make the document blocked by the topmost element in the top layer.
Spec: https://html.spec.whatwg.org/multipage/#blocked-by-a-modal-dialog

Depends on D86392

Differential Revision: https://phabricator.services.mozilla.com/D86227
2021-02-26 16:44:05 +01:00
Shinichi Morimoto
5d5d4f4429 style: Remove layout.css.offset-logical-properties.enabled.
Differential Revision: https://phabricator.services.mozilla.com/D87297
2021-02-26 16:44:05 +01:00
Zeke Medley
25de2a406e style: Update the prefers-contrast media query to use the new more/less keywords.
Per the resolution here:
https://github.com/w3c/csswg-drafts/issues/2943#issuecomment-672994920

Differential Revision: https://phabricator.services.mozilla.com/D86848
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
9d55296893 style: Fix two minor issues with scrollbar style caching.
Add -moz-inert and -moz-script-level to the set of internal properties
that aren't included in "all".

-moz-inert may need to be uncacheable in the future if we make it not
change the pointer-events computed value. Left a comment to that effect.

Differential Revision: https://phabricator.services.mozilla.com/D87115
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
73a9c57c3b style: Implement :-moz-any() as an alias of :is().
This is strictly better and more flexible, but can change specificity so
have a pref in case it causes trouble. I doubt it will though, the
specificity rules of :is() make more sense, and my gut feeling is that
:-moz-any is not very used on the wild.

Make it early-beta-or-earlier for now to minimize risk, once this is on
nightly for a bit we can enable it everywhere.

Differential Revision: https://phabricator.services.mozilla.com/D86696
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
2167a0c099 style: Remove layout.css.comparison-functions.enabled.
Shipped since FF75 (bug 1519519).

Differential Revision: https://phabricator.services.mozilla.com/D86693
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
5ba426ae6f style: Remove layout.css.is-where-selectors.enabled.
Shipped since 78 (bug 1632646).

Differential Revision: https://phabricator.services.mozilla.com/D86662
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
0d7922cb53 style: Remove layout.css.shadow-parts.enabled.
Shipped since 72 (bug 1559074).

Differential Revision: https://phabricator.services.mozilla.com/D86661
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
ca7e1ecfd8 style: Invalidate for CSSOM changes in a more fine-grained way.
Also, for changes in CSS declarations, like changing
cssRules[i].style.color or something, we end up avoiding a lot of the
work we were doing.

This page still trips us in the sense that they add a stylesheet, then
call getBoundingClientRect(), then insert more rules in the stylesheet,
which causes us to rebuild a lot of the cascade data.

We could try to detect appends to the last stylesheet on the list or
something I guess, and avoid rebuilding the cascade data in some cases.

Depends on D85615

Differential Revision: https://phabricator.services.mozilla.com/D85616
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
dfa715a8d8 style: Fix a silly mistake in which we'd prefer a local name / tag invalidation to an id invalidation.
ID invalidations should always win.

This also prefers invalidations deeper in the subtree to higher up.

Differential Revision: https://phabricator.services.mozilla.com/D85615
2021-02-26 16:44:05 +01:00
Nicolas Silva
1f36216b59 style: Update euclid in stylo.
Differential Revision: https://phabricator.services.mozilla.com/D85762
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
687fc20274 style: Use Overflow::is_scrollable in StyleAdjuster.
It was introduced in the overflow: clip work but this standalone
equivalent remained.

Differential Revision: https://phabricator.services.mozilla.com/D85778
2021-02-26 16:44:05 +01:00
Mats Palmgren
b29824bf75 style: Implement overflow:clip/visible combinations.
Differential Revision: https://phabricator.services.mozilla.com/D73717
2021-02-26 16:44:05 +01:00
Jeremy Ir
9bfcb3d741 style: Rename overflow:-moz-hidden-unscrollable to overflow:clip.
Differential Revision: https://phabricator.services.mozilla.com/D73716
2021-02-26 16:44:05 +01:00
Zeke Medley
8f89ebffec style: Add parsing for cross-fade from CSS Image Values and Replaced Content Module Level 4.
This is the first of what will likely be a couple patches for
cross-fade's implementation. Bug 546052 tracks it's complete
implementation.

Differential Revision: https://phabricator.services.mozilla.com/D81889
2021-02-26 16:44:05 +01:00
Brian Birtles
7c3d815f78 style: Make text-combine-upright not animatable.
Differential Revision: https://phabricator.services.mozilla.com/D84935
2021-02-26 16:44:05 +01:00
Alexander Surkov
32f92d18a8 style: implement -moz-inert CSS property.
-moz-inert CSS property reflects inert subtrees concept and can be used to implement HTML:dialog element and HTML:inert attribute

Differential Revision: https://phabricator.services.mozilla.com/D81701
2021-02-26 16:44:05 +01:00
Philipp Zech
cd8c07abac style: Convert writing-modes #defines to an enum class.
Differential Revision: https://phabricator.services.mozilla.com/D84016
2021-02-26 16:44:05 +01:00
Brian Birtles
ad22c7a369 style: Allow animations and transitions on ::marker
As per the following change to the spec:

6b3d7240b5

The additional failure annotation is added because we don't currently treat
text-combine-upright as non-animatable and this patch exposes the existing bug
(bug 1654195).

Differential Revision: https://phabricator.services.mozilla.com/D84308
2021-02-26 16:44:05 +01:00
Mats Palmgren
5382a99adb style: [css-grid] Make empty and all-whitespace strings in 'grid-template-areas' invalid.
Differential Revision: https://phabricator.services.mozilla.com/D84398
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
780beace00 style: Make stylesheet invalidation faster.
This fixes performance issues when there's a massive number of rules and
a massive DOM.

Instead of going through all rules for all the DOM, we now look stuff in
hashmaps.

Differential Revision: https://phabricator.services.mozilla.com/D83506
2021-02-26 16:44:05 +01:00
Cameron McCormack
5752e4a3a2 style: Don't use attribute selectors for determining if a select is a drop down or a list box.
Instead add a pseudo-class that does the expected size="" attribute parsing.

Removing the Gtk-specific rule setting the text color since it doesn't
seem to have any effect currently.

Differential Revision: https://phabricator.services.mozilla.com/D83448
2021-02-26 16:44:05 +01:00
Cameron McCormack
a2b016157e style: Hide range and number-input appearance values from content.
Forgot to follow up on these two remaining non-standard values that may have
been being used to reset a <meter> or <input type=number> back to its
original appearance, but which telemetry showed no usage of.

Differential Revision: https://phabricator.services.mozilla.com/D83598
2021-02-26 16:44:05 +01:00
Cameron McCormack
da503c4b48 style: Re-order Appearance values.
Differential Revision: https://phabricator.services.mozilla.com/D83437
2021-02-26 16:44:05 +01:00
Cameron McCormack
862b7d1249 style: Make appearance: button behave like auto on various elements.
Differential Revision: https://phabricator.services.mozilla.com/D83434
2021-02-26 16:44:05 +01:00
Cameron McCormack
f03883774b style: Avoid exposing appearance: range-thumb to content.
Differential Revision: https://phabricator.services.mozilla.com/D83433
2021-02-26 16:44:05 +01:00
Cameron McCormack
ab3791234e style: Mark appearance values that are only used internally as chrome-only.
Differential Revision: https://phabricator.services.mozilla.com/D83432
2021-02-26 16:44:05 +01:00
Cameron McCormack
21b6c69322 style: Remove appearance values not used by the browser or Web content.
Differential Revision: https://phabricator.services.mozilla.com/D83431
2021-02-26 16:44:05 +01:00
Cameron McCormack
8457666204 style: Change internal uses of -moz-appearance to appearance and -moz-default-appearance.
Uses of `-moz-appearance: none` are changed to `appearance: none`.

Uses of other values that are simply reverting the appearance back to
its default are changed to `appearance: auto`.

Uses of values in UA sheets that are defining the inherent appearance of
widgets are changed to:

  appearance: auto;
  -moz-default-appearance: <value>;

since those values are either no longer supported on (-moz-)appearance,
or are still supported but only in some limited form.

There are some uses of `-moz-appearance: textfield` on <input
type=number> elements that are renamed to `appearance: textfield`.

Differential Revision: https://phabricator.services.mozilla.com/D83430
2021-02-26 16:44:05 +01:00
Cameron McCormack
7ae2f8602e style: Defer to -moz-default-appearance when appearance is auto.
Differential Revision: https://phabricator.services.mozilla.com/D83429
2021-02-26 16:44:05 +01:00
Cameron McCormack
01efe3a459 style: Add unprefixed appearance property and make -moz-appearance and -webkit-appearance be aliases.
Differential Revision: https://phabricator.services.mozilla.com/D83428
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
9d3876bda0 style: Apply a grayscale filter to pages when monochrome.
This hooks the "monochrome" media query and co to the
nsIPrintSettings.printInColor setting.

This print setting we're using is not exposed in the print preview UI,
but you can test it setting the print.print_in_color preference to
"false", and then print preview will correctly show up greyscale'd.

Once this lands, the UI folks just have to use it as they see fit :)

I would've liked to add a proper rendering test, but the print reftests
check only whether the PDF text matches.

I could add a test to printpreview_helper.xhtml, but I'm refactoring
that file in bug 1648064 so I'd rather wait a bit and add it in a
separate bug. The test for the media feature should make sure that we
test that code path at least.

Differential Revision: https://phabricator.services.mozilla.com/D83552
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
1c8d4be6b2 style: Fix an off-by-one in the transition property iterator.
By the time we get to iterate over the longhands of a shorthand, we've
already advanced the range iterator, so we look at the next duration and
such, which causes this bug.

I'm seriously baffled that no existing test caught this when it
landed, neither in our internal test suite nor wpt...  :/

Differential Revision: https://phabricator.services.mozilla.com/D82396
2021-02-26 16:44:05 +01:00
Cameron McCormack
1f9d6ad5ef style: Remove unused function on Appearance.
Differential Revision: https://phabricator.services.mozilla.com/D82124
2021-02-26 16:44:05 +01:00
Cameron McCormack
87612b65c5 style: Remove unused StyleAppearance values.
The parsing of these values was disabled in bug 1554150.

Differential Revision: https://phabricator.services.mozilla.com/D82122
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
75b38efefd style: Have the destructor of CalcNode be never inline.
You tell me which other things need it... Copy-constructor? operator==?
and such?

Differential Revision: https://phabricator.services.mozilla.com/D73385
2021-02-26 16:44:05 +01:00