Commit graph

344 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
762abbaf9f
style: Rustfmt recent changes. 2020-06-04 02:02:50 +02:00
Emilio Cobos Álvarez
4cf9aeeaf7 style: Manually tweak inlining in stateless pseudo selector matching.
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-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
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
atouchet
77f7fa552d More Cargo.toml updates 2020-05-30 18:18:57 -07:00
Emilio Cobos Álvarez
83ea321096 style: Implement parsing / selector-matching for :is() and :where().
This implements the easy / straight-forward parts of the :where / :is
selectors.

The biggest missing piece is to handle properly invalidation when there
are combinators present inside the :where. That's the hard part of this,
actually.

But this is probably worth landing in the interim. This fixes some of
the visitors that were easy to fix.

Differential Revision: https://phabricator.services.mozilla.com/D70788
2020-04-18 03:48:15 +02:00
Emilio Cobos Álvarez
f76acc84c6 style: Reformat recent changes. 2020-04-16 17:50:17 +02:00
Emilio Cobos Álvarez
846996ae7e style: Make :host::part work in the same shadow tree as the part.
Differential Revision: https://phabricator.services.mozilla.com/D68249
2020-04-16 16:35:07 +02:00
Emilio Cobos Álvarez
0514059618 style: Don't append the default namespace for featureless host selectors.
Per the spec it shouldn't match, and the front-end has been bitten by this
multiple times.

Differential Revision: https://phabricator.services.mozilla.com/D68213
2020-04-16 16:35:07 +02:00
Emilio Cobos Álvarez
635f5fbf1b style: Allow to export a shadow part under multiple names.
Other browsers allow this and the spec doesn't really disallow it, so fix it,
add a test and carry on.

Differential Revision: https://phabricator.services.mozilla.com/D65107
2020-04-16 16:35:07 +02:00
Simon Sapin
db4f27f361 Use the matches! macro from the standard library 2020-02-12 10:08:31 +01:00
Emilio Cobos Álvarez
151fe4a0d0
Bump selectors. 2019-12-18 14:36:47 +01:00
Emilio Cobos Álvarez
ef16c5844f Rustfmt recent changes. 2019-12-16 14:23:56 +01:00
Emilio Cobos Álvarez
ad61cae6b0 style: Update smallvec to 1.0.
Differential Revision: https://phabricator.services.mozilla.com/D56044
2019-12-16 14:23:56 +01:00
Cameron McCormack
6973317a58 style: Correctly style dark scrollbars in tree components.
We need to ensure the rules that override all properties for scrollbar
part elements only apply to those that are NAC (and so will be eligible
for NAC style sharing).  We have some uses of non-NAC <scrollbar>
elements that should continue to inherit properties from their parents.

To avoid any changes in rule matching order that come with changing specificity,
we add a new :-moz-native-anonymous-no-specificity pseudo-class.

While we're here, we note :-moz-native-anonymous-no-specificity (and the
regular :-moz-native-anonymous pseudo-class) as not needing style
sharing cache revalidation, as we never share NAC styles.

Differential Revision: https://phabricator.services.mozilla.com/D56154
2019-12-16 14:23:56 +01:00
Emilio Cobos Álvarez
baa9ac1903 style: Update derive_more.
Differential Revision: https://phabricator.services.mozilla.com/D56043
2019-12-16 14:23:56 +01:00
Emilio Cobos Álvarez
f8e924f86a
style: Don't specify minor version for cssparser. 2019-11-30 20:45:06 +01:00
Emilio Cobos Álvarez
e3009a4de9
style: Implement shadow part forwarding (minus invalidation).
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
2019-11-30 20:45:03 +01:00
bors-servo
b0f573b59f
Auto merge of #24877 - atouchet:master, r=jdm
Update some URLs

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

---
<!-- 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. -->
2019-11-27 02:27:19 -05:00
Alex Touchet
56922b70d5
Update some URLs 2019-11-26 17:12:49 -08:00
Emilio Cobos Álvarez
5f30ecc9b1 style: Remove some XBL code in the style system.
Differential Revision: https://phabricator.services.mozilla.com/D50554
2019-11-04 13:36:32 +01:00
Emilio Cobos Álvarez
7965ddefa6 style: Support multiple parts in ::part() selectors.
Differential Revision: https://phabricator.services.mozilla.com/D48753
2019-11-04 13:36:32 +01:00
Anthony Ramine
785a344e32 Update rand to 0.7 (fixes #24448) 2019-10-23 15:34:48 +02:00
Emilio Cobos Álvarez
9eaadc6860 style: Shutdown Servo's thread-pool in leak-checking builds, leak the atom table elsewhere.
Differential Revision: https://phabricator.services.mozilla.com/D44217
2019-09-12 22:34:16 +02:00
Emilio Cobos Álvarez
ed2e9ce482
Rustfmt and fix tidy on recent changes. 2019-06-25 13:11:31 +02:00
Emilio Cobos Álvarez
7139a4185a
style: Add code to make part rules affect the style of the elements.
I still haven't implemented each_part(), so this will do nothing yet.

The cascade order stuff is fishy, I know, and I'll fix in a followup if it's
fine with you. I moved the sorting of the rules to rule_collector, since it
seemed to me it was better that way that duplicating the code, and those
SelectorMap functions only have a single caller anyway.

Differential Revision: https://phabricator.services.mozilla.com/D32647
2019-06-25 13:11:29 +02:00
Emilio Cobos Álvarez
39de0a068e
style: Collect ::part() rules during CascadeData rebuilds.
Unlike for :host() or ::slotted(), or regular rules, we don't need a whole
SelectorMap<>, so gotta make the code a bit more generic.

Differential Revision: https://phabricator.services.mozilla.com/D32646
2019-06-25 13:11:28 +02:00
Emilio Cobos Álvarez
fac050325c
style: Add an extra flag to flag ::part() to selectors.
This grows the selector struct, but only in 32-bit, since in 64-bit we take
space from the alignment padding that we're paying due to having the size of the
slice as a word.

Differential Revision: https://phabricator.services.mozilla.com/D32645
2019-06-25 13:11:28 +02:00
bors-servo
49bf3ba05f
Auto merge of #23611 - atouchet:travis-url, r=jdm
Update Travis CI URLs

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

---
<!-- 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. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23611)
<!-- Reviewable:end -->
2019-06-24 08:46:08 -04:00
atouchet
5803ebf32a Update Travis CI URLs 2019-06-23 22:07:52 -07:00
Simon Sapin
1d38bc0419 Fix some new warnings 2019-06-22 14:59:09 +02:00
Josh Matthews
ad94791027 Upgrade phf codegen. 2019-06-13 11:08:16 -04:00
bors-servo
fe8aad7227
Auto merge of #23503 - emilio:gecko-sync, r=emilio
style: sync changes from mozilla-central

