Index: Source/core/dom/StyleEngine.cpp |
diff --git a/Source/core/dom/StyleEngine.cpp b/Source/core/dom/StyleEngine.cpp |
index f59a38e203d880478af6b41ac56e4eeaad749b46..f5612f1b22c5de7aefda138e2b839eaffd8665b9 100644 |
--- a/Source/core/dom/StyleEngine.cpp |
+++ b/Source/core/dom/StyleEngine.cpp |
@@ -244,7 +244,8 @@ void StyleEngine::addPendingSheet() |
// This method is called whenever a top-level stylesheet has finished loading. |
void StyleEngine::removePendingSheet(Node* styleSheetCandidateNode, RemovePendingSheetNotificationType notification) |
{ |
- TreeScope* treeScope = styleSheetCandidateNode->hasTagName(styleTag) ? &styleSheetCandidateNode->treeScope() : &m_document; |
+ ASSERT(styleSheetCandidateNode); |
+ TreeScope* treeScope = isHTMLStyleElement(*styleSheetCandidateNode) ? &styleSheetCandidateNode->treeScope() : &m_document; |
markTreeScopeDirty(*treeScope); |
master()->styleEngine()->notifyPendingStyleSheetRemoved(notification); |
} |
@@ -284,8 +285,8 @@ void StyleEngine::modifiedStyleSheet(StyleSheet* sheet) |
if (!node || !node->inDocument()) |
return; |
- TreeScope& treeScope = node->hasTagName(styleTag) ? node->treeScope() : m_document; |
- ASSERT(node->hasTagName(styleTag) || treeScope == m_document); |
+ TreeScope& treeScope = isHTMLStyleElement(*node) ? node->treeScope() : m_document; |
+ ASSERT(isHTMLStyleElement(node) || treeScope == m_document); |
markTreeScopeDirty(treeScope); |
} |
@@ -295,8 +296,8 @@ void StyleEngine::addStyleSheetCandidateNode(Node* node, bool createdByParser) |
if (!node->inDocument()) |
return; |
- TreeScope& treeScope = node->hasTagName(styleTag) ? node->treeScope() : m_document; |
- ASSERT(node->hasTagName(styleTag) || treeScope == m_document); |
+ TreeScope& treeScope = isHTMLStyleElement(*node) ? node->treeScope() : m_document; |
+ ASSERT(isHTMLStyleElement(node) || treeScope == m_document); |
TreeScopeStyleSheetCollection* collection = ensureStyleSheetCollectionFor(treeScope); |
ASSERT(collection); |
@@ -310,7 +311,7 @@ void StyleEngine::addStyleSheetCandidateNode(Node* node, bool createdByParser) |
void StyleEngine::removeStyleSheetCandidateNode(Node* node, ContainerNode* scopingNode) |
{ |
TreeScope& treeScope = scopingNode ? scopingNode->treeScope() : m_document; |
- ASSERT(node->hasTagName(styleTag) || treeScope == m_document); |
+ ASSERT(isHTMLStyleElement(node) || treeScope == m_document); |
TreeScopeStyleSheetCollection* collection = styleSheetCollectionFor(treeScope); |
ASSERT(collection); |
@@ -325,8 +326,8 @@ void StyleEngine::modifiedStyleSheetCandidateNode(Node* node) |
if (!node->inDocument()) |
return; |
- TreeScope& treeScope = node->hasTagName(styleTag) ? node->treeScope() : m_document; |
- ASSERT(node->hasTagName(styleTag) || treeScope == m_document); |
+ TreeScope& treeScope = isHTMLStyleElement(*node) ? node->treeScope() : m_document; |
+ ASSERT(isHTMLStyleElement(node) || treeScope == m_document); |
markTreeScopeDirty(treeScope); |
} |