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

Unified Diff: Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp

Issue 10868093: Merge 125292 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1229/
Patch Set: Created 8 years, 4 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/WebCore/loader/cache/CachedCSSStyleSheet.cpp
===================================================================
--- Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp (revision 126669)
+++ Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp (working copy)
@@ -59,10 +59,13 @@
void CachedCSSStyleSheet::didAddClient(CachedResourceClient* c)
{
ASSERT(c->resourceClientType() == CachedStyleSheetClient::expectedType());
+ // CachedResource::didAddClient() must be before setCSSStyleSheet(),
+ // because setCSSStyleSheet() may cause scripts to be executed, which could destroy 'c' if it is an instance of HTMLLinkElement.
+ // see the comment of HTMLLinkElement::setCSSStyleSheet.
+ CachedResource::didAddClient(c);
+
if (!isLoading())
static_cast<CachedStyleSheetClient*>(c)->setCSSStyleSheet(m_resourceRequest.url(), m_response.url(), m_decoder->encoding().name(), this);
-
- CachedResource::didAddClient(c);
}
void CachedCSSStyleSheet::setEncoding(const String& chs)
« 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