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

104 Коммитов

Автор SHA1 Сообщение Дата
Sylvestre Ledru 0dee1b74e8 Bug 1676513 - Fix clippy warnings r=emilio,webdriver-reviewers,whimboo,rhunt
Depends on D96634

Differential Revision: https://phabricator.services.mozilla.com/D96636
2020-11-17 12:02:22 +00:00
Zeke Medley dc8e84e2d4 Bug 546052 - Add parsing for cross-fade from CSS Image Values and Replaced Content Module Level 4 r=emilio
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
2020-07-31 16:11:38 +00:00
Emilio Cobos Álvarez a4fa8230aa Bug 1653339 - Teach style_derive's map_type_params about mapping self correctly. r=boris
Consider the following:

struct Complex<T> {
    something: T,
    #[compute(field_bound)]
    something_else: Generic<Self, T>,
}

That will generate:

impl<T> ToComputedValue for Complex<T>
where
    T: ToComputedValue,
    Generic<Self, T>: ToComputedValue<ComputedValue = Generic<Self, <T as ToComputedValue>::ComputedValue>>,
{
    // ...
}

That last clause is obviously incorrect. map_type_params correctly maps
the T, but it should know also about Self.

Ideally we could just do the same as for T and do:

    <Self as ToComputedValue>::ComputedValue

But that doesn't quite work, because we are in that implementation of
the trait, and the compiler rightfully complains about we don't yet
knowing the computed type. So we need to pass it explicitly, which is
simple enough, if a bit annoying.

Differential Revision: https://phabricator.services.mozilla.com/D83816
2020-07-16 18:51:21 +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 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
Emilio Cobos Álvarez 2be2ef7470 Bug 1630676 - Reformat recent changes, various build fixes, and tidy fixes. 2020-04-16 21:17:50 +02:00
Ciure Andrei aec781a233 Backed out 11 changesets (bug 1630676) for causing multiple failures CLOSED TREE
Backed out changeset c1fbe364b76c (bug 1630676)
Backed out changeset 629970c8f0b7 (bug 1630676)
Backed out changeset 1530f4a9aef2 (bug 1630676)
Backed out changeset a5b60fb5a0e1 (bug 1630676)
Backed out changeset a6e1a31c3e0d (bug 1630676)
Backed out changeset 4df9717e28f0 (bug 1630676)
Backed out changeset c76b0b0e503b (bug 1630676)
Backed out changeset 3c89aec57d0a (bug 1630676)
Backed out changeset 369cf504584d (bug 1630676)
Backed out changeset d7eff4acb616 (bug 1630676)
Backed out changeset 1d47c9354eeb (bug 1630676)
2020-04-16 21:45:51 +03:00
Emilio Cobos Álvarez 694173c605 Bug 1630676 - Reformat recent changes, various build fixes, and tidy fixes.
MANUAL PUSH: Review information for upstream patches would get lost otherwise.
2020-04-16 18:38:02 +02:00
Emilio Cobos Álvarez 96a8c38b0f Bug 1624298 - Ensure that derived types are right for optimized-away implementations. r=heycam
We have this optimization where, for non-generic structs, we generate just a
clone / move as the ToComputedValue / ToResolvedValue implementation.

This moves the optimization a bit further down, and refines it so that we still
generate all the relevant where clauses that make it sound, that is, that all
the ToComputedValue implementations of the fields return the same type.

Otherwise this wouldn't be sound and the type would need to become generic.

We add an escape hatch (no_field_bound) for fields that need to be cloned but
which don't implement the trait. This is right now only for the RefPtr<> in the
shared font-family list, and a piece of code in PaintWorklet which looks kinda
fishy, and probably should be fixed (but we don't ship it in Firefox and there's
a pre-existing FIXME for servo, so I punted on it for now).

The other thing this patch does is adding a bunch of ToComputedValue /
ToResolvedValue implementations that are trivial and were missing.

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

--HG--
extra : moz-landing-system : lando
2020-03-26 13:04:20 +00:00
Boris Chiou 9198a9a26e Bug 1614407 - Drop fallback attribute from animate and distance. r=emilio
Still keep the discriminant checks to avoid generating terrible code.

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

