Auto merge of #10105 - mbrubeck:dirty-viewport-percentages, r=SimonSapin

Don't re-add stylesheets to recompute vw/vh lengths

This is a follow-up to #9876.  It avoids clearing and rebuilding SelectorMaps
when vh and vw units need to be recomputed. Instead it just dirties all nodes,
to force elements to be re-cascaded.

Filed #10104 for later follow-up work to dirty only affected nodes.

r? @SimonSapin

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10105)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-03-22 18:58:47 +05:30
commit 41060dbdd7
2 changed files with 8 additions and 5 deletions

View file

@ -227,10 +227,7 @@ impl<Impl: SelectorImplExt> Stylist<Impl> {
device = Device::new(MediaType::Screen, constraints.size);
}
let size_changed = device.viewport_size != self.device.viewport_size;
self.is_device_dirty |= stylesheets.iter().any(|stylesheet| {
(size_changed && stylesheet.dirty_on_viewport_size_change) ||
stylesheet.rules().media().any(|media_rule|
media_rule.evaluate(&self.device) != media_rule.evaluate(&device))
});