OLD | NEW |
1 /* | 1 /* |
2 * This file is part of the XSL implementation. | 2 * This file is part of the XSL implementation. |
3 * | 3 * |
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple, Inc. All rights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple, Inc. All rights reserved. |
5 * Copyright (C) 2005, 2006 Alexey Proskuryakov <ap@webkit.org> | 5 * Copyright (C) 2005, 2006 Alexey Proskuryakov <ap@webkit.org> |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 default: | 77 default: |
78 level = ErrorMessageLevel; | 78 level = ErrorMessageLevel; |
79 break; | 79 break; |
80 } | 80 } |
81 | 81 |
82 console->addMessage(ConsoleMessage::create( | 82 console->addMessage(ConsoleMessage::create( |
83 XMLMessageSource, level, error->message, | 83 XMLMessageSource, level, error->message, |
84 SourceLocation::create(error->file, error->line, 0, nullptr))); | 84 SourceLocation::create(error->file, error->line, 0, nullptr))); |
85 } | 85 } |
86 | 86 |
87 // FIXME: There seems to be no way to control the ctxt pointer for loading here,
thus we have globals. | 87 // FIXME: There seems to be no way to control the ctxt pointer for loading here, |
| 88 // thus we have globals. |
88 static XSLTProcessor* globalProcessor = nullptr; | 89 static XSLTProcessor* globalProcessor = nullptr; |
89 static ResourceFetcher* globalResourceFetcher = nullptr; | 90 static ResourceFetcher* globalResourceFetcher = nullptr; |
90 | 91 |
91 static xmlDocPtr docLoaderFunc(const xmlChar* uri, | 92 static xmlDocPtr docLoaderFunc(const xmlChar* uri, |
92 xmlDictPtr, | 93 xmlDictPtr, |
93 int options, | 94 int options, |
94 void* ctxt, | 95 void* ctxt, |
95 xsltLoadType type) { | 96 xsltLoadType type) { |
96 if (!globalProcessor) | 97 if (!globalProcessor) |
97 return nullptr; | 98 return nullptr; |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 WTF::Partitions::fastFree(const_cast<char*>(*(temp++))); | 243 WTF::Partitions::fastFree(const_cast<char*>(*(temp++))); |
243 } | 244 } |
244 WTF::Partitions::fastFree(params); | 245 WTF::Partitions::fastFree(params); |
245 } | 246 } |
246 | 247 |
247 static xsltStylesheetPtr xsltStylesheetPointer( | 248 static xsltStylesheetPtr xsltStylesheetPointer( |
248 Document* document, | 249 Document* document, |
249 Member<XSLStyleSheet>& cachedStylesheet, | 250 Member<XSLStyleSheet>& cachedStylesheet, |
250 Node* stylesheetRootNode) { | 251 Node* stylesheetRootNode) { |
251 if (!cachedStylesheet && stylesheetRootNode) { | 252 if (!cachedStylesheet && stylesheetRootNode) { |
252 // When using importStylesheet, we will use the given document as the import
ed stylesheet's owner. | 253 // When using importStylesheet, we will use the given document as the |
| 254 // imported stylesheet's owner. |
253 cachedStylesheet = XSLStyleSheet::createForXSLTProcessor( | 255 cachedStylesheet = XSLStyleSheet::createForXSLTProcessor( |
254 stylesheetRootNode->parentNode() | 256 stylesheetRootNode->parentNode() |
255 ? &stylesheetRootNode->parentNode()->document() | 257 ? &stylesheetRootNode->parentNode()->document() |
256 : document, | 258 : document, |
257 stylesheetRootNode, stylesheetRootNode->document().url().getString(), | 259 stylesheetRootNode, stylesheetRootNode->document().url().getString(), |
258 stylesheetRootNode->document() | 260 stylesheetRootNode->document() |
259 .url()); // FIXME: Should we use baseURL here? | 261 .url()); // FIXME: Should we use baseURL here? |
260 | 262 |
261 // According to Mozilla documentation, the node must be a Document node, | 263 // According to Mozilla documentation, the node must be a Document node, |
262 // an xsl:stylesheet or xsl:transform element. But we just use text | 264 // an xsl:stylesheet or xsl:transform element. But we just use text |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 | 387 |
386 sheet->method = origMethod; | 388 sheet->method = origMethod; |
387 setXSLTLoadCallBack(0, 0, 0); | 389 setXSLTLoadCallBack(0, 0, 0); |
388 xsltFreeStylesheet(sheet); | 390 xsltFreeStylesheet(sheet); |
389 m_stylesheet = nullptr; | 391 m_stylesheet = nullptr; |
390 | 392 |
391 return success; | 393 return success; |
392 } | 394 } |
393 | 395 |
394 } // namespace blink | 396 } // namespace blink |
OLD | NEW |