--HG--
extra : moz-landing-system : lando
2020-02-11 01:12:00 +00:00
Emilio Cobos Álvarez f98a6411b1 Bug 1613517 - Make rust generate better code for derive(Animate) and derive(ComputeSquaredDistance). r=heycam
See https://github.com/rust-lang/rust/issues/68867.

This technically changes the semantics of #[animate(fallback)] and such when
combined with #[animate(error)]. But no such combination exists and the new
semantics are perfectly reasonable as well, IMHO.

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

--HG--
extra : moz-landing-system : lando
2020-02-10 13:51:49 +00:00
Emilio Cobos Álvarez 5a6d7ed393 Bug 1587368 - Cherry-pick updates towards syn 1.
From: https://github.com/servo/servo/pull/24308
2019-10-09 13:35:48 +02:00
Bastien Orivel 337837b0ce Bug 1554347 - Update darling to 0.9. r=emilio 2019-05-25 04:14:18 +02:00
Emilio Cobos Álvarez 959628ed83 Bug 1549301 - Fix some warnings. 2019-05-06 10:37:50 +02:00
Emilio Cobos Álvarez 2fa8c1c1a2 Bug 1543837 - Reformat recent changes. 2019-04-12 00:25:37 +02:00
Emilio Cobos Álvarez 643d31e287 Bug 1542178 - Derive ToResolvedValue. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D26783
2019-04-10 17:16:30 +02:00
Emilio Cobos Álvarez 9a6b6a33d0 Bug 1542178 - Add derive code for a new ToResolvedValue trait, and a few trivial implementations. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D26782
2019-04-10 17:16:28 +02:00
Bogdan Tara 48a5da4868 Backed out 5 changesets (bug 1542178) for for test_flexbox_flex_shorthand.html failures CLOSED TREE
Backed out changeset 7fbaca51f682 (bug 1542178)
Backed out changeset e5a602010961 (bug 1542178)
Backed out changeset 152985a87c01 (bug 1542178)
Backed out changeset 7da7a8bc596a (bug 1542178)
Backed out changeset 0a7766ece186 (bug 1542178)
2019-04-10 17:54:45 +03:00
Emilio Cobos Álvarez 7ace3b8574 Bug 1542178 - Derive ToResolvedValue. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D26783

--HG--
extra : moz-landing-system : lando
2019-04-10 12:10:26 +00:00
Emilio Cobos Álvarez 67a4bcf46f Bug 1542178 - Add derive code for a new ToResolvedValue trait, and a few trivial implementations. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D26782

--HG--
extra : moz-landing-system : lando
2019-04-10 12:10:11 +00:00
Emilio Cobos Álvarez 8178d24334 Bug 1542179 - Handle the non-generic path earlier in the derive code. r=heycam
No need to build the match body if there are no generics. This should hopefully
save some work too.

Depends on D26289

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

--HG--
extra : moz-landing-system : lando
2019-04-09 01:48:18 +00:00
Emilio Cobos Álvarez 0082254050 Bug 1542179 - Share more code between ToAnimatedValue and ToComputedValue derive. r=heycam
I'm going to add a ToResolvedValue, and I don't want to add more copy-pasta.

This shouldn't change behavior.

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

--HG--
extra : moz-landing-system : lando
2019-04-09 09:37:26 +00:00
Cameron McCormack c1d7542bbd Bug 1474793 - Part 8: Factor out some of style_derive. r=emilio
Depends on D17187

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

--HG--
rename : servo/components/style_derive/Cargo.toml => servo/components/derive_common/Cargo.toml
rename : servo/components/style_derive/cg.rs => servo/components/derive_common/cg.rs
extra : moz-landing-system : lando
2019-03-30 00:16:01 +00:00
Emilio Cobos Álvarez 4a1b23092d Bug 1539326 - Fix servo build, and appease tidy checks. 2019-03-27 03:16:37 +01:00
Emilio Cobos Álvarez b3bd9a6099 Bug 1534726 - Reformat recent style system changes. 2019-03-12 19:01:28 +01:00
Emilio Cobos Álvarez 2ade1e5e73 Bug 1532134 - When deriving something with an output type, map preconditions as well. r=xidorn
Otherwise, deriving ToComputedValue and ToAnimatedValue in structs or enums with
other where clauses just doesn't work.

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

