| 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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 | 211 |
| 212 void ProcessingInstruction::setXSLStyleSheet(const String& href, const KURL& bas
eURL, const String& sheet) | 212 void ProcessingInstruction::setXSLStyleSheet(const String& href, const KURL& bas
eURL, const String& sheet) |
| 213 { | 213 { |
| 214 if (!inDocument()) { | 214 if (!inDocument()) { |
| 215 ASSERT(!m_sheet); | 215 ASSERT(!m_sheet); |
| 216 return; | 216 return; |
| 217 } | 217 } |
| 218 | 218 |
| 219 ASSERT(m_isXSL); | 219 ASSERT(m_isXSL); |
| 220 m_sheet = XSLStyleSheet::create(this, href, baseURL); | 220 m_sheet = XSLStyleSheet::create(this, href, baseURL); |
| 221 RefPtrWillBeRawPtr<Document> protect(&document()); |
| 221 parseStyleSheet(sheet); | 222 parseStyleSheet(sheet); |
| 222 } | 223 } |
| 223 | 224 |
| 224 void ProcessingInstruction::parseStyleSheet(const String& sheet) | 225 void ProcessingInstruction::parseStyleSheet(const String& sheet) |
| 225 { | 226 { |
| 226 if (m_isCSS) | 227 if (m_isCSS) |
| 227 toCSSStyleSheet(m_sheet.get())->contents()->parseString(sheet); | 228 toCSSStyleSheet(m_sheet.get())->contents()->parseString(sheet); |
| 228 else if (m_isXSL) | 229 else if (m_isXSL) |
| 229 toXSLStyleSheet(m_sheet.get())->parseString(sheet); | 230 toXSLStyleSheet(m_sheet.get())->parseString(sheet); |
| 230 | 231 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 m_sheet.release()->clearOwnerNode(); | 296 m_sheet.release()->clearOwnerNode(); |
| 296 } | 297 } |
| 297 | 298 |
| 298 void ProcessingInstruction::trace(Visitor* visitor) | 299 void ProcessingInstruction::trace(Visitor* visitor) |
| 299 { | 300 { |
| 300 visitor->trace(m_sheet); | 301 visitor->trace(m_sheet); |
| 301 CharacterData::trace(visitor); | 302 CharacterData::trace(visitor); |
| 302 } | 303 } |
| 303 | 304 |
| 304 } // namespace | 305 } // namespace |
| OLD | NEW |