本文整理汇总了C++中TreeScope::scopedStyleResolver方法的典型用法代码示例。如果您正苦于以下问题:C++ TreeScope::scopedStyleResolver方法的具体用法?C++ TreeScope::scopedStyleResolver怎么用?C++ TreeScope::scopedStyleResolver使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TreeScope
的用法示例。
在下文中一共展示了TreeScope::scopedStyleResolver方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parent
ScopedStyleResolver* ScopedStyleResolver::parent() const
{
for (TreeScope* scope = treeScope().parentTreeScope(); scope; scope = scope->parentTreeScope()) {
if (ScopedStyleResolver* resolver = scope->scopedStyleResolver())
return resolver;
}
return nullptr;
}
示例2: updateActiveStyleSheets
void StyleEngine::updateActiveStyleSheets(StyleResolverUpdateMode updateMode)
{
ASSERT(isMaster());
ASSERT(!document().inStyleRecalc());
if (!document().isActive())
return;
if (shouldUpdateDocumentStyleSheetCollection(updateMode))
documentStyleSheetCollection()->updateActiveStyleSheets(this, updateMode);
if (shouldUpdateShadowTreeStyleSheetCollection(updateMode)) {
TreeScopeSet treeScopes = updateMode == FullStyleUpdate ? m_activeTreeScopes : m_dirtyTreeScopes;
HashSet<TreeScope*> treeScopesRemoved;
for (TreeScopeSet::iterator it = treeScopes.begin(); it != treeScopes.end(); ++it) {
TreeScope* treeScope = *it;
ASSERT(treeScope != m_document);
ShadowTreeStyleSheetCollection* collection = static_cast<ShadowTreeStyleSheetCollection*>(styleSheetCollectionFor(*treeScope));
ASSERT(collection);
collection->updateActiveStyleSheets(this, updateMode);
if (!collection->hasStyleSheetCandidateNodes()) {
treeScopesRemoved.add(treeScope);
// When removing TreeScope from ActiveTreeScopes,
// its resolver should be destroyed by invoking resetAuthorStyle.
ASSERT(!treeScope->scopedStyleResolver());
}
}
m_activeTreeScopes.removeAll(treeScopesRemoved);
}
InspectorInstrumentation::activeStyleSheetsUpdated(m_document);
m_usesRemUnits = documentStyleSheetCollection()->usesRemUnits();
m_dirtyTreeScopes.clear();
m_documentScopeDirty = false;
}
示例3: keyframesRulesAdded
void ScopedStyleResolver::keyframesRulesAdded(const TreeScope& treeScope) {
// Called when @keyframes rules are about to be added/removed from a
// TreeScope. @keyframes rules may apply to animations on elements in the
// same TreeScope as the stylesheet, or the host element in the parent
// TreeScope if the TreeScope is a shadow tree.
ScopedStyleResolver* resolver = treeScope.scopedStyleResolver();
ScopedStyleResolver* parentResolver =
treeScope.parentTreeScope()
? treeScope.parentTreeScope()->scopedStyleResolver()
: nullptr;
bool hadUnresolvedKeyframes = false;
if (resolver && resolver->m_hasUnresolvedKeyframesRule) {
resolver->m_hasUnresolvedKeyframesRule = false;
hadUnresolvedKeyframes = true;
}
if (parentResolver && parentResolver->m_hasUnresolvedKeyframesRule) {
parentResolver->m_hasUnresolvedKeyframesRule = false;
hadUnresolvedKeyframes = true;
}
if (hadUnresolvedKeyframes) {
// If an animation ended up not being started because no @keyframes
// rules were found for the animation-name, we need to recalculate style
// for the elements in the scope, including its shadow host if
// applicable.
invalidationRootForTreeScope(treeScope).setNeedsStyleRecalc(
SubtreeStyleChange, StyleChangeReasonForTracing::create(
StyleChangeReason::StyleSheetChange));
return;
}
// If we have animations running, added/removed @keyframes may affect these.
treeScope.document().timeline().invalidateKeyframeEffects(treeScope);
}