Commit graph

44 commits

Author SHA1 Message Date
Nicolas Silva
239f2da9d9
style: Update to euclid 0.20.
Differential Revision: https://phabricator.services.mozilla.com/D38530
2019-07-23 22:54:08 +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
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
Pyfisch
9e92eb205a Reorder imports 2018-11-06 22:35:07 +01:00
chansuke
a2fc2ae517 Format component of style_traits 2018-09-08 13:28:13 +09:00
Emilio Cobos Álvarez
48ad41cfb5
Remove useless AsciiExt imports.
These warn with the next Nightly.
2018-03-27 10:30:02 +02:00
Anthony Ramine
1fa88b8c6a Simplify define_css_keyword_enum 2018-02-01 12:43:51 +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
Simon Sapin
954b2cc3d8
Allow unused imports for AsciiExt in style code.
See #19128, this part is cherry-picked so Gecko can build with rust nightly.
2017-11-09 12:43:23 +01:00
Bastien Orivel
29b4eec141 Bump bitflags to 1.0 in every servo crate 2017-10-30 23:36:06 +01:00
Emilio Cobos Álvarez
326f914018
style: Do not require to import ToCss in define_css_keyword_enum. 2017-10-24 14:30:51 +02: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
c0f8f15f39 Update to cssparser 0.22 (source location in error types) 2017-10-10 13:28:17 +02:00
Boris Chiou
535c1e3c6f Replace Au with CSSPixelLength in CalcLengthOrPercentage.
We replace Au with CSSPixelLength for the length part of
computed::CalcLengthOrPercentage. Therefore, it would be easier to use
CSSPixelLength for all other LengthOrPercentage{*} types.
2017-09-13 18:10:39 +08:00
Simon Sapin
37722838c6 Remove uses of write! in components/style_traits 2017-09-02 10:49:24 +02: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
Simon Sapin
eb98ae6e04 Update cssparser to 0.18
https://github.com/servo/rust-cssparser/pull/171
2017-07-24 11:39:12 +02:00
Anthony Ramine
6f4061d4ad Use generics for the filter property
This introduces an additional shadow type for drop-shadow().
2017-06-20 13:48:53 +02:00
Simon Sapin
316cd35767 Untry 2017-06-18 13:21:51 +02:00
Simon Sapin
b83afdedc8 Upgrade cssparser to 0.15 2017-06-16 15:05:46 +02:00
Nicolas Silva
8617320500 Bump euclid to 0.14. 2017-06-14 16:00:59 +02:00
Hiroyuki Ikezoe
7341574b66 Make AllowedLengthType.is_ok() returning true if parsing mode allows all numeric values.
Even if the type is NonNegative and the given value is a negative.
2017-06-14 09:51:54 +09:00
Josh Matthews
27ae1ef2e7 Thread ParseError return values through CSS parsing. 2017-06-09 16:46:25 -04:00
Anthony Ramine
af3ede418b Refactor BorderRadius and move it to the border modules
BorderRadius now parses itself reusing Rect<T>.
2017-05-28 14:36:37 +02:00
Anthony Ramine
90bae7f802 Derive HasViewportPercentage 🍷 2017-05-20 14:48:04 +02:00
Anthony Ramine
12d46e7d01 Rename AllowedNumericType to AllowedLengthType 2017-04-12 13:58:38 +02:00
Glenn Watson
30ff2f8f0d Introduce CSSPixel as a replacement for ViewportPx and PagePx. 2017-02-24 06:58:10 +10:00
Emilio Cobos Álvarez
82b6825a86
style: Document style_traits and deny missing docs on it. 2016-12-31 12:17:07 +01:00
UK992
93a103ba73 Reorder use statements 2016-09-09 04:55:19 +02:00
Martin Robinson
6259df5e2d Update to euclid 0.8 2016-08-12 03:12:06 +02:00
Ms2ger
cbfe77cee1 Move some unit type definitions to style_traits. 2016-07-11 12:14:27 +02:00
Simon Sapin
3822bb269c Change style_traits to a single "servo" Cargo feature
... instead of fine-grained heap_size and serde-serialization ones.
2016-06-22 15:48:52 +02:00
Simon Sapin
ea73c8efac Make it possible to build the style_traits crate with a stable compiler.
Testing this on CI to make sure we don’t regress it is blocked on #11806
2016-06-22 15:40:53 +02:00
Pawel Kondzior
db2e10a70f Report memory usage from LayoutThreadData Stylist [#7038] 2016-03-19 11:53:13 -07:00
Till Schneidereit
543703e3d8 Move Stylesheet loading and ownership from the layout task into HTML elements
Stylesheets for `HTMLLinkElement`s are now loaded by the resource task, triggered by the element in question. Stylesheets are owned by the elements they're associated with, which can be `HTMLStyleElement`, `HTMLLinkElement`, and `HTMLMetaElement` (for `<meta name="viewport">).

Additionally, the quirks mode stylesheet (just as the user and user agent stylesheets a couple of commits ago), is implemented as a lazy static, loaded once per process and shared between all documents.

This all has various nice consequences:
 - Stylesheet loading becomes a non-blocking operation.
 - Stylesheets are removed when the element they're associated with is removed from the document.
 - It'll be possible to implement the CSSOM APIs that require direct access to the stylesheets (i.e., ~ all of them).
 - Various subtle correctness issues are fixed.

One piece of interesting follow-up work would be to move parsing of external stylesheets to the resource task, too. Right now, it happens in the link element once loading is complete, so blocks the script task. Moving it to the resource task would probably be fairly straight-forward as it doesn't require access to any external state.
2015-11-07 18:11:29 +01:00
Till Schneidereit
068e6a8e9f Derive HeapSizeOf on more Stylesheet-related types
In preparation of storing `Stylesheet`s on nodes.
2015-11-07 16:19:23 +01:00
Till Schneidereit
f1b6c7cc99 Let Stylist compute and store viewport constraints when setting the device 2015-11-07 16:19:13 +01:00
João Oliveira
4a305d1e62 Add style_traits crate to improve crate separation,
closes #7353
2015-09-04 12:59:37 +01:00