| 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 if (rule->isImportRule() && static_cast<CSSImportRule*>(rule)->isLoading
()) | 213 if (rule->isImportRule() && static_cast<CSSImportRule*>(rule)->isLoading
()) |
| 214 return true; | 214 return true; |
| 215 } | 215 } |
| 216 return false; | 216 return false; |
| 217 } | 217 } |
| 218 | 218 |
| 219 void CSSStyleSheet::checkLoaded() | 219 void CSSStyleSheet::checkLoaded() |
| 220 { | 220 { |
| 221 if (isLoading()) | 221 if (isLoading()) |
| 222 return; | 222 return; |
| 223 if (parent()) | |
| 224 parent()->checkLoaded(); | |
| 225 | 223 |
| 226 // Avoid |this| being deleted by scripts that run via | 224 // Avoid |this| being deleted by scripts that run via |
| 227 // ScriptableDocumentParser::executeScriptsWaitingForStylesheets(). | 225 // ScriptableDocumentParser::executeScriptsWaitingForStylesheets(). |
| 228 // See <rdar://problem/6622300>. | 226 // See <rdar://problem/6622300>. |
| 229 RefPtr<CSSStyleSheet> protector(this); | 227 RefPtr<CSSStyleSheet> protector(this); |
| 228 if (parent()) |
| 229 parent()->checkLoaded(); |
| 230 m_loadCompleted = ownerNode() ? ownerNode()->sheetLoaded() : true; | 230 m_loadCompleted = ownerNode() ? ownerNode()->sheetLoaded() : true; |
| 231 } | 231 } |
| 232 | 232 |
| 233 Document* CSSStyleSheet::document() | 233 Document* CSSStyleSheet::document() |
| 234 { | 234 { |
| 235 StyleBase* styleObject = this; | 235 StyleBase* styleObject = this; |
| 236 while (styleObject) { | 236 while (styleObject) { |
| 237 if (styleObject->isCSSStyleSheet()) { | 237 if (styleObject->isCSSStyleSheet()) { |
| 238 Node* ownerNode = static_cast<CSSStyleSheet*>(styleObject)->ownerNod
e(); | 238 Node* ownerNode = static_cast<CSSStyleSheet*>(styleObject)->ownerNod
e(); |
| 239 if (ownerNode) | 239 if (ownerNode) |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 if (rule->isImportRule()) { | 291 if (rule->isImportRule()) { |
| 292 if (CSSStyleSheet* ruleStyleSheet = static_cast<CSSImportRule*>(
rule)->styleSheet()) | 292 if (CSSStyleSheet* ruleStyleSheet = static_cast<CSSImportRule*>(
rule)->styleSheet()) |
| 293 styleSheetQueue.append(ruleStyleSheet); | 293 styleSheetQueue.append(ruleStyleSheet); |
| 294 } | 294 } |
| 295 rule->addSubresourceStyleURLs(urls); | 295 rule->addSubresourceStyleURLs(urls); |
| 296 } | 296 } |
| 297 } | 297 } |
| 298 } | 298 } |
| 299 | 299 |
| 300 } | 300 } |
| OLD | NEW |