Commit Graph

379 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
4853fe4b89 servo: Merge #12392 - style: Add support to test animations programatically (from emilio:test-animations); r=SimonSapin
<!-- Please describe your changes on the following line: -->

---
<!-- 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 #12120

<!-- Either: -->
- [x] There are tests for these changes OR

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

r? @SimonSapin for the style changes, @Ms2ger or @jdm for the dom and test changes

Source-Repo: https://github.com/servo/servo
Source-Revision: 14aeccc33ab44d706df86fbce67339218efe710c
2016-07-20 13:38:31 -05:00
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
Cameron McCormack
b4e35e0e34 servo: Merge #12487 - Add FFI glue for Gecko to implement 1-arg CSS.supports() with stylo (from heycam:supports-ffi); r=emilio
<!-- Please describe your changes on the following line: -->

This adds an FFI function for Gecko to call to implement the 1-arg version of `CSS.supports()`.  This will be useful for producing an automated analysis of CSS properties we lack support for in geckolib.  Corresponding Gecko bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1287382

r? @emilio

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because this is a geckolib-only change, and we don't have testing for that yet :(

<!-- 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: f88ecda3628ec2af3a4e4c7fdebeda47b4008d6f
2016-07-18 21:25:31 -07:00
Ms2ger
013bec0ca2 servo: Merge #12385 - Move arc_ptr_eq to style (from Ms2ger:arc_ptr_eq); r=SimonSapin
Source-Repo: https://github.com/servo/servo
Source-Revision: c3a8cbbd38570d4a9095ca94ee4a970956691051
2016-07-11 05:11:48 -07:00
Bobby Holley
ba2f2c1399 servo: Merge #11886 - Refactor attribute handling to avoid marshalling attributes from Gecko into Servo (from bholley:attr_refactor); r=SimonSapin
This marshaling is slow, because Gecko stores attributes as UTF-16 and does not atomize them in all cases, and it turns out that the need for them in Servo is pretty minimal. With some refactoring across servo and rust-selectors we can fix this.

Source-Repo: https://github.com/servo/servo
Source-Revision: abdf2f28a0bd25a76a31b4fd2410c7a87448ed54
2016-07-05 18:55:36 -07:00
Emilio Cobos Álvarez
b3b8f4ed55 servo: Merge #11946 - style: Remove the Mutex from new_animations_sender by moving it to the local StyleContext (from emilio:animations-sender); r=bholley
<!-- Please describe your changes on the following line: -->

---
<!-- 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

<!-- Either: -->
- [x] These changes do not require 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. -->

As a follow-up, we could move all the data living under a mutex in the
SharedLayoutContext only in order to create the local context to the same place.

This should increase animation performance when there are multiple animations in
one page that happen to be on different threads.

r? @SimonSapin/@mbrubeck for the style/layout, @bholley for the geckolib changes

Source-Repo: https://github.com/servo/servo
Source-Revision: ec0d3e084dbaecf749a67ba52e5f680262960a29
2016-07-01 14:12:54 -07:00
Cameron McCormack
e9b215b857 servo: Merge #11787 - Stop parsing style attributes during restyle in geckolib (from heycam:style-attr); r=bholley
<!-- Please describe your changes on the following line: -->

This allows `PropertyDeclarationBlock`s parsed for `style=""` attributes to be stored on a Gecko node so that we don't have to re-parse it each time we compute style for an element.  Works with [Gecko bug 1280772](https://bugzilla.mozilla.org/show_bug.cgi?id=1280772).

r? @bholley
CC @emilio

---

<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./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. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 581c8ba1c867ad378dee79b05b11648726ce5efb
2016-06-23 21:46:25 -05:00
Cameron McCormack
46d23041f1 servo: Merge #11784 - Look at nsIAtom.mHash directly rather than call Gecko_HashAtom (from heycam:atom); r=bholley
<!-- Please describe your changes on the following line: -->

We hash Gecko-backed atoms pretty often.  Using bindgen to access to the stored hash in nsIAtom helps with perf a little.

r? @bholley

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./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. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: bc5a52b32886e82ec35c4cada9db38c031cf969c
2016-06-21 16:33:44 -05:00
Josh Matthews
7f10c47c0a servo: Merge #11472 - Report blank lines that follow an open brace (from jdm:wip); r=mbrubeck
This automates something that I find myself frequently commenting on in PRs.

---
<!-- 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] There are tests for these changes OR

<!-- 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: 3ec20d9cf517c67f4d280e8958cc58c4c2b4fbb2
2016-05-27 18:14:25 -05:00
Cullen Rhodes
2bd22f97ce servo: Merge #11329 - Report use statements that use {} with only one entry (from c-rhodes:11320); r=jdm
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 --faster` does not report any errors
- [X ] These changes fix #11320  (github issue number if applicable).

Either:
- [X] 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.

Source-Repo: https://github.com/servo/servo
Source-Revision: 2f9796fa696e9514280777398467696dd4f004b3
2016-05-27 07:11:17 -05:00
Cameron McCormack
ef3928087b servo: Merge #11404 - Add Servo_RestyleSubtree (from heycam:restyle-subtree); 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 --faster` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

