Граф коммитов

30 Коммитов

Автор SHA1 Сообщение Дата
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
Emilio Cobos Álvarez 31a5bb70b4 Bug 1678881 - Avoid some allocations in selector serialization. r=xidorn
The allocations in display_to_css_identifier show up in the profiles of
bug 1675628.

Differential Revision: https://phabricator.services.mozilla.com/D97856
2020-11-22 01:02:22 +00:00
Emilio Cobos Álvarez a58560613e Bug 1643201 - Rustfmt recent changes.
Depends on D78203

Differential Revision: https://phabricator.services.mozilla.com/D78204
2020-06-04 00:35:41 +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
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 9c9a799887 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 74823e8b90 Bug 1559076 - Implement shadow part forwarding (minus invalidation). r=heycam
Some of the stuff, in particular inside GeckoBindings stuff should be
refactored to be less ugly and duplicate a bit less code, but the rest of the
code should be landable as is.

Some invalidation changes are already needed because we weren't matching with
the right shadow host during invalidation (which made existing ::part() tests
fail).

Pending invalidation work:

 * Making exportparts work right on the snapshots.
 * Invalidating parts from descendant hosts.

They're not very hard but I need to think how to best implement it:

 * Maybe get rid of ShadowRoot::mParts and just walk DOM descendants in the
   Shadow DOM.

 * Maybe implement a ElementHasExportPartsAttr much like HasPartAttr and use
   that to keep the list of elements.

 * Maybe invalidate :host and ::part() together in here[1]

 * Maybe something else.

Opinions?

[1]: https://searchfox.org/mozilla-central/rev/131338e5017bc0283d86fb73844407b9a2155c98/servo/components/style/invalidation/element/invalidator.rs#561

Differential Revision: https://phabricator.services.mozilla.com/D53730

--HG--
extra : moz-landing-system : lando
2019-11-21 10:32:32 +00:00
Emilio Cobos Álvarez 1f4fecfcd2 Bug 1511811 - Use https for the MPL license URL.
Cherry-picks https://github.com/servo/servo/pull/22198
2018-12-03 08:43:48 -05:00
shindli 6c6e4a960d Backed out 13 changesets (bug 1511811) for Btup bustages
Backed out changeset d71cde918f43 (bug 1511811)
Backed out changeset 0ae2634de8e1 (bug 1511811)
Backed out changeset 53d1f5ca4099 (bug 1511811)
Backed out changeset 5a08148928ef (bug 1511811)
Backed out changeset da7816ec50ef (bug 1511811)
Backed out changeset 5fe23889cccc (bug 1511811)
Backed out changeset 800bc60c75a7 (bug 1511811)
Backed out changeset 2392d8199cd0 (bug 1511811)
Backed out changeset 7bc486fbd195 (bug 1511811)
Backed out changeset d2c997426108 (bug 1511811)
Backed out changeset ddd573878432 (bug 1511811)
Backed out changeset 29c8ec1559a4 (bug 1511811)
Backed out changeset f5851346109d (bug 1511811)

--HG--
rename : third_party/rust/darling_core/src/macros_private.rs => third_party/rust/darling_core/src/macros.rs
2018-12-03 15:39:11 +02:00
Emilio Cobos Álvarez 6359ab5223 Bug 1511811 - Use https for the MPL license URL.
Cherry-picks https://github.com/servo/servo/pull/22198
2018-12-03 08:15:21 -05:00
Simon Sapin 4f9e2bcf36 Bug 1506391 - `cargo fix --edition`. r=emilio 2018-11-11 02:40:21 +01:00
Brindusan Cristian d67cc09fb1 Backed out 7 changesets (bug 1506391) for Btup bustages.
Backed out changeset b8216171101c (bug 1506391)
Backed out changeset 03d2309b737d (bug 1506391)
Backed out changeset 7b63f3149852 (bug 1506391)
Backed out changeset be88680421db (bug 1506391)
Backed out changeset 3840ce1ebfb0 (bug 1506391)
Backed out changeset 94517e21621c (bug 1506391)
Backed out changeset 32bde6f52a32 (bug 1506391)
2018-11-11 01:08:20 +02:00
Simon Sapin 10fbe4919b Bug 1506391 - `cargo fix --edition`. r=emilio 2018-11-10 21:14:05 +01:00
Emilio Cobos Álvarez 176fa6315c Bug 1505618 - Import formatting changes from servo/servo#22126. 2018-11-08 00:50:12 +01:00
Emilio Cobos Álvarez 21bd600cbd Bug 1497389 - Add a fast path for querySelector{,All} when we have classes or tags in the rightmost compound. r=heycam,firefox-style-system-reviewers
Before this patch we were only optimizing the case of a single selector, which
is fine, but not enough to catch ones like .foo .bar or so.

