X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fthird_party%2FWebKit%2FSource%2Fcore%2Fdom%2FDocumentStyleSheetCollection.cpp;h=c252e12dc8667ad3dad9bc78849a0b5d440eedf3;hb=ff3e2503a20db9193d323c1d19c38c68004dec4a;hp=1a24de3c7e0133eaf9d698f7eb5d70cbeb822e8f;hpb=7338fba38ba696536d1cc9d389afd716a6ab2fe6;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/third_party/WebKit/Source/core/dom/DocumentStyleSheetCollection.cpp b/src/third_party/WebKit/Source/core/dom/DocumentStyleSheetCollection.cpp index 1a24de3..c252e12 100644 --- a/src/third_party/WebKit/Source/core/dom/DocumentStyleSheetCollection.cpp +++ b/src/third_party/WebKit/Source/core/dom/DocumentStyleSheetCollection.cpp @@ -49,7 +49,7 @@ namespace WebCore { using namespace HTMLNames; DocumentStyleSheetCollection::DocumentStyleSheetCollection(TreeScope& treeScope) - : StyleSheetCollection(treeScope) + : TreeScopeStyleSheetCollection(treeScope) { ASSERT(treeScope.rootNode() == treeScope.rootNode().document()); } @@ -66,11 +66,11 @@ void DocumentStyleSheetCollection::collectStyleSheetsFromCandidates(StyleEngine* // Processing instruction (XML documents only). // We don't support linking to embedded CSS stylesheets, see for discussion. // Don't apply XSL transforms to already transformed documents -- - 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; } @@ -106,7 +106,7 @@ void DocumentStyleSheetCollection::collectStyleSheetsFromCandidates(StyleEngine* 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); @@ -114,7 +114,7 @@ void DocumentStyleSheetCollection::collectStyleSheets(StyleEngine* engine, Docum bool DocumentStyleSheetCollection::updateActiveStyleSheets(StyleEngine* engine, StyleResolverUpdateMode updateMode) { - StyleSheetCollectionBase collection; + StyleSheetCollection collection; ActiveDocumentStyleSheetCollector collector(collection); collectStyleSheets(engine, collector); @@ -123,23 +123,22 @@ bool DocumentStyleSheetCollection::updateActiveStyleSheets(StyleEngine* engine, 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();