Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(784)

Unified Diff: Source/core/dom/ProcessingInstruction.cpp

Issue 257363002: Added addXSLStyleSheet and removeXSLStyleSheet to StyleEngine. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/dom/ProcessingInstruction.cpp
diff --git a/Source/core/dom/ProcessingInstruction.cpp b/Source/core/dom/ProcessingInstruction.cpp
index f2da0a501df3ed21e81575525b14064099123e78..127d852755915153fe324d070c47b5069d793657 100644
--- a/Source/core/dom/ProcessingInstruction.cpp
+++ b/Source/core/dom/ProcessingInstruction.cpp
@@ -59,8 +59,12 @@ ProcessingInstruction::~ProcessingInstruction()
m_sheet->clearOwnerNode();
#if !ENABLE(OILPAN)
- if (inDocument())
- document().styleEngine()->removeStyleSheetCandidateNode(this);
+ if (inDocument()) {
+ if (m_isCSS)
+ document().styleEngine()->removeStyleSheetCandidateNode(this);
+ else if (m_isXSL)
+ document().styleEngine()->removeXSLStyleSheet(this);
+ }
#endif
}
@@ -242,11 +246,11 @@ Node::InsertionNotificationRequest ProcessingInstruction::insertedInto(Container
String href;
String charset;
- // To make it possible for us to see isXSL in
- // StyleEngine::addStyleSheetCandidateNode, split checkStyleSheet
- // into two methods, checkStyleSheet and process.
bool isValid = checkStyleSheet(href, charset);
- document().styleEngine()->addStyleSheetCandidateNode(this, m_createdByParser);
+ if (m_isCSS)
+ document().styleEngine()->addStyleSheetCandidateNode(this, m_createdByParser);
+ else if (m_isXSL)
+ document().styleEngine()->addXSLStyleSheet(this, m_createdByParser);
if (isValid)
process(href, charset);
return InsertionDone;
@@ -258,7 +262,10 @@ void ProcessingInstruction::removedFrom(ContainerNode* insertionPoint)
if (!insertionPoint->inDocument())
return;
- document().styleEngine()->removeStyleSheetCandidateNode(this);
+ if (m_isCSS)
+ document().styleEngine()->removeStyleSheetCandidateNode(this);
+ else if (m_isXSL)
+ document().styleEngine()->removeXSLStyleSheet(this);
RefPtrWillBeRawPtr<StyleSheet> removedSheet = m_sheet;

Powered by Google App Engine
This is Rietveld 408576698