Commit Graph

13292 Commits

Author SHA1 Message Date
Boris Chiou
57938596a7 Bug 1640036 - Update aspec-ratio syntax for HTML IMG mapped ratio. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D76942
2020-05-27 21:43:00 +00:00
Emilio Cobos Álvarez
99ed9d65e3 Bug 1640843 - Finer grained invalidation for attribute changes. r=heycam
This should help out quite a bit with uBO, which has lots of very
general attribute selectors. We invalidate per attribute name rather
than using a SelectorMap, which prevents matching for attribute
selectors that can't have changed.

The idea is that this should be generally cheaper, though there are
cases where this would be a slight pesimization. For example, if there's
an attribute selector like:

  my-specific-element[my-attribute] { /* ... */ }

And you change `my-attribute` in an element that isn't a
`my-specific-element`, before that the SelectorMap would've prevented us
from selector-matching completely. Now we'd still run selector-matching
for that (though the matching would be pretty cheap).

However I think this should speed up things generally, let's see what
the perf tests think before landing this though.

Differential Revision: https://phabricator.services.mozilla.com/D76825
2020-05-27 09:17:47 +00:00
Emilio Cobos Álvarez
9dd644c92d Bug 1640667 - Manually tweak inlining in stateless pseudo selector matching. r=boris
This addresses a minor regression in bloom-matching.html. The common
case here is that there's no selector to the right of the
pseudo-element, so keep that path inline, while keeping all other checks
out of line.

Differential Revision: https://phabricator.services.mozilla.com/D76793
2020-05-27 00:00:52 +00:00
Emilio Cobos Álvarez
7e76f582e7 Bug 1640985 - Remove two useless mem::replace calls. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D76884
2020-05-26 21:58:25 +00:00
Emilio Cobos Álvarez
31c487f429 Bug 1449753 - Remove the @-moz-document url-prefix() hack preference, enable it everywhere. r=jwatt
It doesn't seem like realistically we're going to be able to get rid of
this any time soon.

Differential Revision: https://phabricator.services.mozilla.com/D76809
2020-05-26 09:39:33 +00:00
Emilio Cobos Álvarez
b68f73c01a Bug 1635675 - Implement the ::file-chooser-button pseudo-element. r=jwatt
As per https://github.com/w3c/csswg-drafts/issues/5049.

Don't enable it unconditionally just yet, as the name may change.

I had to move some rules in forms.css because otherwise you get
specificity conflicts.

Differential Revision: https://phabricator.services.mozilla.com/D76214
2020-05-25 23:54:10 +00:00
Narcis Beleuzu
973d9eb6a0 Backed out changeset 82df6f70ec60 (bug 1635675) for lint failure on file-chooser-button-001.tentative.html . CLOSED TREE 2020-05-25 13:49:39 +03:00
Emilio Cobos Álvarez
a39a3a3807 Bug 1635675 - Implement the ::file-chooser-button pseudo-element. r=jwatt
As per https://github.com/w3c/csswg-drafts/issues/5049.

Don't enable it unconditionally just yet, as the name may change.

I had to move some rules in forms.css because otherwise you get
specificity conflicts.

Differential Revision: https://phabricator.services.mozilla.com/D76214
2020-05-21 12:27:54 +00:00
Emilio Cobos Álvarez
0b56353433 Bug 1639756 - Enable :is() and :where() in UA sheets. r=jwatt
This will allow us to clean them up.

Differential Revision: https://phabricator.services.mozilla.com/D76262
2020-05-21 12:10:34 +00:00
sefeng
67c1284c8c Bug 1637307 - Push/Pop dialog to top layer when needed r=smaug,emilio
This patch completes the top layer requirement for showModal()
Spec: https://html.spec.whatwg.org/multipage/interactive-elements.html#dom-dialog-showmodal

Differential Revision: https://phabricator.services.mozilla.com/D74922
2020-05-23 01:45:33 +00:00
Mats Palmgren
7d8f8a5007 Bug 1639664 - Allow 'opacity' on ::first-letter/::first-line pseudos. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D76387
2020-05-21 21:13:10 +00:00
Emilio Cobos Álvarez
f5e6a1beee Bug 1639905 - Derive parse for ShapeRadius. r=boris
Depends on D76331

