Commit graph

42 commits

Author SHA1 Message Date
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
Cameron McCormack
5aef349341 Regenerate bindings. 2016-12-03 23:21:30 -10:00
Manish Goregaokar
9fb589dfd2 Regenerate bindings 2016-11-17 17:48:28 -08:00
Cameron McCormack
734b3dcace Regenerate bindings. 2016-11-10 10:11:15 +08:00
bors-servo
2390503772 Auto merge of #14038 - upsuper:bug1294299, r=heycam
Add Element.style support for stylo

<!-- Please describe your changes on the following line: -->
This is the Servo side change of [bug 1294299](https://bugzilla.mozilla.org/show_bug.cgi?id=1294299) which has been reviewed by @heycam, @emilio, and @SimonSapin.

This should not be merged until the Gecko side change gets merged into mozilla-central.

r? @heycam

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/14038)
<!-- Reviewable:end -->
2016-11-03 23:42:06 -05:00
bors-servo
5b4cc9568d Auto merge of #14043 - servo:string-cache-up, r=nox
Update to string-cache 0.3

Previously, `string-cache` defined:
*  An string-like `Atom` type,
* An `atom!("foo")` macro that expands to a value of that type, for a set of strings known at compile-time,
* A `struct Namespace(Atom);` type
* A `ns!(html)` macro that maps known prefixed to `Namespace` values with the corresponding namespace URL.

Adding a string to the static set required making a change to the `string-cache` crate.

With 0.3, the `Atom` type is now generic, with a type parameter that provides a set of static strings. We can have multiple such sets, defined in different crates. The `string_cache_codegen` crate, to be used in build scripts, generates code that defines such a set, a new atom type (a type alias for `Atom<_>` with the type parameter set), and an `atom!`-like macro.

The html5ever repository has a new `html5ever_atoms` crate that defines three such types: `Prefix`, `Namespace`, and `LocalName` (with respective `namespace_prefix!`, `namespace_url!`, and `local_name!` macros). It also defines the `ns!` macro like before.

This repository has a new `servo_atoms` crate in `components/atoms` that, for now, defines a single `Atom` type (and `atom!`) macro. (`servo_atoms::Atom` is defined as something like `type Atom = string_cache::Atom<ServoStaticStringSet>;`, so overall there’s now two types named `Atom`.)

In this PR, `servo_atoms::Atom` is used for everything else that was `string_cache::Atom` before. But more atom types can be defined as needed. Two reasons to do this are to auto-generate the set of static strings (I’m planning to do this for CSS property names, which is the motivation for this change), or to have the type system help us avoid mix up unrelated things (this is why we had a `Namespace` type ever before this change).

Introducing new types helped me find a bug: when creating a new attribute `dom::Element::set_style_attr`, would pass `Some(atom!("style"))` instead of `None` (now `Option<html5ever_atoms::Prefix>` instead of `Option<string_cache::Atom>`) to the `prefix` argument of `Attr::new`. I suppose the author of that code confused it with the `local_name` argument.

---

Note that Stylo is not affected by any of this. The `gecko_string_cache` module is unchanged, with a single `Atom` type. The `style` crate conditionally compiles `Prefix` and `LocalName` re-exports for that are both `gecko_string_cache::Atom` on stylo.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/14043)
<!-- Reviewable:end -->
2016-11-03 11:19:44 -05:00
Simon Sapin
53b638c0e2 Update to string-cache 0.3 2016-11-03 16:23:05 +01:00
Cameron McCormack
ab90ac91de Regenerate bindings. 2016-11-03 18:00:59 +08:00
Xidorn Quan
e8a3d935ad Add static atoms for CSS properties from Gecko 2016-11-03 15:01:46 +11:00
Bobby Holley
833af4521a Regenerate bindings for mozilla-central rev e3279760cd977aac30bd9e8032d3ee71f55d2a67. 2016-10-30 15:25:40 -07:00
Simon Sapin
465efd784c Update to selectors 0.14 2016-10-28 15:56:37 +02:00
Cameron McCormack
605c2e0100 Regenerate bindings. 2016-10-19 12:19:41 +08:00
Bobby Holley
8abc1bd275 Eliminate warning about unsafe references to extern static variables.
MozReview-Commit-ID: 7UJNBaEWnH7
2016-10-11 14:05:27 +05:30
Manish Goregaokar
9812034b96 Regen bindings 2016-10-10 15:34:49 +05:30
Manish Goregaokar
3ca53c8a4b Regen bindings for upcoming resync 2016-10-01 22:01:07 +05:30
Manish Goregaokar
b6fccbf65c Regen bindings 2016-09-30 20:48:37 +05:30
Ravi Shankar
fa06b922c7 Refactor geckolib atoms regen script 2016-09-30 20:48:36 +05:30
bors-servo
c834e57f4d Auto merge of #13477 - Manishearth:regen, r=emilio
Regenerate bindings

r? @emilio

<!-- 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/13477)
<!-- Reviewable:end -->
2016-09-30 08:39:50 -05:00
Manish Goregaokar
a0fbcadc67 Regen bindings 2016-09-28 13:26:18 +02:00
Ravi Shankar
24c00da08c Silence some warnings in geckolib 2016-09-27 18:35:51 +05:30
Josh Matthews
587250ba4e Avoid huge numbers of warnings for atom_macro. 2016-09-26 09:35:26 -04:00
Manish Goregaokar
b2e592b121 Move most of geckolib into style::gecko 2016-09-26 09:07:17 +02:00
Manish Goregaokar
c6787458d9 Move gecko_bindings and gecko_string_cache into the style crate 2016-09-24 19:25:55 +05:30