| 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. |
| 11 * | 11 * |
| 12 * This library is distributed in the hope that it will be useful, | 12 * This library is distributed in the hope that it will be useful, |
| 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 * Library General Public License for more details. | 15 * Library General Public License for more details. |
| 16 * | 16 * |
| 17 * You should have received a copy of the GNU Library General Public License | 17 * You should have received a copy of the GNU Library General Public License |
| 18 * along with this library; see the file COPYING.LIB. If not, write to | 18 * along with this library; see the file COPYING.LIB. If not, write to |
| 19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 20 * Boston, MA 02110-1301, USA. | 20 * Boston, MA 02110-1301, USA. |
| 21 */ | 21 */ |
| 22 | 22 |
| 23 #include "config.h" | 23 #include "config.h" |
| 24 #include "core/xml/XSLTProcessor.h" | 24 #include "core/xml/XSLTProcessor.h" |
| 25 | 25 |
| 26 #include "core/dom/Document.h" | 26 #include "core/dom/Document.h" |
| 27 #include "core/dom/TransformSource.h" | 27 #include "core/dom/TransformSource.h" |
| 28 #include "core/editing/markup.h" | 28 #include "core/editing/markup.h" |
| 29 #include "core/fetch/FetchInitiatorTypeNames.h" | 29 #include "core/fetch/FetchInitiatorTypeNames.h" |
| 30 #include "core/fetch/RawResource.h" |
| 30 #include "core/fetch/Resource.h" | 31 #include "core/fetch/Resource.h" |
| 31 #include "core/fetch/ResourceFetcher.h" | 32 #include "core/fetch/ResourceFetcher.h" |
| 32 #include "core/frame/FrameConsole.h" | 33 #include "core/frame/FrameConsole.h" |
| 33 #include "core/frame/FrameHost.h" | 34 #include "core/frame/FrameHost.h" |
| 34 #include "core/frame/LocalFrame.h" | 35 #include "core/frame/LocalFrame.h" |
| 35 #include "core/inspector/ConsoleMessage.h" | 36 #include "core/inspector/ConsoleMessage.h" |
| 36 #include "core/xml/XSLStyleSheet.h" | 37 #include "core/xml/XSLStyleSheet.h" |
| 37 #include "core/xml/XSLTExtensions.h" | 38 #include "core/xml/XSLTExtensions.h" |
| 38 #include "core/xml/XSLTUnicodeSort.h" | 39 #include "core/xml/XSLTUnicodeSort.h" |
| 39 #include "core/xml/parser/XMLDocumentParser.h" | 40 #include "core/xml/parser/XMLDocumentParser.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 switch (type) { | 96 switch (type) { |
| 96 case XSLT_LOAD_DOCUMENT: { | 97 case XSLT_LOAD_DOCUMENT: { |
| 97 xsltTransformContextPtr context = (xsltTransformContextPtr)ctxt; | 98 xsltTransformContextPtr context = (xsltTransformContextPtr)ctxt; |
| 98 xmlChar* base = xmlNodeGetBase(context->document->doc, context->node); | 99 xmlChar* base = xmlNodeGetBase(context->document->doc, context->node); |
| 99 KURL url(KURL(ParsedURLString, reinterpret_cast<const char*>(base)), rei
nterpret_cast<const char*>(uri)); | 100 KURL url(KURL(ParsedURLString, reinterpret_cast<const char*>(base)), rei
nterpret_cast<const char*>(uri)); |
| 100 xmlFree(base); | 101 xmlFree(base); |
| 101 | 102 |
| 102 ResourceLoaderOptions fetchOptions(ResourceFetcher::defaultResourceOptio
ns()); | 103 ResourceLoaderOptions fetchOptions(ResourceFetcher::defaultResourceOptio
ns()); |
| 103 FetchRequest request(ResourceRequest(url), FetchInitiatorTypeNames::xml,
fetchOptions); | 104 FetchRequest request(ResourceRequest(url), FetchInitiatorTypeNames::xml,
fetchOptions); |
| 104 request.setOriginRestriction(FetchRequest::RestrictToSameOrigin); | 105 request.setOriginRestriction(FetchRequest::RestrictToSameOrigin); |
| 105 ResourcePtr<Resource> resource = globalResourceFetcher->fetchSynchronous
ly(request); | 106 ResourcePtr<Resource> resource = RawResource::fetchSynchronously(request
, globalResourceFetcher); |
| 106 if (!resource || !globalProcessor) | 107 if (!resource || !globalProcessor) |
| 107 return nullptr; | 108 return nullptr; |
| 108 | 109 |
| 109 FrameConsole* console = nullptr; | 110 FrameConsole* console = nullptr; |
| 110 LocalFrame* frame = globalProcessor->xslStylesheet()->ownerDocument()->f
rame(); | 111 LocalFrame* frame = globalProcessor->xslStylesheet()->ownerDocument()->f
rame(); |
| 111 if (frame) | 112 if (frame) |
| 112 console = &frame->console(); | 113 console = &frame->console(); |
| 113 xmlSetStructuredErrorFunc(console, XSLTProcessor::parseErrorFunc); | 114 xmlSetStructuredErrorFunc(console, XSLTProcessor::parseErrorFunc); |
| 114 xmlSetGenericErrorFunc(console, XSLTProcessor::genericErrorFunc); | 115 xmlSetGenericErrorFunc(console, XSLTProcessor::genericErrorFunc); |
| 115 | 116 |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 | 345 |
| 345 sheet->method = origMethod; | 346 sheet->method = origMethod; |
| 346 setXSLTLoadCallBack(0, 0, 0); | 347 setXSLTLoadCallBack(0, 0, 0); |
| 347 xsltFreeStylesheet(sheet); | 348 xsltFreeStylesheet(sheet); |
| 348 m_stylesheet = nullptr; | 349 m_stylesheet = nullptr; |
| 349 | 350 |
| 350 return success; | 351 return success; |
| 351 } | 352 } |
| 352 | 353 |
| 353 } // namespace blink | 354 } // namespace blink |
| OLD | NEW |