本文整理汇总了C++中ShadowRoot::hasShadowInsertionPoint方法的典型用法代码示例。如果您正苦于以下问题:C++ ShadowRoot::hasShadowInsertionPoint方法的具体用法?C++ ShadowRoot::hasShadowInsertionPoint怎么用?C++ ShadowRoot::hasShadowInsertionPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ShadowRoot
的用法示例。
在下文中一共展示了ShadowRoot::hasShadowInsertionPoint方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: matchHostRules
void StyleScopeResolver::matchHostRules(const Element* element, Vector<RuleSet*>& matchedRules)
{
if (m_atHostRules.isEmpty())
return;
ElementShadow* shadow = element->shadow();
if (!shadow)
return;
// 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.
for (ShadowRoot* shadowRoot = shadow->youngestShadowRoot(); shadowRoot; shadowRoot = shadowRoot->olderShadowRoot()) {
if (RuleSet* ruleSet = atHostRuleSetFor(shadowRoot))
matchedRules.append(ruleSet);
if (!shadowRoot->hasShadowInsertionPoint())
break;
}
}
示例2: styleSharingCandidateMatchesHostRules
bool StyleScopeResolver::styleSharingCandidateMatchesHostRules(const Element* element)
{
if (m_atHostRules.isEmpty())
return false;
ElementShadow* shadow = element->shadow();
if (!shadow)
return false;
// FIXME(99827): https://bugs.webkit.org/show_bug.cgi?id=99827
// add a new flag to ElementShadow and cache whether [email protected] @-rules are
// applied to the element or not. So we can avoid always traversing
// shadow roots.
for (ShadowRoot* shadowRoot = shadow->youngestShadowRoot(); shadowRoot; shadowRoot = shadowRoot->olderShadowRoot()) {
if (atHostRuleSetFor(shadowRoot))
return true;
if (!shadowRoot->hasShadowInsertionPoint())
break;
}
return false;
}