--HG--
extra : moz-landing-system : lando
2019-03-03 11:31:21 +00:00
Emilio Cobos Álvarez 5bea6a1b83 Bug 1532134 - Implement a version of #[css(skip_if)] that takes more context. r=xidorn
I called it contextual_skip_if, though better names welcome.

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

--HG--
extra : moz-landing-system : lando
2019-03-03 11:31:06 +00:00
Emilio Cobos Álvarez c59f73ed00 No bug - Rustfmt recent changes. r=whitespace-only 2019-02-23 21:13:15 -08:00
Emilio Cobos Álvarez bf84e7fd35 Bug 1528035 - Improve #[derive(Parse)]. r=xidorn
I want to do this so that I can get rid of Either<>. The reasons for getting rid
of either is multiple:

 * It doesn't generate as nice C++ code using cbindgen.
 * It isn't that nice to use either from Rust.
 * cbindgen has bugs with zero-sized types.

I started using this for ColorOrAuto and a few others, for now.

Differential Revision: https://phabricator.services.mozilla.com/D19844
2019-02-19 15:22:55 +01:00
Emilio Cobos Álvarez ecd9b9bc0f Bug 1519729 - Rustfmt recent changes. 2019-01-13 21:55:56 +01:00
Boris Chiou 6a58da235c Bug 1348519 - Part 1: Support field_bound on Animate. r=emilio
So we can derive Animate on more generic types.

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

--HG--
extra : moz-landing-system : lando
2019-01-12 02:19:04 +00:00
Bastien Orivel a0c3211f27 Bug 1518045 - Fix all clippy warnings in style_derive. r=emilio
This cherry-picks https://github.com/servo/servo/pull/22439.
2019-01-07 00:53:08 +01:00
Simon Sapin 81312a11be Bug 1518045 - Rustfmt has changed its default style. r=emilio
This cherry-picks the formatting parts of
https://github.com/servo/servo/pull/22385.
2019-01-07 00:53:06 +01:00
Xidorn Quan e9eae8a984 Bug 1516829 - Replace trim_{left,right}* with trim_{start,end}*. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D15496

--HG--
extra : moz-landing-system : lando
2018-12-30 08:37:19 +00:00
Bastien Orivel e648c4dee9 Bug 1511811 - Update syn and related dependencies. r=emilio 2018-12-07 09:00:20 -05: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
Bastien Orivel d9cbef23e2 Bug 1511811 - Update syn and related dependencies. r=emilio 2018-12-03 08:15:15 -05:00
Simon Sapin 4f9e2bcf36 Bug 1506391 - `cargo fix --edition`. r=emilio 2018-11-11 02:40:21 +01:00
Simon Sapin 271e888fb3 Bug 1506391 - Use 2018-style paths in code generated by style_derive. r=emilio 2018-11-11 02:40:17 +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
Simon Sapin 1f69b0da92 Bug 1506391 - Use 2018-style paths in code generated by style_derive. r=emilio 2018-11-10 21:13:12 +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 1f3f128954 Bug 1489676 - Teach ComputeSquaredDistance derive about #[animation(constant)]. r=xidorn
Differential Revision: https://phabricator.services.mozilla.com/D5337
2018-09-11 00:12:49 +02:00
Daniel Varga d34223c4cb Backed out changeset 85d1a0c3f60c (bug 1489676) for mochitest failures at dom/animation/test/mozilla/test_distance_of_path_function.html on a CLOSED TREE 2018-09-10 13:36:56 +03:00
Emilio Cobos Álvarez 911670e275 Bug 1489676 - Teach ComputeSquaredDistance derive about #[animation(constant)]. r=xidorn
Differential Revision: https://phabricator.services.mozilla.com/D5337

--HG--
extra : moz-landing-system : lando
2018-09-10 09:42:27 +00:00
chansuke 0f1a2fb4bc Bug 1489667 - Format component of style_derive. r=emilio
This cherry-picks servo/servo#21635
2018-09-08 00:22:21 +02:00
Emilio Cobos Álvarez 05d56c8f7e Bug 1470145: Better debugging for media-query related code and ua-cache. r=xidorn
MozReview-Commit-ID: 3XHAxK2BOTS
2018-06-22 02:33:44 +02:00