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

Unified Diff: Source/core/html/HTMLLinkElement.cpp

Issue 1285413002: Handle owner state change in HTMLLinkElement::setCSSStyleSheet (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: pass errors through Created 5 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLLinkElement.cpp
diff --git a/Source/core/html/HTMLLinkElement.cpp b/Source/core/html/HTMLLinkElement.cpp
index 39ef9a4c9d90a04bc0233e0076d1da4eb58a03a5..c3d871ca039cd564f23123bcbd1da419450b5499 100644
--- a/Source/core/html/HTMLLinkElement.cpp
+++ b/Source/core/html/HTMLLinkElement.cpp
@@ -518,7 +518,15 @@ void LinkStyle::setCSSStyleSheet(const String& href, const KURL& baseURL, const
notifyLoadedSheetAndAllCriticalSubresources(Node::ErrorOccurredLoadingSubresource);
return;
}
-
+ // While the stylesheet is asynchronously loading, the owner can be moved under
+ // shadow tree. In that case, cancel any processing on the loaded content.
+ if (m_owner->isInShadowTree()) {
+ m_loading = false;
+ removePendingSheet();
+ if (m_sheet)
+ clearSheet();
+ return;
+ }
// Completing the sheet load may cause scripts to execute.
RefPtrWillBeRawPtr<Node> protector(m_owner.get());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698