Commit Graph

8594 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
4cc6d90c5f Bug 1550554 - Use an ArcSlice as the computed value representation of inherited list properties. r=heycam
This adds a bit of complexity, which I think will pay off in the end. Removals
incoming.

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

--HG--
extra : moz-landing-system : lando
2019-05-16 23:03:27 +00:00
Emilio Cobos Álvarez
9ed0e9ec6e Bug 1550554 - Implement ArcSlice::default(). r=heycam
Share a singleton to avoid allocating for empty lists.

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

--HG--
extra : moz-landing-system : lando
2019-05-16 23:22:04 +00:00
Emilio Cobos Álvarez
a109b9a835 Bug 1549593 - Use OwnedSlice in the specified and computed values of most vector properties. r=heycam
This is just a refactor in the right direction. Eventual goal is:

 * All inherited properties use ArcSlice<>.
 * All reset properties use OwnedSlice<> (or ThinVec<>).

No conversion happens at all, so we can remove all that glue, and also
compute_iter and co.

Of course there's work to do, but this is a step towards that.

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

--HG--
extra : moz-landing-system : lando
2019-05-16 23:21:37 +00:00
Ciure Andrei
00a73f5055 Backed out 17 changesets (bug 1550554, bug 1549593, bug 1551991, bug 1529002) for failing multiple Android tests and Windows 2012 bustages CLOSED TREE
Backed out changeset 3bb3fafa62e2 (bug 1551991)
Backed out changeset e12a979de502 (bug 1551991)
Backed out changeset d81e4aa6bf0c (bug 1551991)
Backed out changeset c354e61f2a34 (bug 1551991)
Backed out changeset 37fd602bebc2 (bug 1551991)
Backed out changeset 6c1f00cc30ca (bug 1551991)
Backed out changeset 8a7a0329bdc3 (bug 1551991)
Backed out changeset 86159475ddd3 (bug 1551991)
Backed out changeset 35f91a9ea82a (bug 1529002)
Backed out changeset 6798155e71dc (bug 1529002)
Backed out changeset b90c2cf5b8c5 (bug 1550554)
Backed out changeset 882ab9868c95 (bug 1550554)
Backed out changeset b28a48e2ed21 (bug 1550554)
Backed out changeset 2c31fe18eefd (bug 1550554)
Backed out changeset 57f2362aa538 (bug 1550554)
Backed out changeset 45f171b26e95 (bug 1550554)
Backed out changeset 2e4b263c9410 (bug 1549593)
2019-05-16 13:17:10 +03:00
Emilio Cobos Álvarez
ccf63230f7 Bug 1551991 - Remove nsCSSValue bindings. r=jwatt
Depends on D31320

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

--HG--
extra : moz-landing-system : lando
2019-05-16 14:31:52 +00:00
Emilio Cobos Álvarez
f7cde97a0b Bug 1551991 - Cleanup a bit the counter style code. r=jwatt
Use more compact types, and remove some manual implementations that can be
derived.

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

--HG--
extra : moz-landing-system : lando
2019-05-16 14:30:57 +00:00
Emilio Cobos Álvarez
5804e8efae Bug 1529002 - Use cbindgen to back CSS transforms. r=boris
This avoids the expensive conversion, and cleans up a bunch.

Further cleanup is possible, just not done yet to avoid growing the patch even
more.

Differential Revision: https://phabricator.services.mozilla.com/D30748
2019-05-16 16:24:38 +02:00
Emilio Cobos Álvarez
6634361c43 Bug 1550554 - Use OwnedSlice for will-change. r=heycam
We could use ArcSlice if wanted I guess, your call. Though will change is not
supposed to be used very frequently.

Differential Revision: https://phabricator.services.mozilla.com/D30548
2019-05-16 16:24:31 +02:00
Emilio Cobos Álvarez
0fe081bb39 Bug 1550554 - Add bindings for box shadows, and remove nsCSSShadowArray and friends. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D30547
2019-05-16 16:24:28 +02:00
Emilio Cobos Álvarez
49f795fd83 Bug 1550554 - Use ArcSlice for quotes. r=heycam
This saves the intermediate allocation.

Differential Revision: https://phabricator.services.mozilla.com/D30546
2019-05-16 16:24:24 +02:00
Emilio Cobos Álvarez
8c06775ab0 Bug 1550554 - Share computed and specified value representation of -moz-context-properties. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D30545
2019-05-16 16:24:20 +02:00
Emilio Cobos Álvarez
2ae3a428ec Bug 1550554 - Use an ArcSlice as the computed value representation of inherited list properties. r=heycam
This adds a bit of complexity, which I think will pay off in the end. Removals
incoming.

