Auto merge of #18267 - emilio:dirty-on-viewport-size-change, r=SimonSapin

style: Don't look for viewport units in stylesheets.

Use whether we've computed any viewport unit instead.

This is more accurate (we avoid restyling unnecessarily if we've found anything
ever on the stylesheet, but that hasn't matched).

This has the benefit of also matching Gecko, and simplify some code and
fishyness around, and also hopefully speeding up stylesheet parsing.

<!-- 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/18267)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-08-28 08:48:47 -05:00 committed by GitHub
commit 96b4e064a1
10 changed files with 39 additions and 66 deletions

View file

@ -109,10 +109,6 @@ impl HTMLMetaElement {
namespaces: Default::default(),
quirks_mode: document.quirks_mode(),
url_data: RwLock::new(window_from_node(self).get_url()),
// Viewport constraints are always recomputed on
// resize; they don't need to force all styles to be
// recomputed.
dirty_on_viewport_size_change: AtomicBool::new(false),
source_map_url: RwLock::new(None),
},
media: Arc::new(shared_lock.wrap(MediaList::empty())),