#include "third_party/blink/renderer/core/css/invalidation/rule_invalidation_data_visitor.h"
#include "third_party/blink/renderer/core/css/css_selector_list.h"
#include "third_party/blink/renderer/core/css/style_scope.h"
#include "third_party/blink/renderer/core/inspector/invalidation_set_to_selector_map.h"
namespace blink {
namespace {
bool SupportsInvalidation(CSSSelector::MatchType match) { … }
bool SupportsInvalidation(CSSSelector::PseudoType type) { … }
bool SupportsInvalidationWithSelectorList(CSSSelector::PseudoType pseudo) { … }
bool RequiresSubtreeInvalidation(const CSSSelector& selector) { … }
scoped_refptr<InvalidationSet> CopyInvalidationSet(
const InvalidationSet& invalidation_set) { … }
}
template <RuleInvalidationDataVisitorType VisitorType>
RuleInvalidationDataVisitor<VisitorType>::RuleInvalidationDataVisitor(
RuleInvalidationDataType& rule_invalidation_data)
: … { … }
template <RuleInvalidationDataVisitorType VisitorType>
void RuleInvalidationDataVisitor<VisitorType>::InvalidationSetFeatures::Merge(
const InvalidationSetFeatures& other) { … }
template <RuleInvalidationDataVisitorType VisitorType>
bool RuleInvalidationDataVisitor<
VisitorType>::InvalidationSetFeatures::HasFeatures() const { … }
template <RuleInvalidationDataVisitorType VisitorType>
bool RuleInvalidationDataVisitor<
VisitorType>::InvalidationSetFeatures::HasIdClassOrAttribute() const { … }
template <RuleInvalidationDataVisitorType VisitorType>
void RuleInvalidationDataVisitor<VisitorType>::InvalidationSetFeatures::
NarrowToFeatures(const InvalidationSetFeatures& other) { … }
template <RuleInvalidationDataVisitorType VisitorType>
SelectorPreMatch
RuleInvalidationDataVisitor<VisitorType>::CollectFeaturesFromSelector(
const CSSSelector& selector,
const StyleScope* style_scope) { … }
template <RuleInvalidationDataVisitorType VisitorType>
SelectorPreMatch
RuleInvalidationDataVisitor<VisitorType>::CollectMetadataFromSelector(
const CSSSelector& selector,
unsigned max_direct_adjacent_selectors,
FeatureMetadata& metadata) { … }
template <RuleInvalidationDataVisitorType VisitorType>
void RuleInvalidationDataVisitor<VisitorType>::UpdateInvalidationSets(
const CSSSelector& selector,
const StyleScope* style_scope) { … }
template <RuleInvalidationDataVisitorType VisitorType>
RuleInvalidationDataVisitor<VisitorType>::FeatureInvalidationType
RuleInvalidationDataVisitor<VisitorType>::UpdateInvalidationSetsForComplex(
const CSSSelector& complex,
bool in_nth_child,
const StyleScope* style_scope,
InvalidationSetFeatures& features,
PositionType position,
CSSSelector::PseudoType pseudo_type) { … }
template <RuleInvalidationDataVisitorType VisitorType>
void RuleInvalidationDataVisitor<VisitorType>::UpdateFeaturesFromCombinator(
CSSSelector::RelationType combinator,
const CSSSelector* last_compound_in_adjacent_chain,
InvalidationSetFeatures& last_compound_in_adjacent_chain_features,
InvalidationSetFeatures*& sibling_features,
InvalidationSetFeatures& descendant_features,
bool for_logical_combination_in_has,
bool in_nth_child) { … }
template <RuleInvalidationDataVisitorType VisitorType>
void RuleInvalidationDataVisitor<VisitorType>::UpdateFeaturesFromStyleScope(
const StyleScope& style_scope,
InvalidationSetFeatures& descendant_features) { … }
template <RuleInvalidationDataVisitorType VisitorType>
void RuleInvalidationDataVisitor<VisitorType>::
ExtractInvalidationSetFeaturesFromSimpleSelector(
const CSSSelector& selector,
InvalidationSetFeatures& features) { … }
template <RuleInvalidationDataVisitorType VisitorType>
const CSSSelector* RuleInvalidationDataVisitor<VisitorType>::
ExtractInvalidationSetFeaturesFromCompound(
const CSSSelector& compound,
InvalidationSetFeatures& features,
PositionType position,
bool for_logical_combination_in_has,
bool in_nth_child) { … }
template <RuleInvalidationDataVisitorType VisitorType>
void RuleInvalidationDataVisitor<VisitorType>::
ExtractInvalidationSetFeaturesFromSelectorList(
const CSSSelector& simple_selector,
bool in_nth_child,
InvalidationSetFeatures& features,
PositionType position) { … }
template <RuleInvalidationDataVisitorType VisitorType>
void RuleInvalidationDataVisitor<VisitorType>::AddFeaturesToInvalidationSets(
const CSSSelector& selector,
bool in_nth_child,
InvalidationSetFeatures* sibling_features,
InvalidationSetFeatures& descendant_features) { … }
template <RuleInvalidationDataVisitorType VisitorType>
const CSSSelector* RuleInvalidationDataVisitor<VisitorType>::
AddFeaturesToInvalidationSetsForCompoundSelector(
const CSSSelector& compound,
bool in_nth_child,
InvalidationSetFeatures* sibling_features,
InvalidationSetFeatures& descendant_features) { … }
template <RuleInvalidationDataVisitorType VisitorType>
void RuleInvalidationDataVisitor<VisitorType>::
AddFeaturesToInvalidationSetsForSimpleSelector(
const CSSSelector& simple_selector,
const CSSSelector& compound,
bool in_nth_child,
InvalidationSetFeatures* sibling_features,
InvalidationSetFeatures& descendant_features) { … }
template <RuleInvalidationDataVisitorType VisitorType>
void RuleInvalidationDataVisitor<VisitorType>::
AddFeaturesToInvalidationSetsForSelectorList(
const CSSSelector& simple_selector,
bool in_nth_child,
InvalidationSetFeatures* sibling_features,
InvalidationSetFeatures& descendant_features) { … }
template <RuleInvalidationDataVisitorType VisitorType>
void RuleInvalidationDataVisitor<VisitorType>::
AddFeaturesToInvalidationSetsForStyleScope(
const StyleScope& style_scope,
InvalidationSetFeatures& descendant_features) { … }
template <RuleInvalidationDataVisitorType VisitorType>
void RuleInvalidationDataVisitor<VisitorType>::
AddFeaturesToUniversalSiblingInvalidationSet(
const InvalidationSetFeatures& sibling_features,
const InvalidationSetFeatures& descendant_features) { … }
template <RuleInvalidationDataVisitorType VisitorType>
void RuleInvalidationDataVisitor<VisitorType>::
AddValuesInComplexSelectorInsideIsWhereNot(
const CSSSelector* selector_first) { … }
template <RuleInvalidationDataVisitorType VisitorType>
bool RuleInvalidationDataVisitor<VisitorType>::
AddValueOfSimpleSelectorInHasArgument(const CSSSelector& selector) { … }
template <RuleInvalidationDataVisitorType VisitorType>
void RuleInvalidationDataVisitor<VisitorType>::CollectValuesInHasArgument(
const CSSSelector& has_pseudo_class) { … }
template <RuleInvalidationDataVisitorType VisitorType>
void RuleInvalidationDataVisitor<VisitorType>::
AddFeaturesToInvalidationSetsForHasPseudoClass(
const CSSSelector& pseudo_has,
const CSSSelector* compound_containing_has,
InvalidationSetFeatures* sibling_features,
InvalidationSetFeatures& descendant_features,
bool in_nth_child) { … }
template <RuleInvalidationDataVisitorType VisitorType>
struct RuleInvalidationDataVisitor<VisitorType>::
AddFeaturesToInvalidationSetsForLogicalCombinationInHasContext { … };
template <RuleInvalidationDataVisitorType VisitorType>
void RuleInvalidationDataVisitor<VisitorType>::
AddFeaturesToInvalidationSetsForLogicalCombinationInHas(
const CSSSelector& logical_combination,
const CSSSelector* compound_containing_has,
InvalidationSetFeatures* sibling_features,
InvalidationSetFeatures& descendant_features,
CSSSelector::RelationType previous_combinator,
AddFeaturesMethodForLogicalCombinationInHas add_features_method) { … }
template <RuleInvalidationDataVisitorType VisitorType>
void RuleInvalidationDataVisitor<VisitorType>::
UpdateFeaturesFromCombinatorForLogicalCombinationInHas(
CSSSelector::RelationType combinator,
const CSSSelector* last_compound_in_adjacent_chain,
InvalidationSetFeatures& last_compound_in_adjacent_chain_features,
InvalidationSetFeatures*& sibling_features,
InvalidationSetFeatures& descendant_features) { … }
template <RuleInvalidationDataVisitorType VisitorType>
const CSSSelector* RuleInvalidationDataVisitor<VisitorType>::
SkipAddingAndGetLastInCompoundForLogicalCombinationInHas(
const CSSSelector* compound_in_logical_combination,
const CSSSelector* compound_containing_has,
InvalidationSetFeatures* sibling_features,
InvalidationSetFeatures& descendant_features,
CSSSelector::RelationType previous_combinator,
AddFeaturesMethodForLogicalCombinationInHas add_features_method) { … }
template <RuleInvalidationDataVisitorType VisitorType>
const CSSSelector* RuleInvalidationDataVisitor<VisitorType>::
AddFeaturesAndGetLastInCompoundForLogicalCombinationInHas(
const CSSSelector* compound_in_logical_combination,
const CSSSelector* compound_containing_has,
InvalidationSetFeatures* sibling_features,
InvalidationSetFeatures& descendant_features,
CSSSelector::RelationType previous_combinator,
AddFeaturesMethodForLogicalCombinationInHas add_features_method) { … }
template <RuleInvalidationDataVisitorType VisitorType>
void RuleInvalidationDataVisitor<VisitorType>::
MarkInvalidationSetsWithinNthChild(const CSSSelector& selector,
bool in_nth_child) { … }
template <RuleInvalidationDataVisitorType VisitorType>
RuleInvalidationDataVisitor<VisitorType>::InvalidationSetType*
RuleInvalidationDataVisitor<VisitorType>::InvalidationSetForSimpleSelector(
const CSSSelector& selector,
InvalidationType type,
PositionType position,
bool in_nth_child) { … }
template <RuleInvalidationDataVisitorType VisitorType>
RuleInvalidationDataVisitor<VisitorType>::InvalidationSetType*
RuleInvalidationDataVisitor<VisitorType>::EnsureClassInvalidationSet(
const AtomicString& class_name,
InvalidationType type,
PositionType position,
bool in_nth_child) { … }
template <RuleInvalidationDataVisitorType VisitorType>
RuleInvalidationDataVisitor<VisitorType>::InvalidationSetType*
RuleInvalidationDataVisitor<VisitorType>::EnsureAttributeInvalidationSet(
const AtomicString& attribute_name,
InvalidationType type,
PositionType position,
bool in_nth_child) { … }
template <RuleInvalidationDataVisitorType VisitorType>
RuleInvalidationDataVisitor<VisitorType>::InvalidationSetType*
RuleInvalidationDataVisitor<VisitorType>::EnsureIdInvalidationSet(
const AtomicString& id,
InvalidationType type,
PositionType position,
bool in_nth_child) { … }
template <RuleInvalidationDataVisitorType VisitorType>
RuleInvalidationDataVisitor<VisitorType>::InvalidationSetType*
RuleInvalidationDataVisitor<VisitorType>::EnsurePseudoInvalidationSet(
CSSSelector::PseudoType pseudo_type,
InvalidationType type,
PositionType position,
bool in_nth_child) { … }
template <RuleInvalidationDataVisitorType VisitorType>
RuleInvalidationDataVisitor<VisitorType>::InvalidationSetType*
RuleInvalidationDataVisitor<VisitorType>::EnsureInvalidationSet(
InvalidationSetMapType& map,
const AtomicString& key,
InvalidationType type,
PositionType position,
bool in_nth_child) { … }
template <RuleInvalidationDataVisitorType VisitorType>
RuleInvalidationDataVisitor<VisitorType>::InvalidationSetType*
RuleInvalidationDataVisitor<VisitorType>::EnsureInvalidationSet(
PseudoTypeInvalidationSetMapType& map,
CSSSelector::PseudoType key,
InvalidationType type,
PositionType position,
bool in_nth_child) { … }
template <RuleInvalidationDataVisitorType VisitorType>
RuleInvalidationDataVisitor<VisitorType>::SiblingInvalidationSetType*
RuleInvalidationDataVisitor<
VisitorType>::EnsureUniversalSiblingInvalidationSet() { … }
template <RuleInvalidationDataVisitorType VisitorType>
RuleInvalidationDataVisitor<VisitorType>::SiblingInvalidationSetType*
RuleInvalidationDataVisitor<VisitorType>::EnsureNthInvalidationSet() { … }
template <RuleInvalidationDataVisitorType VisitorType>
void RuleInvalidationDataVisitor<VisitorType>::AddFeaturesToInvalidationSet(
InvalidationSetType* invalidation_set,
const InvalidationSetFeatures& features) { … }
template <RuleInvalidationDataVisitorType VisitorType>
void RuleInvalidationDataVisitor<VisitorType>::SetWholeSubtreeInvalid(
InvalidationSetType* invalidation_set) { … }
template <RuleInvalidationDataVisitorType VisitorType>
void RuleInvalidationDataVisitor<VisitorType>::SetInvalidatesSelf(
InvalidationSetType* invalidation_set) { … }
template <RuleInvalidationDataVisitorType VisitorType>
void RuleInvalidationDataVisitor<VisitorType>::SetInvalidatesNth(
InvalidationSetType* invalidation_set) { … }
template <RuleInvalidationDataVisitorType VisitorType>
void RuleInvalidationDataVisitor<VisitorType>::UpdateMaxDirectAdjacentSelectors(
SiblingInvalidationSetType* invalidation_set,
unsigned value) { … }
template <RuleInvalidationDataVisitorType VisitorType>
bool RuleInvalidationDataVisitor<VisitorType>::
InsertIntoSelfInvalidationBloomFilter(const AtomicString& value, int salt) { … }
template <RuleInvalidationDataVisitorType VisitorType>
RuleInvalidationDataVisitor<VisitorType>::InvalidationSetType*
RuleInvalidationDataVisitor<VisitorType>::
EnsureSiblingDescendantInvalidationSet(
SiblingInvalidationSetType* invalidation_set) { … }
template <RuleInvalidationDataVisitorType VisitorType>
InvalidationSet&
RuleInvalidationDataVisitor<VisitorType>::EnsureMutableInvalidationSet(
InvalidationType type,
PositionType position,
bool in_nth_child,
scoped_refptr<InvalidationSet>& invalidation_set) { … }
template class RuleInvalidationDataVisitor<
RuleInvalidationDataVisitorType::kBuilder>;
template class RuleInvalidationDataVisitor<
RuleInvalidationDataVisitorType::kTracer>;
}