Commit graph

72 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
69ddb9501b
style: Remove some uses of unused unsafe. 2017-11-15 13:26:24 +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
Nicholas Nethercote
5866b820e0 Introduce nsStaticAtom.
It's a sub-class of nsAtom, useful for cases where you know you are dealing
exclusively with static atoms. The nice thing about it is that you can use
raw nsStaticAtom pointers instead of RefPtr<>. (In fact, the AddRef/Release
implementations ensure that we'll crash if we use RefPtr<nsStaticAtom>.)
2017-10-27 20:33:40 +11:00
Nicholas Nethercote
a26d25db12 Rename size_of_is_0! as malloc_size_of_is_0!.
The new name makes it clearer that it comes from the `malloc_size_of`
crate.
2017-10-18 14:26:56 +11:00
Nicholas Nethercote
7628c1236a Rename nsIAtom as nsAtom.
Bug 1400459 devirtualized nsIAtom so that it is no longer a subclass of
nsISupports. This means that nsAtom is now a better name for it than
nsIAtom.
2017-10-09 09:27:11 +11:00
Michael Layzell
c1c98659b9 Update ns[C]String::from -> ns[C]Str::from where possible 2017-09-26 11:03:35 -04: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
Nicholas Nethercote
32548e5312 Overhaul MallocSizeOf and related things.
This patch makes the MallocSizeOf stuff in Stylo work more like the HeapSizeOf
stuff already in Servo, except better. In particular, it adds deriving support
for MallocSizeOf, which will make it easier to improve coverage.

The patch does the following.

- Combines servo/components/style/stylesheets/memory.rs and the heapsize crate
  into a new crate, malloc_size_of.

- Forks the heapsize_derive crate, calling it malloc_size_of, so that
  MallocSizeOf can be derived.

- Both the new crates have MIT/Apache licenses, like heapsize, in case they are
  incorporated into heapsize in the future.

- Renames the methods within MallocSizeOf and the related traits so they are
  more concise.

- Removes MallocSizeOfWithGuard.

- Adds `derive(MallocSizeOf)` to a lot of types, in some cases replacing an
  equivalent or almost-equivalent hand-written implementation.

- Adds stuff so that Rc/Arc can be handled properly.
2017-09-12 12:37:51 +10:00
Xidorn Quan
4f6752ed1a Harden assert for creating atom from raw pointer. 2017-08-30 12:36:45 +10: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
Emilio Cobos Álvarez
4e3ea45325
stylo: Devirtualize nsIAtom refcounting.
Bug: 1362338
Reviewed-by: froydnj
MozReview-Commit-ID: 3q5rz3L8quQ
2017-08-09 13:06:11 +02:00
Emilio Cobos Álvarez
efed0ac742
stylo: We've had bitfield accessors for a while now. 2017-08-08 17:34:12 +02:00
Ehsan Akhgari
aeb2b8b098 stylo: Read mName as a raw nsIAtom* from NodeInfoInner. 2017-07-24 10:40:58 -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
Emilio Cobos Álvarez
ce9cd802de
style: Clean up after #17427. 2017-06-20 15:42:23 +02:00
Simon Sapin
a5bb55790f Untry style 2017-06-18 13:18:13 +02:00
Simon Sapin
5bccf98aa4 ID and class selectors are ASCII case-insensitive in quirks mode.
https://bugzilla.mozilla.org/show_bug.cgi?id=1363778
2017-06-12 23:33:53 +02:00
Simon Sapin
524fcac191 Add Atom::to_ascii_lowercase 2017-06-12 23:33:15 +02:00
Emilio Cobos Álvarez
cb04ef933b
stylo: Use bitfield accessors in string-cache. 2017-06-11 18:39:25 +02:00
Bobby Holley
47fd83da57 Add a fast path for eq_ignore_ascii_case. 2017-05-24 15:48:43 +02:00
Emilio Cobos Álvarez
1f7d48f564
Revert "Auto merge of #16976 - upsuper:bug1366247, r=nox"
This reverts commit 3d40b516c8, reversing
changes made to 255387a915.
2017-05-21 21:29:50 +02:00
Xidorn Quan
2b1f7f6081 Add sugar for already_AddRefed and use it for conversion between Atom and nsIAtom pointer. 2017-05-21 18:03:47 +10:00
Xidorn Quan
0667287bf6 Relax the requirement of Atom::with. 2017-05-16 14:42:45 +10:00
Xidorn Quan
10b7001dd1 Make atom files generated at build-time. 2017-05-08 21:33:58 +10:00
Xidorn Quan
5b57c5513c Move atom_macro.rs to generated dir. 2017-05-08 21:33:55 +10:00
Xidorn Quan
1ef7b323ac Fix stylo issue after changing counter style names to nsIAtom. 2017-05-06 12:50:08 +10:00
Simon Sapin
0ff64bdc59 Allow 'decimal' and 'none' in <counter-style-name>
… other than in `@counter-style`.
2017-04-26 13:04:27 +09:00
Simon Sapin
1146921866 Keep custom-ident and string separate in animation/keyframes name. 2017-04-26 13:04:22 +09:00
Manish Goregaokar
8bfcc6992e tidy and test fixes 2017-04-21 14:53:27 -07:00
Manish Goregaokar
c1c4c8fa59 stylo: Add basic system font support, use for font-size and font-family 2017-04-21 14:53:09 -07:00
Cameron McCormack
408100818d Revert #16517 for Gecko heap write hazard failures. 2017-04-19 16:35:23 +10:00
Manish Goregaokar
14c632408c tidy and test fixes 2017-04-18 18:51:31 -07:00
Manish Goregaokar
2c5ac9fc2d stylo: Add basic system font support, use for font-size and font-family 2017-04-18 09:45:29 -07:00
J. Ryan Stinnett
f6fe439d1e Update Stylo bindings 2017-04-14 17:22:17 +08:00
Manish Goregaokar
2febe7ccde stylo: Use font metrics provider as a cache for font size results 2017-04-09 19:15:37 +08:00
Emilio Cobos Álvarez
e29b84de18
style: Hash less stuff in the bloom filter, using the precomputed hashes we have. 2017-04-08 02:02:11 +02:00
bors-servo
a55cb8425d Auto merge of #16269 - heycam:atom-already-addrefed, r=upsuper
Add an Atom::from_addrefed function.

<!-- 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/16269)
<!-- Reviewable:end -->
2017-04-05 05:10:07 -05:00
Cameron McCormack
f3dcef8c81 style: Add an Atom::from_addrefed function. 2017-04-05 17:39:26 +08:00
bors-servo
42f58503c0 Auto merge of #16169 - servo:stylo-heapsize, r=emilio
Remove heapsize for Stylo

