Commit graph

25052 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
a9c88729a8 style: Remove two useless mem::replace calls.
Differential Revision: https://phabricator.services.mozilla.com/D76884
2020-06-04 01:50:36 +02:00
Emilio Cobos Álvarez
3f25ac6b51 style: Remove the @-moz-document url-prefix() hack preference, enable it everywhere.
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-06-04 01:50:36 +02:00
Emilio Cobos Álvarez
ab79cc0e39 style: Implement the ::file-chooser-button pseudo-element.
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-06-04 01:50:36 +02:00
Emilio Cobos Álvarez
0c8865b8e1 style: Enable :is() and :where() in UA sheets.
This will allow us to clean them up.

Differential Revision: https://phabricator.services.mozilla.com/D76262
2020-06-04 01:50:36 +02:00
sefeng
54d869c111 style: Push/Pop dialog to top layer when needed.
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-06-04 01:50:36 +02:00
Mats Palmgren
1fcc00a11a style: Allow 'opacity' on ::first-letter/::first-line pseudos.
Differential Revision: https://phabricator.services.mozilla.com/D76387
2020-06-04 01:50:36 +02:00
Emilio Cobos Álvarez
224550f818 style: Derive parse for ShapeRadius.
Depends on D76331

Differential Revision: https://phabricator.services.mozilla.com/D76332
2020-06-04 01:50:36 +02:00
Emilio Cobos Álvarez
e259c53c62 style: Derive parse for TextOverflowSide.
Depends on D76330

Differential Revision: https://phabricator.services.mozilla.com/D76331
2020-06-04 01:50:36 +02:00
Emilio Cobos Álvarez
396338816d style: Clean up parsing of UnicodeRange.
Differential Revision: https://phabricator.services.mozilla.com/D76330
2020-06-04 01:50:36 +02:00
Emilio Cobos Álvarez
66185e81f6 style: Support field_bound in #[derive(Parse)].
Differential Revision: https://phabricator.services.mozilla.com/D76268
2020-06-04 01:50:36 +02:00
Boris Chiou
35546aea54 style: Use style::One for Integer to avoid implementing Mul.
Differential Revision: https://phabricator.services.mozilla.com/D76207
2020-06-04 01:50:36 +02:00
Boris Chiou
7022f451e1 style: Replace AspectRatio with computed::position::Ratio in media-queries.
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-06-04 01:50:36 +02:00
Boris Chiou
fc9321bb23 style: Let aspect-ratio (css-sizing-4) support 'auto | <ratio>'.
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-06-04 01:50:36 +02:00
Emilio Cobos Álvarez
bd23e05c47 style: Fix a no-longer valid assumption in pseudo-element matching / invalidation code.
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-06-04 01:50:36 +02:00
Emilio Cobos Álvarez
a40b2b610a style: Fix a case where we'd allow parsing functional :host incorrectly.
This is a missing check I should've introduced in bug 1632647.

Differential Revision: https://phabricator.services.mozilla.com/D76161
2020-06-04 01:50:36 +02:00
Emilio Cobos Álvarez
a457a2261b style: Fix parsing of :is() and :where() to account for constraints from parent selectors.
Differential Revision: https://phabricator.services.mozilla.com/D75856
2020-06-04 01:50:36 +02:00
Emilio Cobos Álvarez
7cbc963fc7 style: Make ::-moz-focus-outer a no-op, and remove it on Nightly.
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-06-04 01:50:36 +02:00
Emilio Cobos Álvarez
0c4bba6b52 style: Unprefix -moz-read-write / -moz-read-only.
And remove some duplicated tests from WPT.

Differential Revision: https://phabricator.services.mozilla.com/D75231
2020-06-04 01:50:36 +02:00
longsonr
4359aae44e style: Don't apply minimum font sizes to SVG text.
Differential Revision: https://phabricator.services.mozilla.com/D74581
2020-06-04 01:50:36 +02:00
Emilio Cobos Álvarez
ec6ecf7d21 style: 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-06-04 01:50:36 +02:00
Cameron McCormack
6bae0b99ca style: Gracefully handle errors creating shared memory UA style sheets.
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-06-04 01:50:36 +02:00
Philipp Zech
709c52fefb style: Convert style-font #defines to an enum class.
Differential Revision: https://phabricator.services.mozilla.com/D73728
2020-06-04 01:50:36 +02:00
Emily McDonough
a8c318a068 style: Use fill length rather than index to indicate a repeat(auto) in subgrid from Servo.
Differential Revision: https://phabricator.services.mozilla.com/D70066
2020-06-04 01:50:36 +02:00
Simon Giesecke
e6687c5fa8 style: Improve handling of copying arrays in layout/style/ and servo/.
Differential Revision: https://phabricator.services.mozilla.com/D72351
2020-06-04 01:50:36 +02:00
Simon Giesecke
735fdedbe9 style: Make NotNull move its member pointer where possible.
Differential Revision: https://phabricator.services.mozilla.com/D72827
2020-06-04 01:50:36 +02:00
Boris Chiou
6a7c0b7e9c style: Add ::marker when checking may_have_animations() during traversal.
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-06-04 01:50:36 +02:00
Emilio Cobos Álvarez
c67c9fdcee style: Only override to default color in high-contrast / forced-colors mode if inheriting from transparent.
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-06-04 01:50:36 +02:00
Mats Palmgren
6f58c66589 style: Implement style system support for Masonry layout.
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-06-04 01:50:36 +02:00
Emilio Cobos Álvarez
21d48e00cc style: Collect ancestor hashes from single-length :is and :where selector lists.
We can only collect hashes from single-length selectors, as described in
the comment.

