diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2017-10-11 10:59:05 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-11 10:59:05 -0500 |
commit | 105c5d2a0692c6e09320c5d967b43f879c3cd00d (patch) | |
tree | f58795fb354bfb3c609e22af13f71c686f604e8f | |
parent | 528d0fb40939311625dd977b52e879758d6f6aab (diff) | |
parent | 5723cf7d137c902ee6f7cc0f4d2dfcf4bb5ddc8a (diff) | |
download | servo-105c5d2a0692c6e09320c5d967b43f879c3cd00d.tar.gz servo-105c5d2a0692c6e09320c5d967b43f879c3cd00d.zip |
Auto merge of #18826 - emilio:invalidation-xbl-stuff, r=heycam
style: Fix invalidation collection for XBL when quirks modes don't match.
<!-- 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/18826)
<!-- Reviewable:end -->
-rw-r--r-- | components/style/invalidation/element/invalidator.rs | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/components/style/invalidation/element/invalidator.rs b/components/style/invalidation/element/invalidator.rs index 80d5f704360..540408db2f0 100644 --- a/components/style/invalidation/element/invalidator.rs +++ b/components/style/invalidation/element/invalidator.rs @@ -6,7 +6,7 @@ //! element styles need to be invalidated. use Atom; -use context::{SharedStyleContext, StackLimitChecker}; +use context::{QuirksMode, SharedStyleContext, StackLimitChecker}; use data::ElementData; use dom::{TElement, TNode}; use element_state::{ElementState, IN_VISITED_OR_UNVISITED_STATE}; @@ -262,7 +262,7 @@ impl<'a, 'b: 'a, E> TreeStyleInvalidator<'a, 'b, E> state_changes, element: self.element, snapshot: &snapshot, - shared_context: self.shared_context, + quirks_mode: self.shared_context.quirks_mode(), removed_id: id_removed.as_ref(), added_id: id_added.as_ref(), classes_removed: &classes_removed, @@ -282,6 +282,10 @@ impl<'a, 'b: 'a, E> TreeStyleInvalidator<'a, 'b, E> // just at that map. let _cut_off_inheritance = self.element.each_xbl_stylist(|stylist| { + // FIXME(emilio): Replace with assert / remove when we + // figure out what to do with the quirks mode mismatches + // (that is, when bug 1406875 is properly fixed). + collector.quirks_mode = stylist.quirks_mode(); stylist.each_invalidation_map(|invalidation_map| { collector.collect_dependencies_in_invalidation_map(invalidation_map); }); @@ -823,7 +827,7 @@ struct InvalidationCollector<'a, 'b: 'a, E> wrapper: ElementWrapper<'b, E>, nth_index_cache: Option<&'a mut NthIndexCache>, snapshot: &'a Snapshot, - shared_context: &'a SharedStyleContext<'b>, + quirks_mode: QuirksMode, lookup_element: E, removed_id: Option<&'a Atom>, added_id: Option<&'a Atom>, @@ -842,7 +846,7 @@ impl<'a, 'b: 'a, E> InvalidationCollector<'a, 'b, E> &mut self, map: &InvalidationMap, ) { - let quirks_mode = self.shared_context.quirks_mode(); + let quirks_mode = self.quirks_mode; let removed_id = self.removed_id; if let Some(ref id) = removed_id { if let Some(deps) = map.id_to_selector.get(id, quirks_mode) { @@ -895,7 +899,7 @@ impl<'a, 'b: 'a, E> InvalidationCollector<'a, 'b, E> ) { map.lookup_with_additional( self.lookup_element, - self.shared_context.quirks_mode(), + self.quirks_mode, self.removed_id, self.classes_removed, &mut |dependency| { @@ -912,7 +916,7 @@ impl<'a, 'b: 'a, E> InvalidationCollector<'a, 'b, E> ) { map.lookup_with_additional( self.lookup_element, - self.shared_context.quirks_mode(), + self.quirks_mode, self.removed_id, self.classes_removed, &mut |dependency| { @@ -945,7 +949,7 @@ impl<'a, 'b: 'a, E> InvalidationCollector<'a, 'b, E> None, self.nth_index_cache.as_mut().map(|c| &mut **c), visited_handling_mode, - self.shared_context.quirks_mode(), + self.quirks_mode, ); let matches_now = matches_selector( @@ -966,7 +970,7 @@ impl<'a, 'b: 'a, E> InvalidationCollector<'a, 'b, E> None, self.nth_index_cache.as_mut().map(|c| &mut **c), visited_handling_mode, - self.shared_context.quirks_mode(), + self.quirks_mode, ); let matched_then = matches_selector( |