本文整理汇总了C++中ShadowRoot::containsShadowElements方法的典型用法代码示例。如果您正苦于以下问题:C++ ShadowRoot::containsShadowElements方法的具体用法?C++ ShadowRoot::containsShadowElements怎么用?C++ ShadowRoot::containsShadowElements使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ShadowRoot
的用法示例。
在下文中一共展示了ShadowRoot::containsShadowElements方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: containsActiveStyles
bool ElementShadow::containsActiveStyles() const
{
for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadowRoot()) {
if (root->hasScopedHTMLStyleChild())
return true;
if (!root->containsShadowElements())
return false;
}
return false;
}
示例2: collectScopedResolversForHostedShadowTrees
void ScopedStyleTree::collectScopedResolversForHostedShadowTrees(const Element* element, Vector<ScopedStyleResolver*, 8>& resolvers)
{
ElementShadow* shadow = element->shadow();
if (!shadow)
return;
// Adding scoped resolver for active shadow roots for shadow host styling.
for (ShadowRoot* shadowRoot = shadow->youngestShadowRoot(); shadowRoot; shadowRoot = shadowRoot->olderShadowRoot()) {
if (shadowRoot->hasScopedHTMLStyleChild()) {
if (ScopedStyleResolver* resolver = scopedStyleResolverFor(*shadowRoot))
resolvers.append(resolver);
}
if (!shadowRoot->containsShadowElements())
break;
}
}
示例3: matchHostRules
void ScopedStyleResolver::matchHostRules(ElementRuleCollector& collector, bool includeEmptyRules)
{
// FIXME: Determine tree position.
CascadeScope cascadeScope = ignoreCascadeScope;
if (m_atHostRules.isEmpty() || !m_scopingNode.isElementNode())
return;
ElementShadow* shadow = toElement(m_scopingNode).shadow();
if (!shadow)
return;
collector.clearMatchedRules();
collector.matchedResult().ranges.lastAuthorRule = collector.matchedResult().matchedProperties.size() - 1;
// FIXME(99827): https://bugs.webkit.org/show_bug.cgi?id=99827
// add a new flag to ElementShadow and cache whether any @host @-rules are
// applied to the element or not. So we can quickly exit this method
// by using the flag.
ShadowRoot* shadowRoot = shadow->youngestShadowRoot();
for (; shadowRoot; shadowRoot = shadowRoot->olderShadowRoot())
if (!shadowRoot->containsShadowElements())
break;
// All shadow roots have <shadow>.
if (!shadowRoot)
shadowRoot = shadow->oldestShadowRoot();
RuleRange ruleRange = collector.matchedResult().ranges.authorRuleRange();
SelectorChecker::BehaviorAtBoundary boundary = static_cast<SelectorChecker::BehaviorAtBoundary>(SelectorChecker::DoesNotCrossBoundary | SelectorChecker::ScopeContainsLastMatchedElement);
for (; shadowRoot; shadowRoot = shadowRoot->youngerShadowRoot()) {
if (RuleSet* ruleSet = atHostRuleSetFor(shadowRoot))
collector.collectMatchingRules(MatchRequest(ruleSet, includeEmptyRules, &m_scopingNode), ruleRange, boundary, cascadeScope);
}
collector.sortAndTransferMatchedRules();
}