Differential Revision: https://phabricator.services.mozilla.com/D71458
2020-06-04 01:50:36 +02:00
Emilio Cobos Álvarez
554fc4c6fe style: Handle disjoint selectors in the selector map.
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-06-04 01:50:36 +02:00
Emilio Cobos Álvarez
2b7fb519ba style: Optimize invalidation by scanning the rightmost compound inside :where() and :is() with the outer visitor.
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-06-04 01:50:36 +02:00
Emilio Cobos Álvarez
4b5de772c6 style: Make Invalidation work in terms of a dependency, not a selector.
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-06-04 01:50:36 +02:00
Emilio Cobos Álvarez
c1bc588c93 style: Keep track of nested dependencies for :where() and :is().
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-06-04 01:50:36 +02:00
Daniel Holbert
cd63d7b272 style: Remove pref for CSS Containment (layout.css.contain.enabled) r=AlaskanEmily
(Since we've been shipping with it default-enabled for a while now.)

See https://bugzilla.mozilla.org/show_bug.cgi?id=1466008#c9 through #c13 for
notes on the reftest.list change.

Differential Revision: https://phabricator.services.mozilla.com/D71861
2020-06-04 01:50:36 +02:00
atouchet
c99e8d1396 Update raqote and associated dependencies 2020-06-03 14:31:50 -07:00
bors-servo
7758d4ff62
Auto merge of #25432 - warren-fisher:HTMLConstructor, r=jdm
Extract some of CGClassConstructHook to utils.rs

<!-- Please describe your changes on the following line: -->

Moving some of the functionality from the massive tripled quoted string in CGClassConstructHook in `components/script/dom/bindings/codegen/CodegenRust.py` to `components/script/dom/bindings/utils.rs`. Must be made unsafe because of UnwrapObjectDynamic and other functions. Added imports as necessary as well, as well as cleaning up using test-tidy.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #25395 (GitHub issue number if applicable)

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because the issue says so

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
2020-06-03 16:59:32 -04:00
Kunal Mohan
3b5ede153d Update wgpu-core and wgpu-types 2020-06-04 01:19:13 +05:30
Warren Fisher
2da07ed164 Reduce code duplication. Move some of CodegenRust.py to htmlconstructor.rs 2020-06-03 15:13:34 -04:00
Kunal Mohan
1d4efb48ba Implement GPURenderPassEncoder
Add webidls for GPURenderPassEncoder and  GPURenderEncoderBase and
implement relevant methods.
2020-06-04 00:27:58 +05:30
bors-servo
ff3d5c5125
Auto merge of #26628 - gterzian:shutdown_workers, r=asajeffrey
Improve worker shutdown

<!-- Please describe your changes on the following line: -->
FIX #26548
FIX #25212

and also  a step towards https://github.com/servo/servo/issues/26502

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
2020-06-03 13:44:09 -04:00
Gregory Terzian
f4d258d674 remove messagaging and worker infra on workerscope exits 2020-06-03 12:32:45 +08:00
Gregory Terzian
6f34b52e39 properly shutdown dedicated workers when the owning scope shuts-down 2020-06-03 12:32:45 +08:00
Gregory Terzian
5174739244 turn serviceworker event-loop back on 2020-06-03 12:32:45 +08:00
Gregory Terzian
947fa8bbb7 add a control chan to workers, use to signal shutdown 2020-06-03 12:32:47 +08:00
bors-servo
ea491b4117
Auto merge of #26757 - jdm:unneeded-generic, r=SimonSapin
Remove unnecessary generics from low-level script code

This should remove one of the larger offenders from the cargo-llvm-lines output for the script crate.
2020-06-03 00:30:33 -04:00
bors-servo
f240140086
Auto merge of #26756 - servo:write_item, r=jdm
Move most of `SequenceWriter::write_item` to non-generic functions

The size of LLVM IR for the `style` crate is reduced by ~1.5% (27k lines out of 1.8M)

CC https://github.com/servo/servo/issues/26713
2020-06-02 22:27:05 -04:00
Josh Matthews
1feeb23514 dom: Extract non-generic code from Root::new. 2020-06-02 15:36:54 -04:00
Josh Matthews
96698779cc dom: Remove unnecessary generic from private_from_proto_check_static. 2020-06-02 15:36:54 -04:00
skrzyp1
ee6906443f reading unminified scripts from disk 2020-06-02 21:23:45 +02:00
Simon Sapin
4d0a9d8e91 Move most of SequenceWriter::write_item to non-generic functions
The size of LLVM IR for the `style` crate is reduced by ~1.5% (27k lines out of 1.8M)

CC https://github.com/servo/servo/issues/26713
2020-06-02 20:43:10 +02:00