Differential Revision: https://phabricator.services.mozilla.com/D76332
2020-05-21 18:43:12 +00:00
Emilio Cobos Álvarez
5b0a85dfc3 Bug 1639905 - Derive parse for TextOverflowSide. r=boris
Depends on D76330

Differential Revision: https://phabricator.services.mozilla.com/D76331
2020-05-21 18:44:19 +00:00
Emilio Cobos Álvarez
5786fe2012 Bug 1639905 - Clean up parsing of UnicodeRange. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D76330
2020-05-21 16:52:20 +00:00
Emilio Cobos Álvarez
18af4db46b Bug 1639689 - Support field_bound in #[derive(Parse)]. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D76268
2020-05-21 13:48:36 +00:00
Boris Chiou
5d461fdfee Bug 1635939 - Use style::One for Integer to avoid implementing Mul. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D76207
2020-05-20 21:13:37 +00:00
Boris Chiou
6b78a43a20 Bug 1635939 - Replace AspectRatio with computed::position::Ratio in media-queries. r=emilio
Also, we drop the pref, layout.css.aspect-ratio-number.enabled, becacuse
the spec of css-sizing-4 uses Number now.

Differential Revision: https://phabricator.services.mozilla.com/D75233
2020-05-20 21:13:35 +00:00
Boris Chiou
599c6939d9 Bug 1635939 - Let aspect-ratio (css-sizing-4) support 'auto | <ratio>'. r=emilio
In order to test its parsing and serialization, we expose it but protect
it behind a pref.

Besides, I would like to drop layout.css.aspect-ratio-number.enabled in
the next patch because the spec has been updated. It seems we don't have
to keep this pref and we should always use Number.

Differential Revision: https://phabricator.services.mozilla.com/D74955
2020-05-21 06:45:10 +00:00
Emilio Cobos Álvarez
b50a39c2d3 Bug 1639533 - Fix a no-longer valid assumption in pseudo-element matching / invalidation code. r=heycam
After bug 1632647, we can have pseudo-classes inside :not / :is /
:where, which the invalidation and matching code weren't handling.

Add a few tests for this stuff working as expected.

Differential Revision: https://phabricator.services.mozilla.com/D76160
2020-05-20 23:53:34 +00:00
Emilio Cobos Álvarez
a594bf82aa Bug 1639533 - Fix a case where we'd allow parsing functional :host incorrectly. r=heycam
This is a missing check I should've introduced in bug 1632647.

Differential Revision: https://phabricator.services.mozilla.com/D76161
2020-05-20 23:54:16 +00:00
Emilio Cobos Álvarez
6d165c571f Bug 1632647 - Fix parsing of :is() and :where() to account for constraints from parent selectors. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D75856
2020-05-20 12:16:22 +00:00
Emilio Cobos Álvarez
f0953195ce Bug 1636998 - Make ::-moz-focus-outer a no-op, and remove it on Nightly. r=jwatt
See https://bugzilla.mozilla.org/show_bug.cgi?id=932410#c2 for the
context for which this pseudo-element was added.

In the previous patch, I had to special-case range appearance because of
this pseudo-class, but that patch makes this pseudo-class completely
redundant, as now all form controls, themed and unthemed, display
outlines, unless the native theme displays a focus indicator on its own.

Remove the special case, and make ranges use outlines like everything
else rather than this bespoke pseudo-element.

Differential Revision: https://phabricator.services.mozilla.com/D74734
2020-05-18 10:54:16 +00:00
Csoregi Natalia
f6ee95862e Backed out changeset 62ad26fbfaf8 (bug 1636998) for reftest failures on 1174332-1.html. CLOSED TREE 2020-05-18 13:31:56 +03:00
Emilio Cobos Álvarez
36b46408b8 Bug 1636998 - Make ::-moz-focus-outer a no-op, and remove it on Nightly. r=jwatt
See https://bugzilla.mozilla.org/show_bug.cgi?id=932410#c2 for the
context for which this pseudo-element was added.