See each individual commit for details. This also cherry-picks #23463 with a few fixes that were needed in Gecko-only code.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23503)
<!-- Reviewable:end -->
2019-06-04 08:30:39 -04:00
bors-servo
faf3a183f3
Auto merge of #23499 - est31:unused_code_removal_3, r=jdm
Remove unused code (3/N)

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

Third PR in a series of PRs to remove unused/dead code from servo, powered by an (upcoming) tool of mine. Please take a look and tell me if you want to keep something.

* First PR: #23477
* Second PR: #23498

---
<!-- 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
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they only remove dead code

<!-- 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. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23499)
<!-- Reviewable:end -->
2019-06-04 02:27:29 -04:00
Evgeniy Reizner
6f1df517e0 style: Do not use borrowed types in the selectors::Element trait.
Closes #22972
Closes #23463
2019-06-04 01:04:03 -04:00
est31
e64de8d90a Remove unused code from a bunch of crates 2019-06-03 04:18:12 +02:00
Emilio Cobos Álvarez
43444db8a8 style: Cleanup selector-matching for nested pseudo-elements, match ::slotted correctly when there's no selector before it, and add tests.
D29542 fixed the bogus checks that was making nested pseudo-elements match
author rules. This adds tests and ends up being just a cleanup, though as it
turns out we it also fixes an issue with ::slotted() matched from
Element.matches.

Differential Revision: https://phabricator.services.mozilla.com/D27529
2019-05-29 16:14:26 +02:00
Emilio Cobos Álvarez
57874ae90a style: Rustfmt recent changes. 2019-05-07 12:56:02 +02:00
Emilio Cobos Álvarez
a23ad3be50 style: Add parsing support for ::part().
Disabled for now of course. This should be pretty uncontroversial I'd think.

Differential Revision: https://phabricator.services.mozilla.com/D28060
2019-05-07 12:55:44 +02:00
Emilio Cobos Álvarez
9f73576f6a style: Check iterator length in SelectorIter::is_featureless_host_selector.
I'm going to unconditionally generate the PseudoElement combinator, and this
causes issues since we'll put the raw `::pseudo` selectors in the host bucket,
which is obviously wrong.

Differential Revision: https://phabricator.services.mozilla.com/D27528
2019-05-07 12:55:43 +02:00
Emilio Cobos Álvarez
e5b5cd78a9 style: Remove support for XBL resources.
So much unsound code going away :-)

Differential Revision: https://phabricator.services.mozilla.com/D28380
2019-05-07 12:55:29 +02:00
Emilio Cobos Álvarez
52026f602b style: Don't allow to parse XUL tree pseudo-elements with a single colon.
Now that they're not exposed to the web we can remove this special case.

Differential Revision: https://phabricator.services.mozilla.com/D28071
2019-05-07 12:55:27 +02:00
Emilio Cobos Álvarez
09d497db3d style: Refactor the selector parser to make implementing ::part() easier.
::slotted() is already weird in the sense that it supports a pseudo-element
afterwards (so ::slotted(*)::before is valid for example).

::part() is weirder because you are supposed to allow stuff like
::part(foo):hover, ::part(foo):hover::before, etc.

In order to avoid making the already-complex parse_compound_selector more
complex, shuffle stuff so that we pass the progress of our current compound
selector around, and is the parsing code for each selector which decides whether
it's ok to parse at the given point.

Differential Revision: https://phabricator.services.mozilla.com/D27158
2019-05-07 12:55:23 +02:00
Emilio Cobos Álvarez
8c004c0858 style: Reformat recent changes. 2019-04-12 12:20:14 +02:00
Cameron McCormack
40248ae5fd style: Add derived ToShmem implementations.
Differential Revision: https://phabricator.services.mozilla.com/D17197
2019-04-12 12:19:52 +02:00
Simon Sapin
4464354e2e Reformat 2019-02-26 08:18:33 +01:00
Bobby Holley
af1bbd7b06 style: Derive more.
Differential Revision: https://phabricator.services.mozilla.com/D17029
2019-01-29 02:39:13 +01:00
Bobby Holley
137e735d9d style: Add a dependency on derive_more.
Differential Revision: https://phabricator.services.mozilla.com/D17028
2019-01-29 02:39:05 +01:00