This patch allows us to optimize classes and tags in the rightmost compound,
while keeping the current optimization for #id selectors.

Need to profile this, but code-wise should be ready for review.

Differential Revision: https://phabricator.services.mozilla.com/D9351

--HG--
extra : moz-landing-system : lando
2018-10-29 12:04:25 +00:00
chansuke 41097313c4 Bug 1489862 - Format style component. r=emilio
This cherry-picks servo/servo#21652.
2018-09-09 17:03:19 +02:00
Emilio Cobos Álvarez 54c29475e9 Bug 1464428: Optimize QuerySelector in shadow trees. r=xidorn
Pretty much the same setup we have for document.

We have the awkwardness of having to check containing shadow manually for
ShadowRoot because it's not available in TNode (and making it available added a
bit more complexity that wasn't worth it IMO).

MozReview-Commit-ID: CqOh0sLHf6o
2018-05-28 14:30:34 +02:00
arthur.iakab 436cd55b31 Backed out changeset 8fb0fa2dca36 (bug 1464428) for Reftest crashes on a CLOSED TREE
--HG--
extra : amend_source : 023931e140119e040f5ca1c5b24bc4def5b0c215
2018-05-28 13:17:34 +03:00
Emilio Cobos Álvarez 2fe6f39529 Bug 1464428: Optimize QuerySelector in shadow trees. r=xidorn
Pretty much the same setup we have for document.

We have the awkwardness of having to check containing shadow manually for
ShadowRoot because it's not available in TNode (and making it available added a
bit more complexity that wasn't worth it IMO).

MozReview-Commit-ID: CqOh0sLHf6o
2018-05-28 10:08:35 +02:00
Bobby Holley b515de0c66 servo: Merge #20603 - Run rustfmt on selectors, servo_arc, and style (from bholley:rustfmt_style); r=Manishearth
Now that rustfmt is getting close to stable, and work on the style system has died down a bit, it seemed like an opportune time to auto-format the style crates.

The first commit disables import reordering, since tidy and rustfmt don't currently agree on the correct ordering. The second commit does a bunch of manual fixups such that the output of rustfmt passes tidy. The third commit runs rustfmt on the three aforementioned crate.

There are a few dozen warnings in the style crate about lines longer than 100 characters. It would be good to fix these, but I don't have time for that now.

Source-Repo: https://github.com/servo/servo
Source-Revision: 9a900ef019cd643bff961d7b20db6da69f3edb29

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 2b228d52a084bc832444ac686290840c4369f98d
2018-04-10 21:00:11 -04:00
Emilio Cobos Álvarez 2bc468b78a servo: Merge #20597 - style: Implement the non-functional :host selector (from emilio:host); r=xidorn
Kinda tricky because :host only matches rules on the shadow root where the rules
come from. So we need to be careful during invalidation and style sharing.

I didn't use the non_ts_pseudo_class_list bits because as soon as we implement
the :host(..) bits we're going to need to special-case it anyway.

The general schema is the following:

 * Rightmost featureless :host selectors are handled inserting them in the
   host_rules hashmap. Note that we only insert featureless stuff there. We
   could insert all of them and just filter during matching, but that's slightly
   annoying.

 * The other selectors, like non-featureless :host or what not, are added to the
   normal cascade data. This is harmless, since the shadow host rules are never
   matched against the host, so we know they'll just never match, and avoids
   adding more special-cases.

 * Featureless :host selectors to the left of a combinator are handled during
   matching, in the special-case of next_element_for_combinator in selectors.
   This prevents this from being more invasive, and keeps the usual fast path
   slim, but it's a bit hard to match the spec and the implementation.

   We could keep a copy of the SelectorIter instead in the matching context to
   make the handling of featureless-ness explicit in match_non_ts_pseudo_class,
   but we'd still need the special-case anyway, so I'm not fond of it.

 * We take advantage of one thing that makes this sound. As you may have
   noticed, if you had `root` element which is a ShadowRoot, and you matched
   something like `div:host` against it, using a MatchingContext with
   current_host == root, we'd incorrectly report a match. But this is impossible
   due to the following constraints:

    * Shadow root rules aren't matched against the host during styling (except
      these featureless selectors).

    * DOM APIs' current_host needs to be the _containing_ host, not the element
      itself if you're a Shadow host.

