gecko-dev/servo/docs
Simon Sapin c710b104be servo: Merge #12515 - Make the style crate more concrete (from servo:concrete-style); r=bholley
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. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 2d01d41a506bcbc7f26a2284b9f42390d6ef96ab

--HG--
rename : servo/ports/geckolib/selector_impl.rs => servo/components/style/gecko_selector_impl.rs
rename : servo/ports/geckolib/values.rs => servo/components/style/gecko_values.rs
rename : servo/ports/geckolib/properties.mako.rs => servo/components/style/properties/gecko.mako.rs
2016-07-20 02:58:34 -05:00
..
components servo: Merge #12515 - Make the style crate more concrete (from servo:concrete-style); r=bholley 2016-07-20 02:58:34 -05:00
COMMAND_LINE_ARGS.md servo: Merge #10914 - Added documents for commandline arguments (from shinglyu:docs); r=aneeshusa 2016-05-03 06:31:38 -07:00
glossary.md servo: Merge #10934 - style: Add infrastructure to support lazy pseudo-elements (from emilio:other-gecko-pseudos); r=bholley,mbrubeck 2016-05-04 03:42:23 -07:00
HACKING_QUICKSTART.md servo: Merge #12266 - Update HACKING_QUICKSTART.md (from tshepang:patch-1); r=nox 2016-07-08 00:51:03 -07:00
ORGANIZATION.md servo: Merge #12254 - Cleanup and update ORGANIZATION.md (from servo:org); r=jdm 2016-07-07 23:55:51 -07:00
STYLE_GUIDE.md servo: Merge #10948 - Clean up CI bash scripts (from aneeshusa:clean-up-ci-bash-scripts); r=emilio 2016-05-01 08:46:16 -07:00