Either:
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because geckolib-only

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

----

See also: https://bugzilla.mozilla.org/show_bug.cgi?id=1275452

r? @bholley

Source-Repo: https://github.com/servo/servo
Source-Revision: 0293a3df16384b84ecbfee2838ffd87ca6ed4a01
2016-05-25 16:26:11 -05:00
Cameron McCormack
723cf0f5c4 servo: Merge #11287 - Support -moz-binding in geckolib (from heycam:moz-binding); 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 --faster` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

Either:
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because changes target stylo

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: 2a2b88f42c55614f949f218b0444778e8e2bfc78
2016-05-24 14:41:04 -07:00
Bobby Holley
dad21c2a95 servo: Merge #11121 - Hoist gecko bindings into their own crate (from bholley:hoist_bindings); r=mbrubeck
This will be helpful for leveraging the bindings with our nsIAtom-backed
string_cache replacement.

Source-Repo: https://github.com/servo/servo
Source-Revision: 49fd06089de8357c0d139f6aa623cde55ccd9ef0

--HG--
rename : servo/ports/geckolib/bindings.rs => servo/ports/geckolib/gecko_bindings/bindings.rs
rename : servo/ports/geckolib/gecko_style_structs.rs => servo/ports/geckolib/gecko_bindings/structs.rs
rename : servo/ports/geckolib/tools/.gitignore => servo/ports/geckolib/gecko_bindings/tools/.gitignore
rename : servo/ports/geckolib/tools/README.md => servo/ports/geckolib/gecko_bindings/tools/README.md
rename : servo/ports/geckolib/tools/regen_style_structs.sh => servo/ports/geckolib/gecko_bindings/tools/regen_style_structs.sh
rename : servo/ports/geckolib/tools/setup_bindgen.sh => servo/ports/geckolib/gecko_bindings/tools/setup_bindgen.sh
2016-05-11 14:59:04 -07:00
Bobby Holley
3fb5bcc6cc servo: Merge #11058 - Geckolib: minor robustness fixes (from bholley:minor_wikipedia_fixes); r=mbrubeck,bholley
Source-Repo: https://github.com/servo/servo
Source-Revision: aa62a1466e86482822f4b4325f232fabdc12c0ca
2016-05-07 04:25:31 -07:00
Cameron McCormack
8e6b901b3f servo: Merge #11045 - Add Servo_GetComputedValuesForOtherNonElement (from heycam:non-element); r=bholley
Source-Repo: https://github.com/servo/servo
Source-Revision: 50f2349551228f5773c431a3cc3f42e2018ba454
2016-05-06 04:30:47 -07:00
Bobby Holley
0b3556454c servo: Merge #10998 - Geckolib: implement font-weight and logging support (from bholley:font_weight_and_logging); r=mbrubeck
Source-Repo: https://github.com/servo/servo
Source-Revision: ec5f826d18adabbb0cf8d07b879b616dc5caa1aa
2016-05-04 18:37:26 -07:00
Emilio Cobos Álvarez
d72fd6f4ec servo: Merge #10934 - style: Add infrastructure to support lazy pseudo-elements (from emilio:other-gecko-pseudos); r=bholley,mbrubeck
This builds on top of #10815, so it's really just the last commit the one that should be reviewed.

I tried to apply the new infrastructure to servo, but failed (for now?).

The problem with it is that it'd require `ThreadSafeLayoutElement` to implement `selectors::Element`, which is a lot of work and might be racy (not totally sure about it though). Thus, I prefered to keep selectors eager until knowing that it's safe to do it.

r? @mbrubeck for style changes, @bholley for the geckolib changes (minimal for now, glue + a list of lazy PEs must be added)

Source-Repo: https://github.com/servo/servo
Source-Revision: 29823cb378ad0b05a82cfdd133c401a678a19007
2016-05-04 03:42:23 -07:00
Emilio Cobos Álvarez
18f790ca50 servo: Merge #10815 - style: Support anonymous box pseudo-elements (from emilio:anonbox-gcs); r=SimonSapin,bholley
This is a work-in-progress that:

 * Adds support for some pseudo-elements to skip the cascade entirely, in an analogous way to Gecko's anonymous box pseudo-elements.
 * Takes rid of `StylistWrapper`, and uses `Arc::get_mut` instead.
 * Uses the first bullet to precompute the `-servo-details-content` pseudo's style.

I'd like @bholley to take a look before following, do you think that the aproach is the correct?
Also, @SimonSapin could want to put some eyes on it.

Depends on https://github.com/servo/rust-selectors/pull/81

