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

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

Issue 18854017: StyleSheet.ownerNode should be null when it gets orphaned. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: For landing Created 7 years, 5 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 | « LayoutTests/fast/dom/StyleSheet/discarded-sheet-owner-null-expected.txt ('k') | 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 a98eaa0e76d795d7b82e483736bba3fb9f629a90..a1ed6927d9af6a0da0c665650c7c55e78b51594e 100644
--- a/Source/core/html/HTMLLinkElement.cpp
+++ b/Source/core/html/HTMLLinkElement.cpp
@@ -406,6 +406,8 @@ void LinkStyle::setCSSStyleSheet(const String& href, const KURL& baseURL, const
ASSERT(restoredSheet->isCacheable());
ASSERT(!restoredSheet->isLoading());
+ if (m_sheet)
+ clearSheet();
m_sheet = CSSStyleSheet::create(restoredSheet, m_owner);
m_sheet->setMediaQueries(MediaQuerySet::create(m_owner->media()));
m_sheet->setTitle(m_owner->title());
@@ -418,6 +420,8 @@ void LinkStyle::setCSSStyleSheet(const String& href, const KURL& baseURL, const
RefPtr<StyleSheetContents> styleSheet = StyleSheetContents::create(href, parserContext);
+ if (m_sheet)
+ clearSheet();
m_sheet = CSSStyleSheet::create(styleSheet, m_owner);
m_sheet->setMediaQueries(MediaQuerySet::create(m_owner->media()));
m_sheet->setTitle(m_owner->title());
« no previous file with comments | « LayoutTests/fast/dom/StyleSheet/discarded-sheet-owner-null-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698