| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2000 Peter Kelly (pmk@post.com) | 2 * Copyright (C) 2000 Peter Kelly (pmk@post.com) |
| 3 * Copyright (C) 2006, 2008, 2009 Apple Inc. All rights reserved. | 3 * Copyright (C) 2006, 2008, 2009 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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 if (m_isCSS) | 276 if (m_isCSS) |
| 277 document().styleEngine()->removeStyleSheetCandidateNode(this); | 277 document().styleEngine()->removeStyleSheetCandidateNode(this); |
| 278 else if (m_isXSL) | 278 else if (m_isXSL) |
| 279 document().styleEngine()->removeXSLStyleSheet(this); | 279 document().styleEngine()->removeXSLStyleSheet(this); |
| 280 | 280 |
| 281 RefPtrWillBeRawPtr<StyleSheet> removedSheet = m_sheet; | 281 RefPtrWillBeRawPtr<StyleSheet> removedSheet = m_sheet; |
| 282 | 282 |
| 283 if (m_sheet) { | 283 if (m_sheet) { |
| 284 ASSERT(m_sheet->ownerNode() == this); | 284 ASSERT(m_sheet->ownerNode() == this); |
| 285 clearSheet(); | 285 clearSheet(); |
| 286 } else if (resource()) { |
| 287 ASSERT(m_loading); |
| 288 document().styleEngine()->removePendingSheet(this); |
| 289 clearResource(); |
| 286 } | 290 } |
| 287 | 291 |
| 288 // If we're in document teardown, then we don't need to do any notification
of our sheet's removal. | 292 // If we're in document teardown, then we don't need to do any notification
of our sheet's removal. |
| 289 if (document().isActive()) | 293 if (document().isActive()) |
| 290 document().removedStyleSheet(removedSheet.get()); | 294 document().removedStyleSheet(removedSheet.get()); |
| 291 } | 295 } |
| 292 | 296 |
| 293 void ProcessingInstruction::clearSheet() | 297 void ProcessingInstruction::clearSheet() |
| 294 { | 298 { |
| 295 ASSERT(m_sheet); | 299 ASSERT(m_sheet); |
| 296 if (m_sheet->isLoading()) | 300 if (m_sheet->isLoading()) |
| 297 document().styleEngine()->removePendingSheet(this); | 301 document().styleEngine()->removePendingSheet(this); |
| 298 m_sheet.release()->clearOwnerNode(); | 302 m_sheet.release()->clearOwnerNode(); |
| 299 } | 303 } |
| 300 | 304 |
| 301 void ProcessingInstruction::trace(Visitor* visitor) | 305 void ProcessingInstruction::trace(Visitor* visitor) |
| 302 { | 306 { |
| 303 visitor->trace(m_sheet); | 307 visitor->trace(m_sheet); |
| 304 CharacterData::trace(visitor); | 308 CharacterData::trace(visitor); |
| 305 } | 309 } |
| 306 | 310 |
| 307 } // namespace | 311 } // namespace |
| OLD | NEW |