In the previous patch, I had to special-case range appearance because of
this pseudo-class, but that patch makes this pseudo-class completely
redundant, as now all form controls, themed and unthemed, display
outlines, unless the native theme displays a focus indicator on its own.

Remove the special case, and make ranges use outlines like everything
else rather than this bespoke pseudo-element.

Differential Revision: https://phabricator.services.mozilla.com/D74734
2020-05-18 07:59:32 +00:00
Emilio Cobos Álvarez
b9c1bf761c Bug 312971 - Unprefix -moz-read-write / -moz-read-only. r=edgar
And remove some duplicated tests from WPT.

Differential Revision: https://phabricator.services.mozilla.com/D75231
2020-05-14 16:46:08 +00:00
longsonr
5fa0ddbf8f Bug 935056 - Don't apply minimum font sizes to SVG text. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D74581
2020-05-13 09:10:54 +00:00
Noemi Erli
2f8e464584 Backed out changeset afdf4d60166d (bug 935056) for causing Android reftest failures CLOSED TREE 2020-05-13 11:33:57 +03:00
longsonr
8e8e982151 Bug 935056 - Don't apply minimum font sizes to SVG text. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D74581
2020-05-13 02:13:03 +00:00
Razvan Maries
3181a5f197 Backed out changeset 8eef199bbda9 (bug 935056) for perma failures at 935056-1.html. CLOSED TREE 2020-05-12 22:16:12 +03:00
longsonr
008322377b Bug 935056 - Don't apply minimum font sizes to SVG text. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D74581
2020-05-12 16:19:15 +00:00
Emilio Cobos Álvarez
eb40a0a258 Bug 1636357 - Clean up cascade rule iteration. r=nordzilla
The current API was pretty awkward as a result of two things:

 * Not being able to create empty iterators for smallbitvec.
 * We used to call the `F` function multiple times, but turns out that
   collecting the declarations in a SmallVec was a perf win.

So clean this up so that it looks more similar to other APIs, taking an
iterator directly.

This is a bit more code, but hopefully easier to understand (and also hopefully
easier to optimize).

The motivation for this work is that I plan to investigate rebasing / landing
https://github.com/servo/servo/pull/20151, and I don't want more instantiations
of apply_declarations and such.

Differential Revision: https://phabricator.services.mozilla.com/D74369
2020-05-11 21:33:31 +00:00
Cameron McCormack
3ccaaa0422 Bug 1621773 - Gracefully handle errors creating shared memory UA style sheets. r=emilio
We still panic in a debug build, so that developers can notice when they
need to add a new static atom after modifying UA sheets.

We also add telemetry to note when this happens, add an app note to a
crash report, in case any crash later on occurs, and re-up the existing,
expired shared memory sheet telemetry probes so we can look at them
again.

Differential Revision: https://phabricator.services.mozilla.com/D73188
2020-05-11 00:11:45 +00:00
Philipp Zech
46da657360 Bug 1635160 - Convert style-font #defines to an enum class. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D73728
2020-05-07 08:32:27 +00:00
Emily McDonough
1943cf3dcf Bug 1628041 - Use fill length rather than index to indicate a repeat(auto) in subgrid from Servo r=mats
Differential Revision: https://phabricator.services.mozilla.com/D70066
2020-05-06 19:35:03 +00:00
Simon Giesecke
40a765717d Bug 1626570 - Improve handling of copying arrays in layout/style/ and servo/. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D72351
2020-05-05 10:42:23 +00:00
Razvan Maries
c2b627950c Backed out 10 changesets (bug 1626570) for build bustages. CLOSED TREE
Backed out changeset a3f17d392234 (bug 1626570)
Backed out changeset 5247e1ddd5d6 (bug 1626570)
Backed out changeset c339fd44c9f8 (bug 1626570)
Backed out changeset 4c69a4c013b3 (bug 1626570)
Backed out changeset e85450d69351 (bug 1626570)
Backed out changeset 793f978248b3 (bug 1626570)
Backed out changeset 68b4c2418d83 (bug 1626570)
Backed out changeset 52d0911d4ad3 (bug 1626570)
Backed out changeset a7d4e3a59ee3 (bug 1626570)
Backed out changeset 6c06d397a5d2 (bug 1626570)
2020-05-05 13:37:08 +03:00
Simon Giesecke
e59bae7061 Bug 1626570 - Improve handling of copying arrays in layout/style/ and servo/. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D72351
2020-05-05 09:46:56 +00:00
Simon Giesecke
ddfa9fe2d2 Bug 1633719 - Make NotNull move its member pointer where possible. r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D72827
2020-05-05 09:09:01 +00:00
Boris Chiou
3ceed5d372 Bug 1633486 - Add ::marker when checking may_have_animations() during traversal. r=emilio
When unhidding a ::marker element, we construct its generated item, and
then call StyleNewSubtree() on this generated item. During traversal, we
may update any animation related values in Gecko_UpdateAnimations(), which
may update the base styles for animation properties.

