Commit graph

90 commits

Author SHA1 Message Date
Boris Chiou
40ede5bacb style: Use serde to serialize LengthPercentage and StyleRayFunction.
We need to pass these two types into the compositor, so we need a better
way to serialize these rust types. We use serde and bincode to
serialize/deserialize them, and use ByteBuf to pass the &[u8] data
through IPC. We define StyleVecU8 for FFI usage only.

Differential Revision: https://phabricator.services.mozilla.com/D50688
2019-11-04 13:36:32 +01:00
Patrick Walton
2f9c9cefdb WebRender units are no longer reexported. 2019-07-09 10:50:27 -04:00
violet
af8e8e6a34 style: Do not report error for unknown property if its known moz prefixed version is specified.
Suppose that `prop` is a property that we haven't supported yet, while its `-moz-prop`
version is already supported.

If an author specifies in a declaration block this property in its standard form
as well as multiple verdor specific forms, as long as `-moz-prop` is specified, we
shouldn't report error for unknown property `prop`. Because that's just noise.

Differential Revision: https://phabricator.services.mozilla.com/D31998
2019-05-29 16:14:23 +02:00
Emilio Cobos Álvarez
a109fbb7c8 style: Use ArcSlice for quotes.
This saves the intermediate allocation.

Differential Revision: https://phabricator.services.mozilla.com/D30546
2019-05-29 16:14:10 +02:00
Emilio Cobos Álvarez
5e4fdf647d style: Implement ArcSlice::default().
Share a singleton to avoid allocating for empty lists.

Differential Revision: https://phabricator.services.mozilla.com/D30543
2019-05-29 16:14:08 +02:00
Emilio Cobos Álvarez
0d5c4481b8 style: Introduce ArcSlice, a small wrapper over ThinArc but without an explicit header.
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
2019-05-10 12:43:04 +02:00
Emilio Cobos Álvarez
2ed2151b3d style: Move OwnedSlice to style_traits.
Differential Revision: https://phabricator.services.mozilla.com/D30126
2019-05-10 12:43:04 +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
Emilio Cobos Álvarez
92b58ade2f style: Move cursor to cbindgen.
The only reason it was on style_traits is so that they could use it from some
other crates, but Servo eventually ends up getting the value from an integer, so
may as well pass it around and do that in the end of the process anyway.

Differential Revision: https://phabricator.services.mozilla.com/D16557
2019-01-20 14:30:51 +01:00
Simon Sapin
be69f9c3e6 Rustfmt has changed its default style :/ 2018-12-28 13:17:47 +01:00
Jan Andre Ikenmeyer
1d6fe65401
Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
Simon Sapin
a15d33a10e cargo fix --edition 2018-11-10 17:47:28 +01:00
chansuke
a2fc2ae517 Format component of style_traits 2018-09-08 13:28:13 +09:00
Emilio Cobos Álvarez
2d2e84aad5
style: Error reporting fixes for media queries.
Do it so that we always try to evaluate the media expression and the modern
syntax last, so that the most specific error message comes up.

Bug: 1422225
Reviewed-by: xidorn
MozReview-Commit-ID: 2tqdAsWh6Kh
2018-07-01 00:04:48 +02:00
Emilio Cobos Álvarez
915c8725ae
style: Remove PropertyId::name.
It's only used for the error path in property parsing, so most of the time is
not useful.

Use the just-introduced NonCustomPropertyId::name to preserve the alias name,
which we were doing by passing the name around.

Bug: 1466645
Reviewed-by: xidorn
MozReview-Commit-ID: 46xxZKCoeBB
2018-06-12 12:15:12 -07:00
Emilio Cobos Álvarez
292f899631
style: Fix tidy issues and Servo build. 2018-04-29 05:09:43 +02:00
Xidorn Quan
26c3aeda97
style: Add collect_values function to SpecifiedValueInfo trait for collecting possible values.
This is the basic structure of the stuff. Following patches will fill
the gap between Gecko and Servo on value generating, and finally hook
it into InspectorUtils.