Bug: 992245
Reviewed-by: xidorn
MozReview-Commit-ID: KayYNfTXb5h
Source-Repo: https://github.com/servo/servo
Source-Revision: cb754b262747e7cab794411df55588f0f0b30b5e

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 2ebbb2578ff9dbadfe905ae501cd52bd61a9fe9a
2018-04-09 06:41:59 -04:00
Emilio Cobos Álvarez e47cb58448 servo: Merge #20117 - style: Somewhat miscelaneous cleanup (from emilio:misc-cleanup); r=nox
Source-Repo: https://github.com/servo/servo
Source-Revision: bbfca28a4f3770896955375d01f1c489b4632fd3

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : cca02ea2c160395889cfd6eb60c62a065d490300
2018-02-24 17:28:20 -05:00
Emilio Cobos Álvarez d09192fc43 servo: Merge #19721 - style: Support ::slotted better (from emilio:slotted); r=heycam
This allows to selector-match ::slotted, though we still don't parse it.

Bug: 1425834, 1424607, 1425755
Reviewed-by: heycam
MozReview-Commit-ID: ItELHkf2PMl
Source-Repo: https://github.com/servo/servo
Source-Revision: bb34b7f54aa85cde600c6d675360d03714cf1f8b

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : c92bde66c55c112ea537384d89a698ccb5eba798
2018-01-09 07:26:28 -06:00
Emilio Cobos Álvarez 8df4224bb5 servo: Merge #19113 - Reland #19108, because it was backed out before its Gecko-side patches could land (from emilio:qsa); r=xidorn,bz
Source-Repo: https://github.com/servo/servo
Source-Revision: 0f5325d0a7e9b3039c7d5b5f9de5cd2511207d9a

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 8500b96a1e505ebf173bc034275d77e4c9100b17
2017-11-04 05:36:17 -05:00
Sebastian Hengst 855fb4576a Backed out changeset dbd300f4d75b for build bustage. r=backout on a CLOSED TREE 2017-11-04 00:55:25 +01:00
Emilio Cobos Álvarez ab3406e598 servo: Merge #19108 - stylo: querySelector{,All} optimizations (from emilio:qsa); r=xidorn,bz
Bug: 1410624
Source-Repo: https://github.com/servo/servo
Source-Revision: a0cd781bdcdfa9db8b33632f0117e4d835ea1892

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 78c5ebda8da554c83af4c750bd5642fa17be8745
2017-11-03 14:27:34 -05:00
Emilio Cobos Álvarez c4d1881741 servo: Merge #19024 - Introduce style::dom::TDocument (from emilio:document); r=KiChjang
The secret plan is introducing a `get_elements_with_id` for use by `querySelector` / `querySelectorAll`.

But this allows also to make some code look a bit nicer.

Source-Repo: https://github.com/servo/servo
Source-Revision: ee4e371c73b265946146947bb16042360cb2fa41

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 2e34bb4dd31ca9cdafc0756d5366f4ad196f73bd
2017-10-26 07:51:21 -05:00
Emilio Cobos Álvarez 7a1b70c7ff servo: Merge #18988 - stylo: querySelector / querySelectorAll machinery (from emilio:qs); r=heycam
Bug: 1410624
Reviewed-by: heycam
Source-Repo: https://github.com/servo/servo
Source-Revision: eaba7ede232c9b556f22d67698eca5dc64ad4075

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 96a43c005a9eb406d51d9b1630d0b8198288ec59
2017-10-23 08:14:35 -05:00
Matt Brubeck aae71ef096 servo: Merge #18924 - Fix commonmark Markdown warnings in docs, part 1 (from mbrubeck:doc); r=Manishearth
Fixes warnings from rust-lang/rust#44229 when `--enable-commonmark` is passed to rustdoc.

This is mostly a global find-and-replace for bare URIs on lines by themselves in doc comments.

---

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because they are doc formatting changes only

Source-Repo: https://github.com/servo/servo
Source-Revision: 0e62a5829b7c29ae2667a21a439aff1e89201bf3

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : a3cb4b6d3c62220f728cae0ab3bc603fa403ba8b
2017-10-17 16:04:10 -05:00
Emilio Cobos Álvarez a0bc073f56 servo: Merge #18863 - style: Share code between Gecko and Servo for DOM APIs (from emilio:dom-api-dont-repeat); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: ba77ffed173b3a0ed934edead419ab3919cf5147

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 93328e68657eadd1f286d9c6c9df302cb945e03d
2017-10-13 10:48:57 -05:00