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 16 matching lines...) Expand all Loading... |
27 #include "core/dom/IncrementLoadEventDelayCount.h" | 27 #include "core/dom/IncrementLoadEventDelayCount.h" |
28 #include "core/dom/StyleEngine.h" | 28 #include "core/dom/StyleEngine.h" |
29 #include "core/fetch/CSSStyleSheetResource.h" | 29 #include "core/fetch/CSSStyleSheetResource.h" |
30 #include "core/fetch/FetchInitiatorTypeNames.h" | 30 #include "core/fetch/FetchInitiatorTypeNames.h" |
31 #include "core/fetch/FetchRequest.h" | 31 #include "core/fetch/FetchRequest.h" |
32 #include "core/fetch/ResourceFetcher.h" | 32 #include "core/fetch/ResourceFetcher.h" |
33 #include "core/fetch/XSLStyleSheetResource.h" | 33 #include "core/fetch/XSLStyleSheetResource.h" |
34 #include "core/xml/DocumentXSLT.h" | 34 #include "core/xml/DocumentXSLT.h" |
35 #include "core/xml/XSLStyleSheet.h" | 35 #include "core/xml/XSLStyleSheet.h" |
36 #include "core/xml/parser/XMLDocumentParser.h" // for parseAttributes() | 36 #include "core/xml/parser/XMLDocumentParser.h" // for parseAttributes() |
| 37 #include <memory> |
37 | 38 |
38 namespace blink { | 39 namespace blink { |
39 | 40 |
40 inline ProcessingInstruction::ProcessingInstruction(Document& document, const St
ring& target, const String& data) | 41 inline ProcessingInstruction::ProcessingInstruction(Document& document, const St
ring& target, const String& data) |
41 : CharacterData(document, data, CreateOther) | 42 : CharacterData(document, data, CreateOther) |
42 , m_target(target) | 43 , m_target(target) |
43 , m_loading(false) | 44 , m_loading(false) |
44 , m_alternate(false) | 45 , m_alternate(false) |
45 , m_isCSS(false) | 46 , m_isCSS(false) |
46 , m_isXSL(false) | 47 , m_isXSL(false) |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 | 218 |
218 void ProcessingInstruction::setXSLStyleSheet(const String& href, const KURL& bas
eURL, const String& sheet) | 219 void ProcessingInstruction::setXSLStyleSheet(const String& href, const KURL& bas
eURL, const String& sheet) |
219 { | 220 { |
220 if (!inShadowIncludingDocument()) { | 221 if (!inShadowIncludingDocument()) { |
221 DCHECK(!m_sheet); | 222 DCHECK(!m_sheet); |
222 return; | 223 return; |
223 } | 224 } |
224 | 225 |
225 DCHECK(m_isXSL); | 226 DCHECK(m_isXSL); |
226 m_sheet = XSLStyleSheet::create(this, href, baseURL); | 227 m_sheet = XSLStyleSheet::create(this, href, baseURL); |
227 OwnPtr<IncrementLoadEventDelayCount> delay = IncrementLoadEventDelayCount::c
reate(document()); | 228 std::unique_ptr<IncrementLoadEventDelayCount> delay = IncrementLoadEventDela
yCount::create(document()); |
228 parseStyleSheet(sheet); | 229 parseStyleSheet(sheet); |
229 } | 230 } |
230 | 231 |
231 void ProcessingInstruction::parseStyleSheet(const String& sheet) | 232 void ProcessingInstruction::parseStyleSheet(const String& sheet) |
232 { | 233 { |
233 if (m_isCSS) | 234 if (m_isCSS) |
234 toCSSStyleSheet(m_sheet.get())->contents()->parseString(sheet); | 235 toCSSStyleSheet(m_sheet.get())->contents()->parseString(sheet); |
235 else if (m_isXSL) | 236 else if (m_isXSL) |
236 toXSLStyleSheet(m_sheet.get())->parseString(sheet); | 237 toXSLStyleSheet(m_sheet.get())->parseString(sheet); |
237 | 238 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 | 295 |
295 DEFINE_TRACE(ProcessingInstruction) | 296 DEFINE_TRACE(ProcessingInstruction) |
296 { | 297 { |
297 visitor->trace(m_sheet); | 298 visitor->trace(m_sheet); |
298 visitor->trace(m_listenerForXSLT); | 299 visitor->trace(m_listenerForXSLT); |
299 CharacterData::trace(visitor); | 300 CharacterData::trace(visitor); |
300 ResourceOwner<StyleSheetResource>::trace(visitor); | 301 ResourceOwner<StyleSheetResource>::trace(visitor); |
301 } | 302 } |
302 | 303 |
303 } // namespace blink | 304 } // namespace blink |
OLD | NEW |