Bug: 1434130
Reviewed-by: emilio
MozReview-Commit-ID: KNLAfFBiY6e
2018-04-29 03:28:40 +02:00
Xidorn Quan
7fe7b2ffb1
style: Add a ValueInfo trait for exposing types needed by devtools.
Most of types just derive it using proc_macro directly. Some of value
types need manual impl.

In my current plan, this new trait will be used in bug 1434130 to expose
values as well.

Bug: 1455576
Reviewed-by: emilio
MozReview-Commit-ID: LI7fy45VkRw
2018-04-29 03:28:34 +02:00
Emilio Cobos Álvarez
fdc8405330
style: Trivially cleanup length parsing.
Mostly formatting signatures properly, but also removing useless functions and
stuff.
2018-02-16 16:04:19 +01:00
Anthony Ramine
cd8f96cc9e Change ToCss to take a CssWriter<W>
This more concrete wrapper type can write a prefix the very first time something
is written to it. This allows removing plenty of useless monomorphisations caused
by the former W/SequenceWriter<W> pair of types.
2018-01-23 10:41:42 +01:00
Bastien Orivel
29b4eec141 Bump bitflags to 1.0 in every servo crate 2017-10-30 23:36:06 +01:00
Gecko Backout
11c64178d8 Backed out changeset e64e659c077d: servo PR #18809 and revendor for reftest failures, e.g. in layout/reftests/bugs/392435-1.html. r=backout on a CLOSED TREE
Backs out https://github.com/servo/servo/pull/18809
2017-10-19 21:26:51 +00:00
Bastien Orivel
e8e2d0a4b2 Update bitflags to 1.0 in every servo crate
It still needs dependencies update to remove all the other bitflags
versions.
2017-10-19 15:01:17 +02:00
Nicholas Nethercote
4506f0d30c Replace all uses of the heapsize crate with malloc_size_of.
Servo currently uses `heapsize`, but Stylo/Gecko use `malloc_size_of`.
`malloc_size_of` is better -- it handles various cases that `heapsize` does not
-- so this patch changes Servo to use `malloc_size_of`.

This patch makes the following changes to the `malloc_size_of` crate.

- Adds `MallocSizeOf` trait implementations for numerous types, some built-in
  (e.g. `VecDeque`), some external and Servo-only (e.g. `string_cache`).

- Makes `enclosing_size_of_op` optional, because vanilla jemalloc doesn't
  support that operation.

- For `HashSet`/`HashMap`, falls back to a computed estimate when
  `enclosing_size_of_op` isn't available.

- Adds an extern "C" `malloc_size_of` function that does the actual heap
  measurement; this is based on the same functions from the `heapsize` crate.

This patch makes the following changes elsewhere.

- Converts all the uses of `heapsize` to instead use `malloc_size_of`.

- Disables the "heapsize"/"heap_size" feature for the external crates that
  provide it.

- Removes the `HeapSizeOf` implementation from `hashglobe`.

- Adds `ignore` annotations to a few `Rc`/`Arc`, because `malloc_size_of`
  doesn't derive those types, unlike `heapsize`.
