本文整理汇总了C++中StyleRuleBase::isKeyframesRule方法的典型用法代码示例。如果您正苦于以下问题:C++ StyleRuleBase::isKeyframesRule方法的具体用法?C++ StyleRuleBase::isKeyframesRule怎么用?C++ StyleRuleBase::isKeyframesRule使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StyleRuleBase
的用法示例。
在下文中一共展示了StyleRuleBase::isKeyframesRule方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addChildRules
void RuleSet::addChildRules(const WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>>& rules, const MediaQueryEvaluator& medium, AddRuleFlags addRuleFlags)
{
for (unsigned i = 0; i < rules.size(); ++i) {
StyleRuleBase* rule = rules[i].get();
if (rule->isStyleRule()) {
StyleRule* styleRule = toStyleRule(rule);
const CSSSelectorList& selectorList = styleRule->selectorList();
for (size_t selectorIndex = 0; selectorIndex != kNotFound; selectorIndex = selectorList.indexOfNextSelectorAfter(selectorIndex)) {
if (selectorList.selectorCrossesTreeScopes(selectorIndex)) {
m_treeBoundaryCrossingRules.append(MinimalRuleData(styleRule, selectorIndex, addRuleFlags));
} else if (selectorList.hasShadowDistributedAt(selectorIndex)) {
m_shadowDistributedRules.append(MinimalRuleData(styleRule, selectorIndex, addRuleFlags));
} else {
addRule(styleRule, selectorIndex, addRuleFlags);
}
}
} else if (rule->isPageRule()) {
addPageRule(toStyleRulePage(rule));
} else if (rule->isMediaRule()) {
StyleRuleMedia* mediaRule = toStyleRuleMedia(rule);
if ((!mediaRule->mediaQueries() || medium.eval(mediaRule->mediaQueries(), &m_viewportDependentMediaQueryResults)))
addChildRules(mediaRule->childRules(), medium, addRuleFlags);
} else if (rule->isFontFaceRule()) {
addFontFaceRule(toStyleRuleFontFace(rule));
} else if (rule->isKeyframesRule()) {
addKeyframesRule(toStyleRuleKeyframes(rule));
} else if (rule->isViewportRule()) {
addViewportRule(toStyleRuleViewport(rule));
} else if (rule->isSupportsRule() && toStyleRuleSupports(rule)->conditionIsSupported()) {
addChildRules(toStyleRuleSupports(rule)->childRules(), medium, addRuleFlags);
}
}
}
示例2: addChildRules
void RuleSet::addChildRules(const Vector<RefPtr<StyleRuleBase> >& rules, const MediaQueryEvaluator& medium, StyleResolver* resolver, const ContainerNode* scope, bool hasDocumentSecurityOrigin, AddRuleFlags addRuleFlags)
{
for (unsigned i = 0; i < rules.size(); ++i) {
StyleRuleBase* rule = rules[i].get();
if (rule->isStyleRule()) {
StyleRule* styleRule = static_cast<StyleRule*>(rule);
const CSSSelectorList& selectorList = styleRule->selectorList();
for (size_t selectorIndex = 0; selectorIndex != notFound; selectorIndex = selectorList.indexOfNextSelectorAfter(selectorIndex)) {
if (selectorList.hasShadowDistributedAt(selectorIndex)) {
if (isDocumentScope(scope))
continue;
resolver->ruleSets().shadowDistributedRules().addRule(styleRule, selectorIndex, const_cast<ContainerNode*>(scope), addRuleFlags);
} else
addRule(styleRule, selectorIndex, addRuleFlags);
}
} else if (rule->isPageRule())
addPageRule(static_cast<StyleRulePage*>(rule));
else if (rule->isMediaRule()) {
StyleRuleMedia* mediaRule = static_cast<StyleRuleMedia*>(rule);
if ((!mediaRule->mediaQueries() || medium.eval(mediaRule->mediaQueries(), resolver)))
addChildRules(mediaRule->childRules(), medium, resolver, scope, hasDocumentSecurityOrigin, addRuleFlags);
} else if (rule->isFontFaceRule() && resolver) {
// Add this font face to our set.
// FIXME(BUG 72461): We don't add @font-face rules of scoped style sheets for the moment.
if (!isDocumentScope(scope))
continue;
const StyleRuleFontFace* fontFaceRule = static_cast<StyleRuleFontFace*>(rule);
resolver->fontSelector()->addFontFaceRule(fontFaceRule);
resolver->invalidateMatchedPropertiesCache();
} else if (rule->isKeyframesRule() && resolver) {
// FIXME (BUG 72462): We don't add @keyframe rules of scoped style sheets for the moment.
if (!isDocumentScope(scope))
continue;
resolver->addKeyframeStyle(static_cast<StyleRuleKeyframes*>(rule));
}
else if (rule->isRegionRule() && resolver) {
// FIXME (BUG 72472): We don't add @-webkit-region rules of scoped style sheets for the moment.
addRegionRule(static_cast<StyleRuleRegion*>(rule), hasDocumentSecurityOrigin);
}
else if (rule->isHostRule())
resolver->ensureScopedStyleResolver(scope->shadowHost())->addHostRule(static_cast<StyleRuleHost*>(rule), hasDocumentSecurityOrigin, scope);
#if ENABLE(CSS_DEVICE_ADAPTATION)
else if (rule->isViewportRule() && resolver) {
// @viewport should not be scoped.
if (!isDocumentScope(scope))
continue;
resolver->viewportStyleResolver()->addViewportRule(static_cast<StyleRuleViewport*>(rule));
}
#endif
else if (rule->isSupportsRule() && static_cast<StyleRuleSupports*>(rule)->conditionIsSupported())
addChildRules(static_cast<StyleRuleSupports*>(rule)->childRules(), medium, resolver, scope, hasDocumentSecurityOrigin, addRuleFlags);
}
}
示例3: addChildRules
void RuleSet::addChildRules(const Vector<RefPtr<StyleRuleBase>>& rules, const MediaQueryEvaluator& medium, StyleResolver* resolver, const ContainerNode* scope, bool hasDocumentSecurityOrigin, AddRuleFlags addRuleFlags)
{
for (unsigned i = 0; i < rules.size(); ++i) {
StyleRuleBase* rule = rules[i].get();
if (rule->isStyleRule()) {
StyleRule* styleRule = static_cast<StyleRule*>(rule);
addStyleRule(styleRule, addRuleFlags);
} else if (rule->isPageRule())
addPageRule(static_cast<StyleRulePage*>(rule));
else if (rule->isMediaRule()) {
StyleRuleMedia* mediaRule = static_cast<StyleRuleMedia*>(rule);
if ((!mediaRule->mediaQueries() || medium.eval(mediaRule->mediaQueries(), resolver)))
addChildRules(mediaRule->childRules(), medium, resolver, scope, hasDocumentSecurityOrigin, addRuleFlags);
} else if (rule->isFontFaceRule() && resolver) {
// Add this font face to our set.
// FIXME(BUG 72461): We don't add @font-face rules of scoped style sheets for the moment.
if (scope)
continue;
const StyleRuleFontFace* fontFaceRule = static_cast<StyleRuleFontFace*>(rule);
resolver->fontSelector()->addFontFaceRule(fontFaceRule);
resolver->invalidateMatchedPropertiesCache();
} else if (rule->isKeyframesRule() && resolver) {
// FIXME (BUG 72462): We don't add @keyframe rules of scoped style sheets for the moment.
if (scope)
continue;
resolver->addKeyframeStyle(static_cast<StyleRuleKeyframes*>(rule));
}
#if ENABLE(CSS_REGIONS)
else if (rule->isRegionRule() && resolver) {
// FIXME (BUG 72472): We don't add @-webkit-region rules of scoped style sheets for the moment.
if (scope)
continue;
addRegionRule(static_cast<StyleRuleRegion*>(rule), hasDocumentSecurityOrigin);
}
#endif
#if ENABLE(SHADOW_DOM)
else if (rule->isHostRule())
resolver->addHostRule(static_cast<StyleRuleHost*>(rule), hasDocumentSecurityOrigin, scope);
#endif
#if ENABLE(CSS_DEVICE_ADAPTATION)
else if (rule->isViewportRule() && resolver) {
// @viewport should not be scoped.
if (scope)
continue;
resolver->viewportStyleResolver()->addViewportRule(static_cast<StyleRuleViewport*>(rule));
}
#endif
#if ENABLE(CSS3_CONDITIONAL_RULES)
else if (rule->isSupportsRule() && static_cast<StyleRuleSupports*>(rule)->conditionIsSupported())
addChildRules(static_cast<StyleRuleSupports*>(rule)->childRules(), medium, resolver, scope, hasDocumentSecurityOrigin, addRuleFlags);
#endif
}
}
示例4: addChildRules
void RuleSet::addChildRules(const Vector<RefPtr<StyleRuleBase>>& rules, const MediaQueryEvaluator& medium, StyleResolver* resolver, bool hasDocumentSecurityOrigin, AddRuleFlags addRuleFlags)
{
for (unsigned i = 0; i < rules.size(); ++i) {
StyleRuleBase* rule = rules[i].get();
if (rule->isStyleRule()) {
StyleRule* styleRule = static_cast<StyleRule*>(rule);
addStyleRule(styleRule, addRuleFlags);
} else if (rule->isPageRule())
addPageRule(static_cast<StyleRulePage*>(rule));
else if (rule->isMediaRule()) {
StyleRuleMedia* mediaRule = static_cast<StyleRuleMedia*>(rule);
if ((!mediaRule->mediaQueries() || medium.eval(mediaRule->mediaQueries(), resolver)))
addChildRules(mediaRule->childRules(), medium, resolver, hasDocumentSecurityOrigin, addRuleFlags);
} else if (rule->isFontFaceRule() && resolver) {
// Add this font face to our set.
const StyleRuleFontFace* fontFaceRule = static_cast<StyleRuleFontFace*>(rule);
resolver->fontSelector()->addFontFaceRule(fontFaceRule);
resolver->invalidateMatchedPropertiesCache();
} else if (rule->isKeyframesRule() && resolver) {
resolver->addKeyframeStyle(static_cast<StyleRuleKeyframes*>(rule));
}
#if ENABLE(CSS_REGIONS)
else if (rule->isRegionRule() && resolver) {
addRegionRule(static_cast<StyleRuleRegion*>(rule), hasDocumentSecurityOrigin);
}
#endif
#if ENABLE(CSS_DEVICE_ADAPTATION)
else if (rule->isViewportRule() && resolver) {
resolver->viewportStyleResolver()->addViewportRule(static_cast<StyleRuleViewport*>(rule));
}
#endif
#if ENABLE(CSS3_CONDITIONAL_RULES)
else if (rule->isSupportsRule() && static_cast<StyleRuleSupports*>(rule)->conditionIsSupported())
addChildRules(static_cast<StyleRuleSupports*>(rule)->childRules(), medium, resolver, hasDocumentSecurityOrigin, addRuleFlags);
#endif
}
}
示例5: addChildRules
void RuleSet::addChildRules(const Vector<RefPtr<StyleRuleBase> >& rules, const MediaQueryEvaluator& medium, AddRuleFlags addRuleFlags)
{
for (unsigned i = 0; i < rules.size(); ++i) {
StyleRuleBase* rule = rules[i].get();
if (rule->isStyleRule()) {
StyleRule* styleRule = toStyleRule(rule);
const CSSSelectorList& selectorList = styleRule->selectorList();
for (size_t selectorIndex = 0; selectorIndex != kNotFound; selectorIndex = selectorList.indexOfNextSelectorAfter(selectorIndex))
addRule(styleRule, selectorIndex, addRuleFlags);
} else if (rule->isMediaRule()) {
StyleRuleMedia* mediaRule = toStyleRuleMedia(rule);
if ((!mediaRule->mediaQueries() || medium.eval(mediaRule->mediaQueries(), &m_viewportDependentMediaQueryResults)))
addChildRules(mediaRule->childRules(), medium, addRuleFlags);
} else if (rule->isFontFaceRule()) {
addFontFaceRule(toStyleRuleFontFace(rule));
} else if (rule->isKeyframesRule()) {
addKeyframesRule(toStyleRuleKeyframes(rule));
} else if (rule->isSupportsRule() && toStyleRuleSupports(rule)->conditionIsSupported()) {
addChildRules(toStyleRuleSupports(rule)->childRules(), medium, addRuleFlags);
}
}
}
示例6: addRulesFromSheet
void RuleSet::addRulesFromSheet(StyleSheetContents* sheet, const MediaQueryEvaluator& medium, StyleResolver* resolver, const ContainerNode* scope)
{
ASSERT(sheet);
const Vector<RefPtr<StyleRuleImport> >& importRules = sheet->importRules();
for (unsigned i = 0; i < importRules.size(); ++i) {
StyleRuleImport* importRule = importRules[i].get();
if (importRule->styleSheet() && (!importRule->mediaQueries() || medium.eval(importRule->mediaQueries(), resolver)))
addRulesFromSheet(importRule->styleSheet(), medium, resolver, scope);
}
bool hasDocumentSecurityOrigin = resolver && resolver->document()->securityOrigin()->canRequest(sheet->baseURL());
AddRuleFlags addRuleFlags = static_cast<AddRuleFlags>((hasDocumentSecurityOrigin ? RuleHasDocumentSecurityOrigin : 0) | (!scope ? RuleCanUseFastCheckSelector : 0));
const Vector<RefPtr<StyleRuleBase> >& rules = sheet->childRules();
for (unsigned i = 0; i < rules.size(); ++i) {
StyleRuleBase* rule = rules[i].get();
ASSERT(!rule->isImportRule());
if (rule->isStyleRule())
addStyleRule(static_cast<StyleRule*>(rule), addRuleFlags);
else if (rule->isPageRule())
addPageRule(static_cast<StyleRulePage*>(rule));
else if (rule->isMediaRule()) {
StyleRuleMedia* mediaRule = static_cast<StyleRuleMedia*>(rule);
if ((!mediaRule->mediaQueries() || medium.eval(mediaRule->mediaQueries(), resolver))) {
// Traverse child elements of the @media rule.
const Vector<RefPtr<StyleRuleBase> >& childRules = mediaRule->childRules();
for (unsigned j = 0; j < childRules.size(); ++j) {
StyleRuleBase* childRule = childRules[j].get();
if (childRule->isStyleRule())
addStyleRule(static_cast<StyleRule*>(childRule), addRuleFlags);
else if (childRule->isPageRule())
addPageRule(static_cast<StyleRulePage*>(childRule));
else if (childRule->isFontFaceRule() && resolver) {
// Add this font face to our set.
// FIXME(BUG 72461): We don't add @font-face rules of scoped style sheets for the moment.
if (scope)
continue;
const StyleRuleFontFace* fontFaceRule = static_cast<StyleRuleFontFace*>(childRule);
resolver->fontSelector()->addFontFaceRule(fontFaceRule);
resolver->invalidateMatchedPropertiesCache();
} else if (childRule->isKeyframesRule() && resolver) {
// Add this keyframe rule to our set.
// FIXME(BUG 72462): We don't add @keyframe rules of scoped style sheets for the moment.
if (scope)
continue;
resolver->addKeyframeStyle(static_cast<StyleRuleKeyframes*>(childRule));
}
#if ENABLE(CSS_DEVICE_ADAPTATION)
else if (childRule->isViewportRule() && resolver && !resolver->affectedByViewportChange()) {
// @viewport should not be scoped.
if (scope)
continue;
resolver->viewportStyleResolver()->addViewportRule(static_cast<StyleRuleViewport*>(childRule));
}
#endif
} // for rules
} // if rules
} else if (rule->isFontFaceRule() && resolver) {
// Add this font face to our set.
// FIXME(BUG 72461): We don't add @font-face rules of scoped style sheets for the moment.
if (scope)
continue;
const StyleRuleFontFace* fontFaceRule = static_cast<StyleRuleFontFace*>(rule);
resolver->fontSelector()->addFontFaceRule(fontFaceRule);
resolver->invalidateMatchedPropertiesCache();
} else if (rule->isKeyframesRule() && resolver) {
// FIXME (BUG 72462): We don't add @keyframe rules of scoped style sheets for the moment.
if (scope)
continue;
resolver->addKeyframeStyle(static_cast<StyleRuleKeyframes*>(rule));
}
#if ENABLE(CSS_REGIONS)
else if (rule->isRegionRule() && resolver) {
// FIXME (BUG 72472): We don't add @-webkit-region rules of scoped style sheets for the moment.
if (scope)
continue;
addRegionRule(static_cast<StyleRuleRegion*>(rule), hasDocumentSecurityOrigin);
}
#endif
#if ENABLE(SHADOW_DOM)
else if (rule->isHostRule())
resolver->addHostRule(static_cast<StyleRuleHost*>(rule), hasDocumentSecurityOrigin, scope);
#endif
#if ENABLE(CSS_DEVICE_ADAPTATION)
else if (rule->isViewportRule() && resolver) {
// @viewport should not be scoped.
if (scope)
continue;
resolver->viewportStyleResolver()->addViewportRule(static_cast<StyleRuleViewport*>(rule));
}
#endif
}
if (m_autoShrinkToFitEnabled)
shrinkToFit();
}
示例7: reattach
void CSSKeyframesRule::reattach(StyleRuleBase& rule)
{
ASSERT_WITH_SECURITY_IMPLICATION(rule.isKeyframesRule());
m_keyframesRule = static_cast<StyleRuleKeyframes&>(rule);
}