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

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

Issue 143463011: [import] support document.stylesheets in imported documents. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Landing Created 6 years, 11 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
« no previous file with comments | « Source/core/dom/StyleEngine.cpp ('k') | Source/core/dom/StyleSheetCollection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/StyleSheetCandidate.cpp
diff --git a/Source/core/dom/StyleSheetCandidate.cpp b/Source/core/dom/StyleSheetCandidate.cpp
index 428fab8e52a25f09e7a93ad229d7142b61219fde..0452f308de50eb71f04748ef807914d94c6cc7a3 100644
--- a/Source/core/dom/StyleSheetCandidate.cpp
+++ b/Source/core/dom/StyleSheetCandidate.cpp
@@ -31,6 +31,7 @@
#include "core/dom/Element.h"
#include "core/dom/ProcessingInstruction.h"
#include "core/dom/StyleEngine.h"
+#include "core/html/HTMLImport.h"
#include "core/html/HTMLLinkElement.h"
#include "core/html/HTMLStyleElement.h"
#include "core/svg/SVGStyleElement.h"
@@ -57,7 +58,12 @@ bool StyleSheetCandidate::isImport() const
Document* StyleSheetCandidate::importedDocument() const
{
ASSERT(isImport());
- return toHTMLLinkElement(m_node).import();
+ // The stylesheet update traversal shouldn't go into shared import
+ // to prevent it from stepping into cycle.
+ HTMLLinkElement& element = toHTMLLinkElement(m_node);
+ if (!element.importOwnsLoader())
+ return 0;
+ return element.import();
}
bool StyleSheetCandidate::isAlternate() const
« no previous file with comments | « Source/core/dom/StyleEngine.cpp ('k') | Source/core/dom/StyleSheetCollection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698