| 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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 } | 273 } |
| 274 | 274 |
| 275 bool XSLTProcessor::transformToString(Node* sourceNode, String& mimeType, String
& resultString, String& resultEncoding) | 275 bool XSLTProcessor::transformToString(Node* sourceNode, String& mimeType, String
& resultString, String& resultEncoding) |
| 276 { | 276 { |
| 277 RefPtr<Document> ownerDocument(sourceNode->document()); | 277 RefPtr<Document> ownerDocument(sourceNode->document()); |
| 278 | 278 |
| 279 setXSLTLoadCallBack(docLoaderFunc, this, ownerDocument->fetcher()); | 279 setXSLTLoadCallBack(docLoaderFunc, this, ownerDocument->fetcher()); |
| 280 xsltStylesheetPtr sheet = xsltStylesheetPointer(m_stylesheet, m_stylesheetRo
otNode.get()); | 280 xsltStylesheetPtr sheet = xsltStylesheetPointer(m_stylesheet, m_stylesheetRo
otNode.get()); |
| 281 if (!sheet) { | 281 if (!sheet) { |
| 282 setXSLTLoadCallBack(0, 0, 0); | 282 setXSLTLoadCallBack(0, 0, 0); |
| 283 m_stylesheet = 0; | 283 m_stylesheet = nullptr; |
| 284 return false; | 284 return false; |
| 285 } | 285 } |
| 286 m_stylesheet->clearDocuments(); | 286 m_stylesheet->clearDocuments(); |
| 287 | 287 |
| 288 xmlChar* origMethod = sheet->method; | 288 xmlChar* origMethod = sheet->method; |
| 289 if (!origMethod && mimeType == "text/html") | 289 if (!origMethod && mimeType == "text/html") |
| 290 sheet->method = (xmlChar*)"html"; | 290 sheet->method = (xmlChar*)"html"; |
| 291 | 291 |
| 292 bool success = false; | 292 bool success = false; |
| 293 bool shouldFreeSourceDoc = false; | 293 bool shouldFreeSourceDoc = false; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 if ((success = saveResultToString(resultDoc, sheet, resultString))) { | 332 if ((success = saveResultToString(resultDoc, sheet, resultString))) { |
| 333 mimeType = resultMIMEType(resultDoc, sheet); | 333 mimeType = resultMIMEType(resultDoc, sheet); |
| 334 resultEncoding = (char*)resultDoc->encoding; | 334 resultEncoding = (char*)resultDoc->encoding; |
| 335 } | 335 } |
| 336 xmlFreeDoc(resultDoc); | 336 xmlFreeDoc(resultDoc); |
| 337 } | 337 } |
| 338 | 338 |
| 339 sheet->method = origMethod; | 339 sheet->method = origMethod; |
| 340 setXSLTLoadCallBack(0, 0, 0); | 340 setXSLTLoadCallBack(0, 0, 0); |
| 341 xsltFreeStylesheet(sheet); | 341 xsltFreeStylesheet(sheet); |
| 342 m_stylesheet = 0; | 342 m_stylesheet = nullptr; |
| 343 | 343 |
| 344 return success; | 344 return success; |
| 345 } | 345 } |
| 346 | 346 |
| 347 } // namespace WebCore | 347 } // namespace WebCore |
| OLD | NEW |