Differential Revision: https://phabricator.services.mozilla.com/D30544
2019-05-16 16:24:16 +02:00
Emilio Cobos Álvarez
00b4378adb Bug 1550554 - Implement ArcSlice::default(). r=heycam
Share a singleton to avoid allocating for empty lists.

Differential Revision: https://phabricator.services.mozilla.com/D30543
2019-05-16 16:24:13 +02:00
Emilio Cobos Álvarez
6d9623f982 Bug 1549593 - Use OwnedSlice in the specified and computed values of most vector properties. r=heycam
This is just a refactor in the right direction. Eventual goal is:

 * All inherited properties use ArcSlice<>.
 * All reset properties use OwnedSlice<> (or ThinVec<>).

No conversion happens at all, so we can remove all that glue, and also
compute_iter and co.

Of course there's work to do, but this is a step towards that.

Differential Revision: https://phabricator.services.mozilla.com/D30127
2019-05-16 16:24:09 +02:00
Coroiu Cristina
b4731ed54d Backed out 12 changesets (bug 1383650) for landing in the soft-freeze period
Backed out changeset 4316d55f87be (bug 1383650)
Backed out changeset 0118148f1534 (bug 1383650)
Backed out changeset 447c9248342b (bug 1383650)
Backed out changeset 6730776560c0 (bug 1383650)
Backed out changeset a7b8e6460fb8 (bug 1383650)
Backed out changeset e864696f6cf8 (bug 1383650)
Backed out changeset 2b003d678c58 (bug 1383650)
Backed out changeset 7bc3bff991c4 (bug 1383650)
Backed out changeset f1f7b4ad9547 (bug 1383650)
Backed out changeset 18b030b31660 (bug 1383650)
Backed out changeset 70e74dd6b45d (bug 1383650)
Backed out changeset 55a283e793df (bug 1383650)
2019-05-16 04:47:58 +03:00
violet
2dad80d965 Bug 1383650 - Add SVG geometry property support in CSS r=emilio
This patch adds SVG geometry properties to CSS, it doesn't deal with
how SVG handles them.

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

--HG--
extra : moz-landing-system : lando
2019-05-16 00:47:20 +00:00
violet
19283c2c6c Bug 1383650 - Support AllowQuirks::Always option in helpers.mako.rs r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D29936

--HG--
extra : moz-landing-system : lando
2019-05-16 00:44:51 +00:00
Emilio Cobos Álvarez
0869b9bd67 Bug 1550377 - Use ManuallyDrop for style structs. r=jwatt
We destroy them manually, so it's the right thing to do.

