OLD | NEW |
1 /* | 1 /* |
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 } | 175 } |
176 return false; | 176 return false; |
177 } | 177 } |
178 | 178 |
179 void CSSStyleSheet::checkLoaded() | 179 void CSSStyleSheet::checkLoaded() |
180 { | 180 { |
181 if (isLoading()) | 181 if (isLoading()) |
182 return; | 182 return; |
183 if (parent()) | 183 if (parent()) |
184 parent()->checkLoaded(); | 184 parent()->checkLoaded(); |
| 185 |
| 186 // Avoid |this| being deleted by scripts that run via HTMLTokenizer::execute
ScriptsWaitingForStylesheets(). |
| 187 // See <rdar://problem/6622300>. |
| 188 RefPtr<CSSStyleSheet> protector(this); |
185 m_loadCompleted = ownerNode() ? ownerNode()->sheetLoaded() : true; | 189 m_loadCompleted = ownerNode() ? ownerNode()->sheetLoaded() : true; |
186 } | 190 } |
187 | 191 |
188 void CSSStyleSheet::styleSheetChanged() | 192 void CSSStyleSheet::styleSheetChanged() |
189 { | 193 { |
190 StyleBase* root = this; | 194 StyleBase* root = this; |
191 while (StyleBase* parent = root->parent()) | 195 while (StyleBase* parent = root->parent()) |
192 root = parent; | 196 root = parent; |
193 Document* documentToUpdate = (root && root->isCSSStyleSheet()) ? static_cast
<CSSStyleSheet*>(root)->doc() : 0; | 197 Document* documentToUpdate = (root && root->isCSSStyleSheet()) ? static_cast
<CSSStyleSheet*>(root)->doc() : 0; |
194 | 198 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 if (rule->isImportRule()) { | 231 if (rule->isImportRule()) { |
228 if (CSSStyleSheet* ruleStyleSheet = static_cast<CSSImportRule*>(
rule)->styleSheet()) | 232 if (CSSStyleSheet* ruleStyleSheet = static_cast<CSSImportRule*>(
rule)->styleSheet()) |
229 styleSheetQueue.append(ruleStyleSheet); | 233 styleSheetQueue.append(ruleStyleSheet); |
230 } | 234 } |
231 rule->addSubresourceStyleURLs(urls); | 235 rule->addSubresourceStyleURLs(urls); |
232 } | 236 } |
233 } | 237 } |
234 } | 238 } |
235 | 239 |
236 } | 240 } |
OLD | NEW |