Auto merge of #16968 - HeyZoos:stylist-accessors, r=emilio

Stylist accessors

<!-- Please describe your changes on the following line: -->
Add accessor methods for the `device` and `ruleset` fields in the `Stylist` struct.

---
<!-- 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 #16857 (github issue number if applicable).
<!-- Either: -->
- [X] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/16968)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-05-22 20:12:46 -05:00 committed by GitHub
commit 1306b16d5a
8 changed files with 61 additions and 25 deletions

View file

@ -1592,7 +1592,7 @@ pub extern "C" fn Servo_MediaList_Matches(list: RawServoMediaListBorrowed,
-> bool {
let per_doc_data = PerDocumentStyleData::from_ffi(raw_data).borrow();
read_locked_arc(list, |list: &MediaList| {
list.evaluate(&per_doc_data.stylist.device, per_doc_data.stylist.quirks_mode())
list.evaluate(per_doc_data.stylist.device(), per_doc_data.stylist.quirks_mode())
})
}
@ -2290,7 +2290,7 @@ pub extern "C" fn Servo_GetComputedKeyframeValues(keyframes: RawGeckoKeyframeLis
let mut context = Context {
is_root_element: false,
device: &data.stylist.device,
device: data.stylist.device(),
inherited_style: parent_style.unwrap_or(default_values),
layout_parent_style: parent_style.unwrap_or(default_values),
style: StyleBuilder::for_derived_style(&style),
@ -2368,7 +2368,7 @@ pub extern "C" fn Servo_AnimationValue_Compute(declarations: RawServoDeclaration
let metrics = get_metrics_provider_for_product();
let mut context = Context {
is_root_element: false,
device: &data.stylist.device,
device: data.stylist.device(),
inherited_style: parent_style.unwrap_or(default_values),
layout_parent_style: parent_style.unwrap_or(default_values),
style: StyleBuilder::for_derived_style(&style),