using namespace HTMLNames;
DocumentStyleSheetCollection::DocumentStyleSheetCollection(TreeScope& treeScope)
- : StyleSheetCollection(treeScope)
+ : TreeScopeStyleSheetCollection(treeScope)
{
ASSERT(treeScope.rootNode() == treeScope.rootNode().document());
}
// Processing instruction (XML documents only).
// We don't support linking to embedded CSS stylesheets, see <https://bugs.webkit.org/show_bug.cgi?id=49281> for discussion.
// Don't apply XSL transforms to already transformed documents -- <rdar://problem/4132806>
- if (RuntimeEnabledFeatures::xsltEnabled() && !document()->transformSourceDocument()) {
+ if (RuntimeEnabledFeatures::xsltEnabled() && !document().transformSourceDocument()) {
ProcessingInstruction* pi = toProcessingInstruction(n);
// Don't apply XSL transforms until loading is finished.
- if (!document()->parsing() && !pi->isLoading())
- document()->applyXSLTransform(pi);
+ if (!document().parsing() && !pi->isLoading())
+ document().applyXSLTransform(pi);
return;
}
void DocumentStyleSheetCollection::collectStyleSheets(StyleEngine* engine, DocumentStyleSheetCollector& collector)
{
- ASSERT(document()->styleEngine() == engine);
+ ASSERT(document().styleEngine() == engine);
collector.appendActiveStyleSheets(engine->injectedAuthorStyleSheets());
collector.appendActiveStyleSheets(engine->documentAuthorStyleSheets());
collectStyleSheetsFromCandidates(engine, collector);
bool DocumentStyleSheetCollection::updateActiveStyleSheets(StyleEngine* engine, StyleResolverUpdateMode updateMode)
{
- StyleSheetCollectionBase collection;
+ StyleSheetCollection collection;
ActiveDocumentStyleSheetCollector collector(collection);
collectStyleSheets(engine, collector);
if (change.styleResolverUpdateType == Reconstruct) {
engine->clearMasterResolver();
- engine->resetFontSelector();
+ // FIMXE: The following depends on whether StyleRuleFontFace was modified or not.
+ // No need to always-clear font cache.
+ engine->clearFontCache();
} else if (StyleResolver* styleResolver = engine->resolver()) {
// FIXME: We might have already had styles in child treescope. In this case, we cannot use buildScopedStyleTreeInDocumentOrder.
// Need to change "false" to some valid condition.
styleResolver->setBuildScopedStyleTreeInDocumentOrder(false);
if (change.styleResolverUpdateType != Additive) {
- ASSERT(change.styleResolverUpdateType == Reset || change.styleResolverUpdateType == ResetStyleResolverAndFontSelector);
+ ASSERT(change.styleResolverUpdateType == Reset);
resetAllRuleSetsInTreeScope(styleResolver);
- if (change.styleResolverUpdateType == ResetStyleResolverAndFontSelector)
- engine->resetFontSelector();
+ engine->removeFontFaceRules(change.fontFaceRulesToRemove);
styleResolver->removePendingAuthorStyleSheets(m_activeAuthorStyleSheets);
styleResolver->lazyAppendAuthorStyleSheets(0, collection.activeAuthorStyleSheets());
} else {
styleResolver->lazyAppendAuthorStyleSheets(m_activeAuthorStyleSheets.size(), collection.activeAuthorStyleSheets());
}
- } else if (change.styleResolverUpdateType == ResetStyleResolverAndFontSelector) {
- engine->resetFontSelector();
}
m_scopingNodesForStyleScoped.didRemoveScopingNodes();