servo: Merge #14556 - Make Stylist::set_device check stylesheet media queries (from iamrohit7:fix-set-device); r=SimonSapin,Emilio

Fixes Stylist::set_device to check for media queries in stylesheets.

<!-- 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 #14279  (github issue number if applicable).

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

<!-- 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: 1c1aaa5a883bd17618ac90ac67a6f0030a276ff5
This commit is contained in:
Rohit Burra 2017-01-29 04:06:03 -08:00
Родитель 9704ac1a17
Коммит 8d6f41f073
1 изменённых файлов: 5 добавлений и 0 удалений

Просмотреть файл

@ -458,6 +458,11 @@ impl Stylist {
false
}
self.is_device_dirty |= stylesheets.iter().any(|stylesheet| {
let mq = stylesheet.media.read();
if mq.evaluate(&self.device) != mq.evaluate(&device) {
return true
}
mq_eval_changed(&stylesheet.rules.read().0, &self.device, &device)
});