Index: Source/core/dom/DocumentStyleSheetCollection.cpp |
diff --git a/Source/core/dom/DocumentStyleSheetCollection.cpp b/Source/core/dom/DocumentStyleSheetCollection.cpp |
index 87a308caa7766e66ea0fdd1b73a2de36a0d256eb..44a31379babc84847c4a6e5bcae8f82331ea7d50 100644 |
--- a/Source/core/dom/DocumentStyleSheetCollection.cpp |
+++ b/Source/core/dom/DocumentStyleSheetCollection.cpp |
@@ -52,8 +52,20 @@ DocumentStyleSheetCollection::DocumentStyleSheetCollection(TreeScope& treeScope) |
ASSERT(treeScope.rootNode() == treeScope.rootNode()->document()); |
} |
+static void collectActiveCSSStyleSheetsFromSeamlessParents(StyleSheetCollectionBase& collection, Document* document) |
+{ |
+ HTMLIFrameElement* seamlessParentIFrame = document->seamlessParentIFrame(); |
+ if (!seamlessParentIFrame) |
+ return; |
+ collection.appendActiveStyleSheets(seamlessParentIFrame->document().styleEngine()->activeAuthorStyleSheets()); |
+} |
+ |
void DocumentStyleSheetCollection::collectStyleSheets(StyleEngine* engine, StyleSheetCollectionBase& collection) |
{ |
+ collection.appendActiveStyleSheets(engine->injectedAuthorStyleSheets()); |
+ collection.appendActiveStyleSheets(engine->documentAuthorStyleSheets()); |
+ collectActiveCSSStyleSheetsFromSeamlessParents(collection, document()); |
+ |
DocumentOrderedList::iterator begin = m_styleSheetCandidateNodes.begin(); |
DocumentOrderedList::iterator end = m_styleSheetCandidateNodes.end(); |
for (DocumentOrderedList::iterator it = begin; it != end; ++it) { |
@@ -137,47 +149,4 @@ void DocumentStyleSheetCollection::collectStyleSheets(StyleEngine* engine, Style |
} |
} |
-static void collectActiveCSSStyleSheetsFromSeamlessParents(StyleSheetCollectionBase& collection, Document* document) |
-{ |
- HTMLIFrameElement* seamlessParentIFrame = document->seamlessParentIFrame(); |
- if (!seamlessParentIFrame) |
- return; |
- collection.appendActiveStyleSheets(seamlessParentIFrame->document().styleEngine()->activeAuthorStyleSheets()); |
-} |
- |
-bool DocumentStyleSheetCollection::updateActiveStyleSheets(StyleEngine* engine, StyleResolverUpdateMode updateMode) |
-{ |
- StyleSheetCollectionBase collection; |
- collection.appendActiveStyleSheets(engine->injectedAuthorStyleSheets()); |
- collection.appendActiveStyleSheets(engine->documentAuthorStyleSheets()); |
- collectActiveCSSStyleSheetsFromSeamlessParents(collection, document()); |
- collectStyleSheets(engine, collection); |
- |
- StyleSheetChange change; |
- analyzeStyleSheetChange(updateMode, collection, change); |
- |
- if (change.styleResolverUpdateType == Reconstruct) { |
- engine->clearResolver(); |
- } else if (StyleResolver* styleResolver = engine->resolverIfExists()) { |
- // 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); |
- resetAllRuleSetsInTreeScope(styleResolver); |
- if (change.styleResolverUpdateType == ResetStyleResolverAndFontSelector) |
- styleResolver->resetFontSelector(); |
- styleResolver->removePendingAuthorStyleSheets(m_activeAuthorStyleSheets); |
- styleResolver->lazyAppendAuthorStyleSheets(0, collection.activeAuthorStyleSheets()); |
- } else { |
- styleResolver->lazyAppendAuthorStyleSheets(m_activeAuthorStyleSheets.size(), collection.activeAuthorStyleSheets()); |
- } |
- } |
- m_scopingNodesForStyleScoped.didRemoveScopingNodes(); |
- collection.swap(*this); |
- updateUsesRemUnits(); |
- |
- return change.requiresFullStyleRecalc; |
-} |
- |
} |