diff options
Diffstat (limited to 'WebCore/css/CSSStyleSheet.cpp')
-rw-r--r-- | WebCore/css/CSSStyleSheet.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/WebCore/css/CSSStyleSheet.cpp b/WebCore/css/CSSStyleSheet.cpp index 2e9255b..56305f3 100644 --- a/WebCore/css/CSSStyleSheet.cpp +++ b/WebCore/css/CSSStyleSheet.cpp @@ -192,6 +192,10 @@ void CSSStyleSheet::checkLoaded() return; if (parent()) parent()->checkLoaded(); + + // Avoid |this| being deleted by scripts that run via HTMLTokenizer::executeScriptsWaitingForStylesheets(). + // See <rdar://problem/6622300>. + RefPtr<CSSStyleSheet> protector(this); m_loadCompleted = ownerNode() ? ownerNode()->sheetLoaded() : true; } @@ -200,7 +204,7 @@ void CSSStyleSheet::styleSheetChanged() StyleBase* root = this; while (StyleBase* parent = root->parent()) root = parent; - Document* documentToUpdate = (root && root->isCSSStyleSheet()) ? static_cast<CSSStyleSheet*>(root)->doc() : 0; + Document* documentToUpdate = root->isCSSStyleSheet() ? static_cast<CSSStyleSheet*>(root)->doc() : 0; /* FIXME: We don't need to do everything updateStyleSelector does, * basically we just need to recreate the document's selector with the |