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

Unified Diff: Source/WebCore/dom/StyleElement.cpp

Issue 10265007: Merge 113887 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1084/
Patch Set: Created 8 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
« no previous file with comments | « Source/WebCore/dom/StyleElement.h ('k') | Source/WebCore/html/HTMLLinkElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/dom/StyleElement.cpp
===================================================================
--- Source/WebCore/dom/StyleElement.cpp (revision 115610)
+++ Source/WebCore/dom/StyleElement.cpp (working copy)
@@ -74,11 +74,8 @@
ASSERT(element);
document->removeStyleSheetCandidateNode(element);
- if (m_sheet) {
- ASSERT(m_sheet->ownerNode() == element);
- m_sheet->clearOwnerNode();
- m_sheet = 0;
- }
+ if (m_sheet)
+ clearSheet();
// If we're in document teardown, then we don't need to do any notification of our sheet's removal.
if (document->renderer())
@@ -139,6 +136,13 @@
createSheet(e, m_startLineNumber, sheetText.toString());
}
+void StyleElement::clearSheet()
+{
+ ASSERT(m_sheet);
+ m_sheet->clearOwnerNode();
+ m_sheet = 0;
+}
+
void StyleElement::createSheet(Element* e, int startLineNumber, const String& text)
{
ASSERT(e);
@@ -147,7 +151,7 @@
if (m_sheet) {
if (m_sheet->isLoading())
document->removePendingSheet();
- m_sheet = 0;
+ clearSheet();
}
// If type is empty or CSS, this is a CSS style sheet.
« no previous file with comments | « Source/WebCore/dom/StyleElement.h ('k') | Source/WebCore/html/HTMLLinkElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698