Index: Source/WebCore/html/HTMLLinkElement.cpp |
=================================================================== |
--- Source/WebCore/html/HTMLLinkElement.cpp (revision 115610) |
+++ Source/WebCore/html/HTMLLinkElement.cpp (working copy) |
@@ -230,11 +230,19 @@ |
} |
} else if (m_sheet) { |
// we no longer contain a stylesheet, e.g. perhaps rel or type was changed |
- m_sheet = 0; |
+ clearSheet(); |
document()->styleSelectorChanged(DeferRecalcStyle); |
} |
} |
+void HTMLLinkElement::clearSheet() |
+{ |
+ ASSERT(m_sheet); |
+ ASSERT(m_sheet->ownerNode() == this); |
+ m_sheet->clearOwnerNode(); |
+ m_sheet = 0; |
+} |
+ |
void HTMLLinkElement::insertedIntoDocument() |
{ |
HTMLElement::insertedIntoDocument(); |
@@ -258,11 +266,8 @@ |
} |
document()->removeStyleSheetCandidateNode(this); |
- if (m_sheet) { |
- ASSERT(m_sheet->ownerNode() == this); |
- m_sheet->clearOwnerNode(); |
- m_sheet = 0; |
- } |
+ if (m_sheet) |
+ clearSheet(); |
if (styleSheetIsLoading()) |
removePendingSheet(); |