Source-Repo: https://github.com/servo/servo
Source-Revision: 407f991c8aba5dcf5312bb2c34a3dd4fe12e5471
2016-04-29 14:27:16 -07:00
Cameron McCormack
e19590ff39 servo: Merge #10889 - Add Servo_InsertStyleSheetBefore (from heycam:insert-sheet); r=bholley
r? @bholley
Will be used by https://bugzilla.mozilla.org/show_bug.cgi?id=1268390.

Source-Repo: https://github.com/servo/servo
Source-Revision: 78ae9a5da0f8f3dc67c2d0a76507a54bd08b9fba
2016-04-28 22:37:40 -07:00
Cameron McCormack
e92750ab6b servo: Merge #10888 - Make Servo_GetComputedValues take a node rather than an element (from heycam:computed-node); r=bholley
r? @bholley
https://bugzilla.mozilla.org/show_bug.cgi?id=1268392 is the Gecko side

Source-Repo: https://github.com/servo/servo
Source-Revision: 0b2c24804208069c22ca7edb9b63ff74e8383fbe
2016-04-28 15:25:00 -07:00
Cameron McCormack
55fc6c831d servo: Merge #10848 - Add Servo_GetStyleFoo functions to get style structs from GeckoComputedValues (from heycam:struct-accessor); r=bholley
r?@bholley

Source-Repo: https://github.com/servo/servo
Source-Revision: e079e01320cf4b0f80c7d6307cf6d53fe7703ec4
2016-04-27 02:20:17 -07:00
Bobby Holley
ce0dac1c89 servo: Merge #10865 - Remove the need for custom clang to generate stylo bindings, plus misc other fixes (from bholley:simplify_bindgen); r=emilio
Source-Repo: https://github.com/servo/servo
Source-Revision: 77553ab42cb4f49d38be030a3c6852550c9f2a1b
2016-04-26 19:51:13 -07:00
Bobby Holley
4d37b3664d servo: Merge #10359 - Implement construction, destruction, and copying of gecko style structs (from bholley:style_struct_management); r=SimonSapin
This requires some new machinery on the gecko side, which I'll get up in bugzilla shortly.

Source-Repo: https://github.com/servo/servo
Source-Revision: a3b55d68a84dac301b3bc40d2444934b7df8e167
2016-04-04 19:42:29 +05:01
Bobby Holley
35b85ab9ed servo: Merge #10293 - Tweak gecko bindings (from bholley:tweak_bindings); r=emilio
A few changes as discussed.

Source-Repo: https://github.com/servo/servo
Source-Revision: 95819a4334526751168de0b9868dbd76e27b0d57
2016-04-01 16:23:30 +05:01
Bobby Holley
6e1def963d servo: Merge #10155 - Generalize the style structs (from bholley:generalize_style_structs); r=SimonSapin
This allows geckolib to pass gecko style structs and have the style system write to them directly, provided we implement all the traits.

Source-Repo: https://github.com/servo/servo
Source-Revision: 605842f193aedc1151ab38a99c49f693c76e5cf3
2016-03-25 02:58:33 +05:01
Bobby Holley
e191536d43 servo: Merge #9852 - Stylo uplifts 3 (from bholley:stylo_uplifts_3); r=bholley
Source-Repo: https://github.com/servo/servo
Source-Revision: 49e9594fb97d396f909cf367f70dec6c1ac32fc3
2016-03-05 01:19:35 +05:01
Emilio Cobos Álvarez
b1dd4fcd79 servo: Merge #9567 - style: Make the whole style crate independent of the implementation (from emilio:general-pseudo-element-parsing); r=bholley,SimonSapin
This allows, among other things, having different implementations for parsing pseudo{elements, classes} in both `ports/geckolib` and in servo.

Source-Repo: https://github.com/servo/servo
Source-Revision: c11844cbf28054784c8d65781cff20045d8ee48b
2016-02-14 03:30:59 +05:01
Bobby Holley
7d75623720 servo: Merge #9515 - Stylo uplifts Part 2 (from bholley:stylo_uplifts_2); r=SimonSapin
A bunch of random things that we might as well merge into the tree.

Source-Repo: https://github.com/servo/servo
Source-Revision: 629b1d33d5d6153da87d1ae176ea6c9b9298c650
2016-02-04 22:56:09 +05:01
Bobby Holley
2379681f6b servo: Merge #9284 - Add Partial Implementation of style DOM traits for Gecko, and some basic glue to let Gecko call into Servo (from bholley:bootstrap_stylo); r=SimonSapin
The wrapper stuff is partially-complete, modulo some unimplemented methods. The glue code is just a toy for now. Regardless, I think it's worth getting some of this stuff in-tree to minimize breakage.

Source-Repo: https://github.com/servo/servo
Source-Revision: 77d3fbcca3c6f7e8b4068f89e25b090977fe5672
2016-01-19 13:50:10 +05:01