The test case is an animation segment from "null" to "inital" value. We
replace the "null" value with the base style value for the specific animation
property, so we can do interpolation properly.
(e.g. opacity: "null => initial" becomes "1.0 => initial")
If we don't update the animation related values in
Gecko_UpdateAnimations after generating ::marker, we may do
interpolation from "null" to "initial", which causes a panic.

Differential Revision: https://phabricator.services.mozilla.com/D73408
2020-05-04 19:15:43 +00:00
Philipp Zech
e7364f83d0 Bug 1625745 - Convert counter-system #defines to enum classes. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D72554
2020-05-03 14:36:55 +00:00
Emilio Cobos Álvarez
b14f021e00 Bug 1632102 - Only override to default color in high-contrast / forced-colors mode if inheriting from transparent. r=morgan
That way elements inside links, form controls, etc have the right
contrast, even if the page overrides the color.

We can't do it when inheriting from transparent because we've already
forgotten about the "right" color to inherit, so the default color makes
sense. But that is a pretty unlikely edge case.

Differential Revision: https://phabricator.services.mozilla.com/D73069
2020-04-30 00:09:19 +00:00
Mats Palmgren
12bca02735 Bug 1607954 part 1 - [css-grid][css-align] Implement style system support for Masonry layout. r=emilio
This implements support for this CSS Masonry layout proposal:
https://github.com/w3c/csswg-drafts/issues/4650

I've intentionally left out a shorthand (place-tracks?) for now until
we have a draft CSS spec for this.

Differential Revision: https://phabricator.services.mozilla.com/D67061
2020-04-28 01:18:44 +00:00
Emilio Cobos Álvarez
b8fbb6ead5 Bug 1509418 - Collect ancestor hashes from single-length :is and :where selector lists. r=heycam,boris
We can only collect hashes from single-length selectors, as described in
the comment.

Differential Revision: https://phabricator.services.mozilla.com/D71458
2020-04-23 19:20:35 +00:00
Emilio Cobos Álvarez
f92b952261 Bug 1509418 - Handle disjoint selectors in the selector map. r=heycam,boris
This way, something like:

  *:where(.foo, .bar)

Will end up twice on the selector map, just as if you would've written
.foo, .bar.

But we're a bit careful to not be wasteful, so:

  .foo:where(div, span)

Will still end up using the .foo bucket.

It needs a bit of borrow-checker gymnastics to avoid cloning the entry
in the common path. It's a bit gross but not too terrible I think.

Differential Revision: https://phabricator.services.mozilla.com/D71457
2020-04-23 19:20:27 +00:00
Emilio Cobos Álvarez
7ff7bc8cc2 Bug 1509418 - Optimize invalidation by scanning the rightmost compound inside :where() and :is() with the outer visitor. r=heycam,boris
See the comment about why this is valuable. For a selector like:

    .foo:is(.bar) > .baz

Before this patch we'd generate an Dependency for .bar like this:

    Dependency {
        selector: .bar,
        offset: 0,
        parent: Some(Dependency {
            selector: .foo:is(.bar) > .baz,
            offset: 1, // Pointing to the `>` combinator.
            parent: None,
        }),
    }

After this patch we'd generate just:

    Dependency {
        selector: .foo:is(.bar) > .baz,
        offset: 1, // Pointing to the `>` combinator.
        parent: None,
    }

