mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
style: Move invalidation map into PerOriginCascadeData.
This commit is contained in:
parent
77c4a42e5d
commit
16937ba7cd
4 changed files with 34 additions and 17 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue