本文整理汇总了C++中RuleData::selectorIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ RuleData::selectorIndex方法的具体用法?C++ RuleData::selectorIndex怎么用?C++ RuleData::selectorIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RuleData
的用法示例。
在下文中一共展示了RuleData::selectorIndex方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: collectFeatures
void RuleFeatureSet::collectFeatures(const RuleData& ruleData)
{
SelectorFeatures selectorFeatures;
recursivelyCollectFeaturesFromSelector(selectorFeatures, *ruleData.selector());
if (selectorFeatures.hasSiblingSelector)
siblingRules.append(RuleFeature(ruleData.rule(), ruleData.selectorIndex(), ruleData.hasDocumentSecurityOrigin()));
if (ruleData.containsUncommonAttributeSelector())
uncommonAttributeRules.append(RuleFeature(ruleData.rule(), ruleData.selectorIndex(), ruleData.hasDocumentSecurityOrigin()));
for (auto* className : selectorFeatures.classesMatchingAncestors) {
auto addResult = ancestorClassRules.ensure(className, [] {
return std::make_unique<Vector<RuleFeature>>();
});
addResult.iterator->value->append(RuleFeature(ruleData.rule(), ruleData.selectorIndex(), ruleData.hasDocumentSecurityOrigin()));
}
for (auto* selector : selectorFeatures.attributeSelectorsMatchingAncestors) {
// Hashing by attributeCanonicalLocalName makes this HTML specific.
auto addResult = ancestorAttributeRulesForHTML.ensure(selector->attributeCanonicalLocalName().impl(), [] {
return std::make_unique<AttributeRules>();
});
auto& rules = *addResult.iterator->value;
rules.features.append(RuleFeature(ruleData.rule(), ruleData.selectorIndex(), ruleData.hasDocumentSecurityOrigin()));
// Deduplicate selectors.
rules.selectors.add(makeAttributeSelectorKey(*selector), selector);
}
}
示例2: collectFeaturesFromRuleData
static void collectFeaturesFromRuleData(RuleFeatureSet& features, const RuleData& ruleData)
{
bool hasSiblingSelector;
features.collectFeaturesFromSelector(*ruleData.selector(), hasSiblingSelector);
if (hasSiblingSelector)
features.siblingRules.append(RuleFeature(ruleData.rule(), ruleData.selectorIndex(), ruleData.hasDocumentSecurityOrigin()));
if (ruleData.containsUncommonAttributeSelector())
features.uncommonAttributeRules.append(RuleFeature(ruleData.rule(), ruleData.selectorIndex(), ruleData.hasDocumentSecurityOrigin()));
}
示例3: collectFeaturesFromRuleData
void RuleFeatureSet::collectFeaturesFromRuleData(const RuleData& ruleData)
{
updateInvalidationSets(ruleData);
FeatureMetadata metadata;
collectFeaturesFromSelector(ruleData.selector(), metadata);
m_metadata.add(metadata);
if (metadata.foundSiblingSelector)
siblingRules.append(RuleFeature(ruleData.rule(), ruleData.selectorIndex(), ruleData.hasDocumentSecurityOrigin()));
if (ruleData.containsUncommonAttributeSelector())
uncommonAttributeRules.append(RuleFeature(ruleData.rule(), ruleData.selectorIndex(), ruleData.hasDocumentSecurityOrigin()));
}
示例4: collectFeaturesFromRuleData
void RuleFeatureSet::collectFeaturesFromRuleData(const RuleData& ruleData)
{
FeatureMetadata metadata;
bool selectorUsesClassInvalidationSet = false;
if (m_targetedStyleRecalcEnabled)
selectorUsesClassInvalidationSet = updateClassInvalidationSets(ruleData.selector());
SelectorFeatureCollectionMode collectionMode;
if (selectorUsesClassInvalidationSet)
collectionMode = DontProcessClasses;
else
collectionMode = ProcessClasses;
collectFeaturesFromSelector(ruleData.selector(), metadata, collectionMode);
m_metadata.add(metadata);
if (metadata.foundSiblingSelector)
siblingRules.append(RuleFeature(ruleData.rule(), ruleData.selectorIndex(), ruleData.hasDocumentSecurityOrigin()));
if (ruleData.containsUncommonAttributeSelector())
uncommonAttributeRules.append(RuleFeature(ruleData.rule(), ruleData.selectorIndex(), ruleData.hasDocumentSecurityOrigin()));
}