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" | |
30 #include "core/dom/StyleEngine.h" | 29 #include "core/dom/StyleEngine.h" |
31 #include "core/fetch/CSSStyleSheetResource.h" | 30 #include "core/fetch/CSSStyleSheetResource.h" |
32 #include "core/fetch/FetchRequest.h" | 31 #include "core/fetch/FetchRequest.h" |
33 #include "core/fetch/ResourceFetcher.h" | 32 #include "core/fetch/ResourceFetcher.h" |
34 #include "core/fetch/XSLStyleSheetResource.h" | 33 #include "core/fetch/XSLStyleSheetResource.h" |
35 #include "core/xml/XSLStyleSheet.h" | 34 #include "core/xml/XSLStyleSheet.h" |
36 #include "core/xml/parser/XMLDocumentParser.h" // for parseAttributes() | 35 #include "core/xml/parser/XMLDocumentParser.h" // for parseAttributes() |
37 | 36 |
38 namespace blink { | 37 namespace blink { |
39 | 38 |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 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) |
214 { | 213 { |
215 if (!inDocument()) { | 214 if (!inDocument()) { |
216 ASSERT(!m_sheet); | 215 ASSERT(!m_sheet); |
217 return; | 216 return; |
218 } | 217 } |
219 | 218 |
220 ASSERT(m_isXSL); | 219 ASSERT(m_isXSL); |
221 m_sheet = XSLStyleSheet::create(this, href, baseURL); | 220 m_sheet = XSLStyleSheet::create(this, href, baseURL); |
222 RefPtrWillBeRawPtr<Document> protect(&document()); | 221 RefPtrWillBeRawPtr<Document> protect(&document()); |
223 OwnPtr<IncrementLoadEventDelayCount> delay = IncrementLoadEventDelayCount::c
reate(document()); | |
224 parseStyleSheet(sheet); | 222 parseStyleSheet(sheet); |
225 } | 223 } |
226 | 224 |
227 void ProcessingInstruction::parseStyleSheet(const String& sheet) | 225 void ProcessingInstruction::parseStyleSheet(const String& sheet) |
228 { | 226 { |
229 if (m_isCSS) | 227 if (m_isCSS) |
230 toCSSStyleSheet(m_sheet.get())->contents()->parseString(sheet); | 228 toCSSStyleSheet(m_sheet.get())->contents()->parseString(sheet); |
231 else if (m_isXSL) | 229 else if (m_isXSL) |
232 toXSLStyleSheet(m_sheet.get())->parseString(sheet); | 230 toXSLStyleSheet(m_sheet.get())->parseString(sheet); |
233 | 231 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 m_sheet.release()->clearOwnerNode(); | 296 m_sheet.release()->clearOwnerNode(); |
299 } | 297 } |
300 | 298 |
301 void ProcessingInstruction::trace(Visitor* visitor) | 299 void ProcessingInstruction::trace(Visitor* visitor) |
302 { | 300 { |
303 visitor->trace(m_sheet); | 301 visitor->trace(m_sheet); |
304 CharacterData::trace(visitor); | 302 CharacterData::trace(visitor); |
305 } | 303 } |
306 | 304 |
307 } // namespace | 305 } // namespace |
OLD | NEW |