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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
211 | 212 |
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); |
222 OwnPtr<IncrementLoadEventDelayCount> delay = IncrementLoadEventDelayCount::c reate(document()); | |
Nate Chapin
2014/09/15 23:39:34
XSL stylesheet parsing should block the load event
| |
221 parseStyleSheet(sheet); | 223 parseStyleSheet(sheet); |
222 } | 224 } |
223 | 225 |
224 void ProcessingInstruction::parseStyleSheet(const String& sheet) | 226 void ProcessingInstruction::parseStyleSheet(const String& sheet) |
225 { | 227 { |
226 if (m_isCSS) | 228 if (m_isCSS) |
227 toCSSStyleSheet(m_sheet.get())->contents()->parseString(sheet); | 229 toCSSStyleSheet(m_sheet.get())->contents()->parseString(sheet); |
228 else if (m_isXSL) | 230 else if (m_isXSL) |
229 toXSLStyleSheet(m_sheet.get())->parseString(sheet); | 231 toXSLStyleSheet(m_sheet.get())->parseString(sheet); |
230 | 232 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
295 m_sheet.release()->clearOwnerNode(); | 297 m_sheet.release()->clearOwnerNode(); |
296 } | 298 } |
297 | 299 |
298 void ProcessingInstruction::trace(Visitor* visitor) | 300 void ProcessingInstruction::trace(Visitor* visitor) |
299 { | 301 { |
300 visitor->trace(m_sheet); | 302 visitor->trace(m_sheet); |
301 CharacterData::trace(visitor); | 303 CharacterData::trace(visitor); |
302 } | 304 } |
303 | 305 |
304 } // namespace | 306 } // namespace |
OLD | NEW |