2017-10-18 22:20:37 +11:00
Matt Brubeck
efc3683cc7 Fix commonmark Markdown warnings in docs, part 1
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.
2017-10-17 11:24:57 -07:00
Simon Sapin
0dae5c8d1f Remove unused feature flag 2017-10-12 12:10:57 +02:00
Simon Sapin
c36ac69d48 CSS parsing error types: flatten nested enums more still 2017-10-10 18:04:08 +02:00
Simon Sapin
1a041084ce CSS parsing error types: flatten nested enums some more 2017-10-10 13:28:31 +02:00
Simon Sapin
46ea99d54b CSS parsing error types: flatten nested enums somewhat 2017-10-10 13:28:30 +02:00
Simon Sapin
c0f8f15f39 Update to cssparser 0.22 (source location in error types) 2017-10-10 13:28:17 +02:00
Emilio Cobos Álvarez
a6eaa0812a
style: Share custom property declarations if they don't contain variable references. 2017-10-09 12:29:50 +02:00
Emilio Cobos Álvarez
e3c58df155
style: Remove UnsafeNode.
No longer needed since a while ago.
2017-09-25 01:58:52 +02:00
Nicholas Nethercote
c5aa2cb986 Measure PropertyDeclaration more thoroughly.
This patch replaces the handwritten MallocSizeOf implementation for
PropertyDeclaration with a derived one, which gives much more thorough
measurement.

This requires (a) deriving MallocSizeOf for a *lot* of additional types (most
of which already have `derive(HeapSizeOf)` in Servo builds), and (b)
implementing MallocSizeOf for a few more types in the `malloc_size_of` crate.

These changes would significantly improve the reporting coverage for gmail if
it weren't for the fact that SpecifiedUrl isn't measured due to a lack of
clarity about its fields; that can be fixed as a follow-up once bug 1397971 has
landed.
2017-09-14 13:18:03 +10:00
Fernando Jiménez Moreno
337a90329c stylo: Error reporting for unknown media features 2017-09-08 12:48:50 +02:00
Josh Matthews
6827a10893 Report more specific error for invalid filter properties (bug 1386900). 2017-09-06 10:06:07 -07:00
Emilio Cobos Álvarez
36ff89bd28
style: Remove HasViewportPercentage.
It's not needed since #18268
2017-08-29 23:51:21 +02:00
Clément DAVID
c5fe235112 order derivable traits lists
Ignoring :
 - **generated**.rs
 - python/tidy/servo_tidy_tests/rust_tidy.rs
2017-08-23 21:38:44 +02:00
Josh Matthews
4b736354c4 Report an error for invalid CSS color values (bug 1381143). 2017-07-31 16:49:53 -04:00
Alan Jeffrey
936dd3ef63 Speculatively evaluate paint functions during style. 2017-07-31 13:02:28 -05:00
Dzmitry Malyshau
101c426eb7 WR multi-document update 2017-07-28 22:28:11 -04:00
Gecko Backout
3f1af3e62f Backed out changeset c424ad1c5f94 for build failures a=backout CLOSED TREE
Backs out https://github.com/servo/servo/pull/17892
2017-07-28 23:21:03 +00:00
Dzmitry Malyshau
8c588e8c36 WR multi-document update 2017-07-28 14:22:36 -04:00
Simon Sapin
eb98ae6e04 Update cssparser to 0.18
https://github.com/servo/rust-cssparser/pull/171
2017-07-24 11:39:12 +02:00
Alan Jeffrey
caa3585219 Fixed scaling artefacts in paint worklets caused by zoom and hidpi. 2017-07-20 17:25:50 -05:00
Josh Matthews
bbf3280fef Store COW strings in CSS parser errors when possible. 2017-07-19 12:57:07 -04:00
Josh Matthews
94d631c1f4 Suppress CSS parser errors for vendor-prefixed properties. 2017-07-17 10:00:31 -04:00
Martin Robinson
e58e8ab42e Upgrade to the latest version of WebRender 2017-07-13 07:44:08 +10:00
Josh Matthews
0b43d0072c stylo: Update rust-cssparser; extract more specific error types when reporting (bug 1352669). 2017-07-10 20:46:12 -04:00
Gecko Backout
32269fa7cc Backed out changeset fec394734f83 (bug 17624) for build bustage a=backout CLOSED TREE
Backs out https://github.com/servo/servo/pull/17624
2017-07-06 21:58:15 +00:00
Josh Matthews
f5a3830ea2 stylo: Update rust-cssparser; extract more specific error types when reporting (bug 1352669). 2017-07-06 14:32:37 -04:00