This allows us to not run destructors of any members of nsStyle*, which in turn allows us to:

 * Remove the hack that replaced all nsStrings for nsStringReprs.
 * Remove ns{,C}StringRepr (followup)
 * Add members with destructors to the style structs (you see where I'm going :)).

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

--HG--
extra : moz-landing-system : lando
2019-05-15 08:57:36 +00:00
Brindusan Cristian
b766f8ce38 Backed out changeset 2d0e8bded97a (bug 1550377) for build bustages on self.gecko. CLOSED TREE 2019-05-15 04:35:01 +03:00
Emilio Cobos Álvarez
6770308eb7 Bug 1550377 - Use ManuallyDrop for style structs. r=jwatt
We destroy them manually, so it's the right thing to do.

This allows us to not run destructors of any members of nsStyle*, which in turn allows us to:

 * Remove the hack that replaced all nsStrings for nsStringReprs.
 * Remove ns{,C}StringRepr (followup)
 * Add members with destructors to the style structs (you see where I'm going :)).

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

--HG--
extra : moz-landing-system : lando
2019-05-14 22:44:40 +00:00
Cameron McCormack
4b20fc81c7 Bug 1505908 - Add Gecko profiler labels for when the style threads are doing work. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D30869

--HG--
extra : moz-landing-system : lando
2019-05-14 05:00:45 +00:00
Emilio Cobos Álvarez
7b4c4a4912 No bug - rustfmt recent style system changes. 2019-05-09 20:18:08 +02:00
Emilio Cobos Álvarez
647b7c7078 No bug - Fix Servo build. 2019-05-09 20:18:05 +02:00
Emilio Cobos Álvarez
f65bcfba56 Bug 1549559 - Add bindings for ArcSlice and ThinArc, and use them to reduce copies of SVG path data. r=heycam
As I said over bug 1549593, the eventual goal is to use ArcSlice in all
inherited properties. But this seemed like a good first candidate that doesn't
require me to move around a lot more code, since we were already using cbindgen
for the path commands.

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

--HG--
extra : moz-landing-system : lando
2019-05-09 12:43:19 +00:00
Emilio Cobos Álvarez
f59bb7ae91 Bug 1549559 - Introduce ArcSlice, a small wrapper over ThinArc but without an explicit header. r=heycam
We could make the header PhantomData or something, but then we wouldn't be able
to bind to C++, since C++ doesn't have ZSTs. So add a canary instead to add a
runtime check of stuff being sane.

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

--HG--
extra : moz-landing-system : lando
2019-05-09 10:53:50 +00:00
Emilio Cobos Álvarez
1de789c618 Bug 1549593 - Move OwnedSlice to style_traits. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D30126

--HG--
rename : servo/components/style/owned_slice.rs => servo/components/style_traits/owned_slice.rs
extra : moz-landing-system : lando
2019-05-09 10:49:50 +00:00
Emilio Cobos Álvarez
38065025d9 Bug 1548691 - Use the owned slice type for basic shape polygon coordinates. r=TYLin,heycam
This enables destructors for tagged unions in cbindgen, implemented in:

 * https://github.com/eqrion/cbindgen/pull/333

Which allow us to properly generate a destructor for the cbindgen-generated
StyleBasicShape (which now contains an OwnedSlice).

For now, we still use the glue code to go from Box<BasicShape> to
UniquePtr<BasicShape>. But that will change in the future when we generate even
more stuff and remove all the glue.

I could add support for copy-constructor generation to cbindgen for tagged
enums, but I'm not sure if it'll end up being needed, and copy-constructing
unions in C++ is always very tricky.

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

--HG--
extra : moz-landing-system : lando
2019-05-09 11:24:57 +00:00
Emilio Cobos Álvarez
7d9dca2244 Bug 1548691 - Add an owned slice type which cbindgen can understand. r=heycam
Passing these by value won't be ok of course, but that's fine.

I plan to combine this with https://github.com/eqrion/cbindgen/pull/333 to
actually be able to share representation for ~all the things, this is just the
first bit.

Box<T>, Atom and Arc<T> will be much easier since cbindgen can understand them
without issues.

It's boxed slices the only ones I should need something like this. I could avoid
it if I rely on Rust's internal representation, which we can per [1], but then I
need to teach cbindgen all about slices, which is generally hard, I think.

[1]: https://github.com/rust-lang/unsafe-code-guidelines/blob/master/reference/src/layout/pointers.md

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

--HG--
extra : moz-landing-system : lando
2019-05-09 10:49:22 +00:00
Emilio Cobos Álvarez
936ebd1f3a Bug 1550389 - Remove unnecessary mut usage. 2019-05-09 05:45:10 +02:00
Cameron McCormack
f5b7d1380b Bug 866102 - Implement -webkit-line-clamp. r=mats,emilio,dholbert
Differential Revision: https://phabricator.services.mozilla.com/D20115

--HG--
extra : moz-landing-system : lando
2019-05-09 02:32:30 +00:00
Emilio Cobos Álvarez
e3b9d16857 Bug 1549969 - Fix an assertion that doesn't account for alignment padding. r=bholley
I'm hitting this when trying to add bindings for box shadows, which are 32-bit
aligned.

Depends on D30352

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

--HG--
extra : moz-landing-system : lando
2019-05-08 18:03:37 +00:00
Emilio Cobos Álvarez
fcca6294b1 Bug 1549969 - Don't panic when creating empty ThinArcs. r=bholley
The change from [T; 1] to [T; 0] shouldn't change behavior since they have the
right alignment and we never poke at that particular array, but feels more
correct to avoid creating types that point to uninitialized data or outside of
their allocation, now that we allow empty slices.

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

--HG--
extra : moz-landing-system : lando
2019-05-08 17:54:25 +00:00
Emilio Cobos Álvarez
17b3f8d8e7 Bug 1538101 - Don't report errors for properties for which we've parsed another value in the same declaration block. r=jdm
I thought a bit about how to test it and it's not particularly great.
test_css_parse_error_smoketest.html is great to assert that something _gets_
reported, but not that it doesn't :)

Differential Revision: https://phabricator.services.mozilla.com/D30201
2019-05-08 18:14:18 +02:00
Dorel Luca
6d69b04fd4 Backed out changeset eee17e1b0435 (bug 1538101) for Browser-chrome and DT failures. CLOSED TREE 2019-05-08 18:21:30 +03:00
Emilio Cobos Álvarez
1b7101750d Bug 1538101 - Don't report errors for properties for which we've parsed another value in the same declaration block. r=jdm
I thought a bit about how to test it and it's not particularly great.
test_css_parse_error_smoketest.html is great to assert that something _gets_
reported, but not that it doesn't :)

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

--HG--
extra : moz-landing-system : lando
2019-05-08 12:44:46 +00:00
Emilio Cobos Álvarez
c8d19bedcd Bug 1538101 - Centralize a bit invalid value error reporting. r=jdm
Also, buffer the errors, since we're going to want to look at the whole
declaration block to skip reporting them.

This shouldn't change behavior, just moves some work to the caller, and defers a
bit the work so that it happens only when error reporting is enabled.

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

--HG--
extra : moz-landing-system : lando
2019-05-08 12:44:36 +00:00
Emilio Cobos Álvarez
259aa236fd Bug 1549596 - Use PhantomData<T> in servo_arc. r=bholley
See https://github.com/rust-lang/rust/pull/60594#issuecomment-489966933

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

--HG--
extra : moz-landing-system : lando
2019-05-08 08:01:01 +00:00
Emilio Cobos Álvarez
0789d1d403 Bug 1549596 - ThinArc should use NonNull. r=bholley
If only for parallelism with Arc<>.

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

--HG--
extra : moz-landing-system : lando
2019-05-07 03:16:21 +00:00
Emilio Cobos Álvarez
e736bff42d No bug - Cherry-pick some Servo removals from malloc_size_of. r=npotb 2019-05-07 12:59:40 +02:00
Oana Pop Rus
251b4874dc Merge mozilla-central to autoland. a=merge CLOSED TREE 2019-05-07 01:33:06 +03:00
Oana Pop Rus
65399363fb Merge inbound to mozilla-central. a=merge 2019-05-07 00:45:24 +03:00
Emilio Cobos Álvarez
ab4877cc37 Bug 1549589 - scroll-snap-coordinate shouldn't use NotInitial. r=hiro
The initial value for this is indeed `none` (and thus empty). The Rust code was
confused.

This property is disabled by default these days, and I think the
get_initial_value() function, which is what could get confused, is not called
for this property, so I think this shouldn't be observable.

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

--HG--
extra : moz-landing-system : lando
2019-05-06 21:31:16 +00:00
Emilio Cobos Álvarez
656a46330b Bug 1549301 - Fix Servo build. 2019-05-06 10:37:55 +02:00
Emilio Cobos Álvarez
94cde8dcec Bug 1549301 - Rustfmt recent style system changes. 2019-05-06 10:37:53 +02:00
Emilio Cobos Álvarez
c78d89f5d6 Bug 1549301 - Import style system changes for Servo's Shadow DOM support. 2019-05-06 10:37:52 +02:00
Emilio Cobos Álvarez
959628ed83 Bug 1549301 - Fix some warnings. 2019-05-06 10:37:50 +02:00
Ian Moody
a465f73789 Bug 1549301 - Remove :-servo-case-sensitive-type-attr().
No longer needed now that the case-sensitive flag for attributes selectors is
supported.
Update user-agent CSS sheet to use the standard flag.

Fixes #23227

This cherry-picks https://github.com/servo/servo/pull/23228.
2019-05-06 10:37:45 +02:00
Jeremy Ir
79895773c2 Bug 1548341 - Convert NS_STYLE_BORDER to an enum class in nsStyleConsts.h. r=dholbert
Converting the NS_STYLE_BORDER definitions in to enumerated classes as
per bug 1277133.

The original constants broke the convention used by the rest of the
definitions as the CSS property being described is `border-collapse`,
so corrections were made with the migration to the enumerated class.

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

--HG--
extra : moz-landing-system : lando
2019-05-05 23:39:27 +00:00
Mats Palmgren
af98466fc0 Bug 1549223 - [css-grid-2] Remove single keyword 'subgrid' as a valid value for the 'grid' and 'grid-template' shorthands. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D29974

--HG--
extra : rebase_source : 4f76c70ab6335cd41e23bd692c0a4ea432b525e9
2019-05-06 02:43:50 +02:00
Masayuki Nakano
8a9d031686 Bug 253889 - part 3: Move all remaining members of nsIPresShell to mozilla::PresShell r=emilio
Additionally, this sorts out the order of member variables for minimizing the
instance size.

And also this changes `enum RenderFlags` to `enum class RenderingStateFlags`.

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

--HG--
extra : moz-landing-system : lando
2019-05-01 02:28:25 +00:00