servo/components/style
bors-servo cbc857bb78 Auto merge of #13569 - Manishearth:simpliffi, r=emilio
Start simplifying FFI ownership sugar

This is step one of a series of changes planned to make the ownership sugar easier to use. This was blocked on #13038

*very* unsure about second commit. Don't like the thought of accepting types with destructors over FFI. Probably will revert it. Leaving it in for now in case you have some insight.

Eventually at least for the borrowed stuff I want to use T directly (because the crates are merged now), instead of the fake void types. Perhaps for the others too. I might include those changes in this PR -- was originally planning to but I realized that these steps could be split out.

Tentative plan for `Owned` (assuming it's not removed) is to have `Owned<T> <-> Box<T>` (same `T`, no "FFI type") conversions. We will only use ownership wrapper types for things with destructors, and try to keep the conversion simple. I'm envisioning a couple methods for arc/strong and a few more for box/owned. We may need to introduce new wrapper types for gecko-side managed objects (`RefPtr<T>`, `UniquePtr<T>`) but that should be all the wrapper types we have in the ownership sugar.

This PR relies on the guarantee that `Option<&T>` and `Option<Box<T>>` are pointer-sized via the `NonZero` optimization. I am now less unconvinced that this is a good idea 😉.

r? @emilio

cc @mystor

<!-- 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/13569)
<!-- Reviewable:end -->
2016-10-05 00:59:56 -05:00
..
binding_tools Auto merge of #13569 - Manishearth:simpliffi, r=emilio 2016-10-05 00:59:56 -05:00
gecko Auto merge of #13569 - Manishearth:simpliffi, r=emilio 2016-10-05 00:59:56 -05:00
gecko_bindings Auto merge of #13569 - Manishearth:simpliffi, r=emilio 2016-10-05 00:59:56 -05:00
gecko_string_cache Regen bindings for upcoming resync 2016-10-01 22:01:07 +05:30
properties Auto merge of #13569 - Manishearth:simpliffi, r=emilio 2016-10-05 00:59:56 -05:00
values Add from_computed_value() function for converting computed values to specified 2016-09-23 09:44:32 +05:30
animation.rs Use parking_lot::RwLock instead of DOMRefCell for PropertyDeclarationBlock 2016-10-04 18:34:59 +02:00
atomic_refcell.rs Implement AtomicRefCell. 2016-10-02 19:19:52 -07:00
attr.rs Replace the SelectorImplExt trait with inherent methods. 2016-08-09 18:17:13 +02:00
bezier.rs Move util::bezier to style 2016-02-14 19:45:24 +01:00
build.rs Run style with all properties enabled 2016-09-23 15:10:40 +05:30
cache.rs Lazily compute common style affecting attribute info. 2016-08-17 14:17:44 -07:00
Cargo.toml Use parking_lot::RwLock instead of DOMRefCell for PropertyDeclarationBlock 2016-10-04 18:34:59 +02:00
cascade_info.rs style: Introduce a generic way of gathering information from the cascade, and use it for viewport units. 2016-08-16 10:58:16 -07:00
context.rs Reorder use statements 2016-09-09 04:55:19 +02:00
custom_properties.rs style: Introduce a generic way of gathering information from the cascade, and use it for viewport units. 2016-08-16 10:58:16 -07:00
data.rs Rename PrivateStyleData to PersistentStyleData and use AtomicRefCell instead of RefCell as a container. 2016-10-02 19:19:52 -07:00
dom.rs Use parking_lot::RwLock instead of DOMRefCell for PropertyDeclarationBlock 2016-10-04 18:34:59 +02:00
element_state.rs Issue 7720: Add target selector and update when scrolling to fragment 2016-08-03 13:23:10 +01:00
error_reporting.rs Add some documentation to the style crate. 2016-06-27 17:33:14 +02:00
font_face.rs Update cssparser 2016-09-07 14:13:56 +08:00
keyframes.rs Use parking_lot::RwLock instead of DOMRefCell for PropertyDeclarationBlock 2016-10-04 18:34:59 +02:00
lib.rs Move DOMRefCell back into script. 2016-10-04 18:35:00 +02:00
logical_geometry.rs Reorder use statements 2016-09-09 04:55:19 +02:00
matching.rs Use parking_lot::RwLock instead of DOMRefCell for PropertyDeclarationBlock 2016-10-04 18:34:59 +02:00
media_queries.rs style: Don't incorrectly clamp values in calc that might not be only lengths. 2016-09-01 23:39:40 -07:00
parallel.rs Rename PrivateStyleData to PersistentStyleData and use AtomicRefCell instead of RefCell as a container. 2016-10-02 19:19:52 -07:00
parser.rs Add ShapeSource to basic-shape values 2016-08-18 11:38:33 +05:30
README.md docs: Add style overview. 2016-05-04 00:34:03 +02:00
refcell.rs Revert "Make DOMRefCell use style’s copy of RefCell" 2016-10-04 18:35:01 +02:00
restyle_hints.rs Make style build without impl<T: HeapSizeOf> HeapSizeOf for Arc<T>. 2016-10-04 13:45:57 +02:00
selector_impl.rs Move gecko_* into style::gecko 2016-09-24 19:25:59 +05:30
selector_matching.rs Use parking_lot::RwLock instead of DOMRefCell for PropertyDeclarationBlock 2016-10-04 18:34:59 +02:00
sequential.rs Rewrite the style sharing candidate cache. 2016-08-17 14:16:16 -07:00
servo_selector_impl.rs Style input-text pseudo with user-agent CSS 2016-09-21 21:21:32 -04:00
sink.rs Move util::vec::ForgetfulSink to style::sink and simplify it 2016-07-04 16:48:14 +02:00
str.rs Move util::str to style 2016-07-05 10:43:54 +02:00
stylesheets.rs Use parking_lot::RwLock instead of DOMRefCell for PropertyDeclarationBlock 2016-10-04 18:34:59 +02:00
thread_state.rs Move thread_state to style. 2016-08-22 16:08:56 +02:00
tid.rs Move util::tid to style 2016-07-05 10:36:38 +02:00
timer.rs style: Add a new Timer structure to the shared style context, and basic infrastructure for controlling animations. 2016-07-20 09:05:53 -07:00
traversal.rs force style calculation/element construction for non-incremental mode 2016-08-23 01:45:18 +03:00
viewport.rs Reorder use statements 2016-09-09 04:55:19 +02:00
workqueue.rs style: Make WorkQueue creation fallible. 2016-08-25 23:43:31 -07:00

servo-style

Style system for Servo, using rust-cssparser for parsing.