It doesn’t seem to be used, and is causing compilation trouble for Gecko: https://bugzilla.mozilla.org/show_bug.cgi?id=1350581

<!-- 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/16169)
<!-- Reviewable:end -->
2017-04-05 03:59:26 -05:00
Simon Sapin
94eb159137 Remove heapsize for Stylo 2017-03-28 17:50:52 +02:00
Boris Zbarsky
76a8e1ca1c Update Gecko atom bindings for Gecko bug 1351139. 2017-03-28 10:19:09 -04:00
Xidorn Quan
b02c786a42 Update bindings 2017-03-14 15:54:33 +11:00
Nazım Can Altınova
458b7682e6
Stylo: Add support for "font-family: -moz-fixed" 2017-03-12 00:57:20 +03:00
Boris Zbarsky
9a5a26078a Update bindinggen bits for gecko bug 1343078.
Both the set of atoms and the way they are represented in the atom list
is changing a bit.
2017-03-08 00:13:29 -05:00
Xidorn Quan
50efcb60a8 Update atoms for gecko binding 2017-02-18 13:26:42 +11:00
Emilio Cobos Álvarez
91e0ae2fe7
Bindgenup
Major pain point is that I had to write the bitfield stuff manually, but that
should be resolved soon again.

Now we generate proper layout for _every_ struct, including field offsets \o/.
2017-02-16 06:12:13 +01:00
Emilio Cobos Álvarez
2cebd3bc96
style: Document gecko_string_cache. 2017-01-02 12:58:07 +01:00
Cameron McCormack
e1f86377bd Update atoms. 2016-12-22 10:06:00 +08:00
Xidorn Quan
7f06c554d9 Remove static atoms of CSS properties 2016-12-16 18:14:40 +11:00
Simon Sapin
137e30b825 Introduce enums for identifying CSS properties.
* `LonghandId` and `ShorthandId` are C-like enums
* `Atom` is used for the name of custom properties.
* `PropertyDeclarationId` is the identifier for `PropertyDeclaration`,
  after parsing and shorthand expansion. (Longhand or custom property.)
* `PropertyId` represents any CSS property, e.g. in CSSOM.
  (Longhand, shorthand, or custom.)

Using these instead of strings avoids some memory allocations and copies.
2016-12-09 10:56:22 -10:00