servo/components
bors-servo 2d01d41a50 Auto merge of #12515 - servo:concrete-style, r=bholley
Make the style crate more concrete

Background:

The changes to Servo code to support Stylo began in the `selectors` crate with making pseudo-elements generic, defined be the user, so that different users (such as Servo and Gecko/Stylo) could have a different set of pseudo-elements supported and parsed. Adding a trait makes sense there since `selectors` is in its own repository and has others users (or at least [one](https://github.com/SimonSapin/kuchiki)).

Then we kind of kept going with the same pattern and added a bunch of traits in the `style` crate to make everything generic, allowing Servo and Gecko/Stylo to do things differently. But we’ve also added a `gecko` Cargo feature to do conditional compilation, at first to enable or disable some CSS properties and values in the Mako templates. Since we’re doing conditional compilation anyway, it’s often easier and simpler to do it more (with `#[cfg(feature = "gecko")]` and `#[cfg(feature = "servo")]`) that to keep adding traits and making everything generic. When a type is generic, any method that we want to call on it needs to be part of some trait.

----

The first several commits move some code around, mostly from `geckolib` to `style` (with `#[cfg(feature = "gecko")]`) but otherwise don’t change much.

The following commits remove some traits and many type parameters through the `style` crate, replacing them with pairs of conditionally-compiled API-compatible items (types, methods, …).

Simplifying code is nice to make it more maintainable, but this is motivated by another change described in https://github.com/servo/servo/pull/12391#issuecomment-232183942. (Porting Servo for that change proved difficult because some code in the `style` crate was becoming generic over `String` vs `Atom`, and this PR will help make that concrete. That change, in turn, is motivated by removing geckolib’s `[replace]` override for string-cache, in order to enable using a single Cargo "workspace" in this repository.)

r? @bholley

---
<!-- 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
- [x] These changes fix #__ (github issue number if applicable).

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

<!-- 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/12515)
<!-- Reviewable:end -->
2016-07-20 02:58:34 -05:00
..
canvas All our Cargo.toml files should contain an MPL-2.0 license field. 2016-07-14 10:26:34 -05:00
canvas_traits All our Cargo.toml files should contain an MPL-2.0 license field. 2016-07-14 10:26:34 -05:00
compositing Replace any errors caused by content-provided URLs by warnings. 2016-07-15 09:50:40 -05:00
constellation make resource_thread talk to sw-manager 2016-07-18 19:06:48 +05:30
devtools All our Cargo.toml files should contain an MPL-2.0 license field. 2016-07-14 10:26:34 -05:00
devtools_traits All our Cargo.toml files should contain an MPL-2.0 license field. 2016-07-14 10:26:34 -05:00
gfx Remove the ComputedValue traits and style_struct_traits 2016-07-20 08:42:40 +02:00
gfx_traits All our Cargo.toml files should contain an MPL-2.0 license field. 2016-07-14 10:26:34 -05:00
layout Remove some type aliases that are now just re-exports. 2016-07-20 08:42:47 +02:00
layout_thread Remove some type aliases that are now just re-exports. 2016-07-20 08:42:47 +02:00
layout_traits All our Cargo.toml files should contain an MPL-2.0 license field. 2016-07-14 10:26:34 -05:00
msg msg: Rename ReferrerPolicy::NoRefWhenDowngrade NoReferrerWhenDowngrade 2016-07-15 08:13:57 -07:00
net make resource_thread talk to sw-manager 2016-07-18 19:06:48 +05:30
net_traits Integrate service worker manager thread 2016-07-16 23:29:44 +05:30
plugins All our Cargo.toml files should contain an MPL-2.0 license field. 2016-07-14 10:26:34 -05:00
profile All our Cargo.toml files should contain an MPL-2.0 license field. 2016-07-14 10:26:34 -05:00
profile_traits All our Cargo.toml files should contain an MPL-2.0 license field. 2016-07-14 10:26:34 -05:00
range All our Cargo.toml files should contain an MPL-2.0 license field. 2016-07-14 10:26:34 -05:00
script Auto merge of #12515 - servo:concrete-style, r=bholley 2016-07-20 02:58:34 -05:00
script_layout_interface Remove some type aliases that are now just re-exports. 2016-07-20 08:42:47 +02:00
script_traits make resource_thread talk to sw-manager 2016-07-18 19:06:48 +05:30
servo Update WR to get fix for texture atlas assert. 2016-07-19 11:43:24 +10:00
style Remove some type aliases that are now just re-exports. 2016-07-20 08:42:47 +02:00
style_traits All our Cargo.toml files should contain an MPL-2.0 license field. 2016-07-14 10:26:34 -05:00
util Auto merge of #12137 - ConnorGBrewster:resources_case_sensitive, r=aneeshusa 2016-07-15 10:29:55 -07:00
webdriver_server All our Cargo.toml files should contain an MPL-2.0 license field. 2016-07-14 10:26:34 -05:00