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, |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 * Library General Public License for more details. | 13 * Library General Public License for more details. |
14 * | 14 * |
15 * You should have received a copy of the GNU Library General Public License | 15 * You should have received a copy of the GNU Library General Public License |
16 * along with this library; see the file COPYING.LIB. If not, write to | 16 * along with this library; see the file COPYING.LIB. If not, write to |
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
18 * Boston, MA 02110-1301, USA. | 18 * Boston, MA 02110-1301, USA. |
19 */ | 19 */ |
20 | 20 |
21 #include "config.h" | 21 #include "config.h" |
22 #include "core/dom/ProcessingInstruction.h" | 22 #include "core/dom/ProcessingInstruction.h" |
23 | 23 |
24 #include "core/FetchInitiatorTypeNames.h" | 24 #include "core/FetchInitiatorTypeNames.h" |
25 #include "core/css/CSSStyleSheet.h" | 25 #include "core/css/CSSStyleSheet.h" |
26 #include "core/css/MediaList.h" | 26 #include "core/css/MediaList.h" |
27 #include "core/css/StyleSheetContents.h" | 27 #include "core/css/StyleSheetContents.h" |
28 #include "core/dom/Document.h" | 28 #include "core/dom/Document.h" |
| 29 #include "core/dom/IncrementLoadEventDelayCount.h" |
29 #include "core/dom/StyleEngine.h" | 30 #include "core/dom/StyleEngine.h" |
30 #include "core/fetch/CSSStyleSheetResource.h" | 31 #include "core/fetch/CSSStyleSheetResource.h" |
31 #include "core/fetch/FetchRequest.h" | 32 #include "core/fetch/FetchRequest.h" |
32 #include "core/fetch/ResourceFetcher.h" | 33 #include "core/fetch/ResourceFetcher.h" |
33 #include "core/fetch/XSLStyleSheetResource.h" | 34 #include "core/fetch/XSLStyleSheetResource.h" |
34 #include "core/xml/XSLStyleSheet.h" | 35 #include "core/xml/XSLStyleSheet.h" |
35 #include "core/xml/parser/XMLDocumentParser.h" // for parseAttributes() | 36 #include "core/xml/parser/XMLDocumentParser.h" // for parseAttributes() |
36 | 37 |
37 namespace blink { | 38 namespace blink { |
38 | 39 |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 void ProcessingInstruction::setXSLStyleSheet(const String& href, const KURL& bas
eURL, const String& sheet) | 213 void ProcessingInstruction::setXSLStyleSheet(const String& href, const KURL& bas
eURL, const String& sheet) |
213 { | 214 { |
214 if (!inDocument()) { | 215 if (!inDocument()) { |
215 ASSERT(!m_sheet); | 216 ASSERT(!m_sheet); |
216 return; | 217 return; |
217 } | 218 } |
218 | 219 |
219 ASSERT(m_isXSL); | 220 ASSERT(m_isXSL); |
220 m_sheet = XSLStyleSheet::create(this, href, baseURL); | 221 m_sheet = XSLStyleSheet::create(this, href, baseURL); |
221 RefPtrWillBeRawPtr<Document> protect(&document()); | 222 RefPtrWillBeRawPtr<Document> protect(&document()); |
| 223 OwnPtr<IncrementLoadEventDelayCount> delay = IncrementLoadEventDelayCount::c
reate(document()); |
222 parseStyleSheet(sheet); | 224 parseStyleSheet(sheet); |
223 } | 225 } |
224 | 226 |
225 void ProcessingInstruction::parseStyleSheet(const String& sheet) | 227 void ProcessingInstruction::parseStyleSheet(const String& sheet) |
226 { | 228 { |
227 if (m_isCSS) | 229 if (m_isCSS) |
228 toCSSStyleSheet(m_sheet.get())->contents()->parseString(sheet); | 230 toCSSStyleSheet(m_sheet.get())->contents()->parseString(sheet); |
229 else if (m_isXSL) | 231 else if (m_isXSL) |
230 toXSLStyleSheet(m_sheet.get())->parseString(sheet); | 232 toXSLStyleSheet(m_sheet.get())->parseString(sheet); |
231 | 233 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 m_sheet.release()->clearOwnerNode(); | 298 m_sheet.release()->clearOwnerNode(); |
297 } | 299 } |
298 | 300 |
299 void ProcessingInstruction::trace(Visitor* visitor) | 301 void ProcessingInstruction::trace(Visitor* visitor) |
300 { | 302 { |
301 visitor->trace(m_sheet); | 303 visitor->trace(m_sheet); |
302 CharacterData::trace(visitor); | 304 CharacterData::trace(visitor); |
303 } | 305 } |
304 | 306 |
305 } // namespace | 307 } // namespace |
OLD | NEW |