style: Move invalidation map into PerOriginCascadeData.

This commit is contained in:
Cameron McCormack 2017-08-09 10:43:07 +08:00
parent 77c4a42e5d
commit 16937ba7cd
4 changed files with 34 additions and 17 deletions

View file

@ -109,7 +109,7 @@ impl SelectorMapEntry for Dependency {
/// The same, but for state selectors, which can track more exactly what state
/// do they track.
#[derive(Clone)]
#[derive(Clone, Debug)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub struct StateDependency {
/// The other dependency fields.
@ -132,6 +132,7 @@ impl SelectorMapEntry for StateDependency {
/// In particular, we want to lookup as few things as possible to get the fewer
/// selectors the better, so this looks up by id, class, or looks at the list of
/// state/other attribute affecting selectors.
#[derive(Debug)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub struct InvalidationMap {
/// A map from a given class name to all the selectors with that class

View file

@ -213,9 +213,9 @@ impl<'a, 'b: 'a, E> TreeStyleInvalidator<'a, 'b, E>
invalidates_self: false,
};
collector.collect_dependencies_in_invalidation_map(
shared_context.stylist.invalidation_map(),
);
shared_context.stylist.each_invalidation_map(|invalidation_map| {
collector.collect_dependencies_in_invalidation_map(invalidation_map);
});
// TODO(emilio): Consider storing dependencies from the UA sheet in
// a different map. If we do that, we can skip the stuff on the
@ -223,9 +223,9 @@ impl<'a, 'b: 'a, E> TreeStyleInvalidator<'a, 'b, E>
// just at that map.
let _cut_off_inheritance =
self.element.each_xbl_stylist(|stylist| {
collector.collect_dependencies_in_invalidation_map(
stylist.invalidation_map(),
);
stylist.each_invalidation_map(|invalidation_map| {
collector.collect_dependencies_in_invalidation_map(invalidation_map);
});
});
collector.invalidates_self