This is not only less memory but also less work. The reason for that is that,
before this patch, when .bar changes, we'd look the dependency, and see there's
a parent, and then scan that, so we'd match `.bar` two times, one for the
initial dependency, and one for .foo:is(.bar).

Instead, with this we'd only check `.foo:is(.bar)` once.

Differential Revision: https://phabricator.services.mozilla.com/D71423
2020-04-23 19:20:17 +00:00
Emilio Cobos Álvarez
2975274c6b Bug 1509418 - Make Invalidation work in terms of a dependency, not a selector. r=heycam,boris
That way we can look at the parent dependency as described in the previous
patch. An alternative would be to add a:

    parent_dependency: Option<&'a Dependency>

on construction to `Invalidation`, but this way seems slightly better to avoid
growing the struct. It's not even one more indirection because the selector is
contained directly in the Dependency struct.

Differential Revision: https://phabricator.services.mozilla.com/D71422
2020-04-23 19:20:10 +00:00
Emilio Cobos Álvarez
40a0b1a6d6 Bug 1509418 - Keep track of nested dependencies for :where() and :is(). r=heycam,boris
The tricky part of :is() and :where() is that they can have combinators inside,
so something like this is valid:

  foo:is(#bar > .baz) ~ taz

The current invalidation logic is based on the assumption that you can
represent a combinator as a (selector, offset) tuple, which are stored in the
Dependency struct. This assumption breaks with :is() and :where(), so we need
to make them be able to represent a combinator in an "inner" selector.

For this purpose, we add a `parent` dependency. With it, when invalidating
inside the `:is()` we can represent combinators inside as a stack.

The basic idea is that, for the example above, when an id of "bar" is added or
removed, we'd find a dependency like:

    Dependency {
        selector: #bar > .baz,
        offset: 1, // pointing to the `>` combinator
        parent: Some(Dependency {
            selector: foo:is(#bar > .baz) > taz,
            offset: 1, // Pointing to the `~` combinator.
            parent: None,
        })
    }

That way, we'd start matching at the element that changed, towards the right,
and if we find an element that matches .baz, instead of invalidating that
element, we'd look at the parent dependency, then double-check that the whole
left-hand-side of the selector (foo:is(#bar > .baz)) actually changed, and then
keep invalidating to the right using the parent dependency as usual.

This patch only builds the data structure and keeps the code compiling, the
actual invalidation work will come in a following patch.

Differential Revision: https://phabricator.services.mozilla.com/D71421
2020-04-23 19:20:03 +00:00
Cosmin Sabou
dacaa0fa0b Backed out 6 changesets (bug 1509418) for causing dt failures on several files. CLOSED TREE
Backed out changeset 0de514478e3c (bug 1509418)
Backed out changeset 859910d9fee2 (bug 1509418)
Backed out changeset 0abf5d38ab61 (bug 1509418)
Backed out changeset f572e241c626 (bug 1509418)
Backed out changeset 6398c8f1b4d4 (bug 1509418)
Backed out changeset ebef9346b5b1 (bug 1509418)
2020-04-24 08:38:05 +03:00
Emilio Cobos Álvarez
8165749eb7 Bug 1509418 - Collect ancestor hashes from single-length :is and :where selector lists. r=heycam,boris
We can only collect hashes from single-length selectors, as described in
the comment.

Differential Revision: https://phabricator.services.mozilla.com/D71458
2020-04-23 19:20:35 +00:00
Emilio Cobos Álvarez
bfd3683e13 Bug 1509418 - Handle disjoint selectors in the selector map. r=heycam,boris
This way, something like:

  *:where(.foo, .bar)

Will end up twice on the selector map, just as if you would've written
.foo, .bar.

But we're a bit careful to not be wasteful, so:

  .foo:where(div, span)

Will still end up using the .foo bucket.

It needs a bit of borrow-checker gymnastics to avoid cloning the entry
in the common path. It's a bit gross but not too terrible I think.

Differential Revision: https://phabricator.services.mozilla.com/D71457
2020-04-23 19:20:27 +00:00