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

@ -462,7 +462,7 @@ impl LayoutThread {
for stylesheet in &ua_stylesheets.user_or_user_agent_stylesheets {
add_font_face_rules(stylesheet,
&guard,
&stylist.device,
stylist.device(),
&font_cache_thread,
&ipc_font_cache_sender,
&outstanding_web_fonts_counter);
@ -795,10 +795,10 @@ impl LayoutThread {
let rw_data = possibly_locked_rw_data.lock();
let guard = stylesheet.shared_lock.read();
if stylesheet.is_effective_for_device(&self.stylist.device, &guard) {
if stylesheet.is_effective_for_device(self.stylist.device(), &guard) {
add_font_face_rules(&*stylesheet,
&guard,
&self.stylist.device,
self.stylist.device(),
&self.font_cache_thread,
&self.font_cache_sender,
&self.outstanding_web_fonts);
@ -1261,11 +1261,11 @@ impl LayoutThread {
}
if opts::get().dump_rule_tree {
layout_context.style_context.stylist.rule_tree.dump_stdout(&guards);
layout_context.style_context.stylist.rule_tree().dump_stdout(&guards);
}
// GC the rule tree if some heuristics are met.
unsafe { layout_context.style_context.stylist.rule_tree.maybe_gc(); }
unsafe { layout_context.style_context.stylist.rule_tree().maybe_gc(); }
// Perform post-style recalculation layout passes.
if let Some(mut root_flow) = self.root_flow.borrow().clone() {