| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 62 |
| 63 PassRefPtr<Document> XSLTProcessor::createDocumentFromSource(const String& sourc
eString, | 63 PassRefPtr<Document> XSLTProcessor::createDocumentFromSource(const String& sourc
eString, |
| 64 const String& sourceEncoding, const String& sourceMIMEType, Node* sourceNode
, Frame* frame) | 64 const String& sourceEncoding, const String& sourceMIMEType, Node* sourceNode
, Frame* frame) |
| 65 { | 65 { |
| 66 RefPtr<Document> ownerDocument = sourceNode->document(); | 66 RefPtr<Document> ownerDocument = sourceNode->document(); |
| 67 bool sourceIsDocument = (sourceNode == ownerDocument.get()); | 67 bool sourceIsDocument = (sourceNode == ownerDocument.get()); |
| 68 String documentSource = sourceString; | 68 String documentSource = sourceString; |
| 69 | 69 |
| 70 RefPtr<Document> result; | 70 RefPtr<Document> result; |
| 71 if (sourceMIMEType == "text/plain") { | 71 if (sourceMIMEType == "text/plain") { |
| 72 result = Document::create(frame, sourceIsDocument ? ownerDocument->url()
: KURL()); | 72 result = Document::create(DocumentInit(sourceIsDocument ? ownerDocument-
>url() : KURL(), frame)); |
| 73 transformTextStringToXHTMLDocumentString(documentSource); | 73 transformTextStringToXHTMLDocumentString(documentSource); |
| 74 } else | 74 } else |
| 75 result = DOMImplementation::createDocument(sourceMIMEType, frame, source
IsDocument ? ownerDocument->url() : KURL(), false); | 75 result = DOMImplementation::createDocument(sourceMIMEType, frame, source
IsDocument ? ownerDocument->url() : KURL(), false); |
| 76 | 76 |
| 77 // Before parsing, we need to save & detach the old document and get the new
document | 77 // Before parsing, we need to save & detach the old document and get the new
document |
| 78 // in place. We have to do this only if we're rendering the result document. | 78 // in place. We have to do this only if we're rendering the result document. |
| 79 if (frame) { | 79 if (frame) { |
| 80 if (FrameView* view = frame->view()) | 80 if (FrameView* view = frame->view()) |
| 81 view->clear(); | 81 view->clear(); |
| 82 | 82 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 } | 152 } |
| 153 | 153 |
| 154 void XSLTProcessor::reset() | 154 void XSLTProcessor::reset() |
| 155 { | 155 { |
| 156 m_stylesheet.clear(); | 156 m_stylesheet.clear(); |
| 157 m_stylesheetRootNode.clear(); | 157 m_stylesheetRootNode.clear(); |
| 158 m_parameters.clear(); | 158 m_parameters.clear(); |
| 159 } | 159 } |
| 160 | 160 |
| 161 } // namespace WebCore | 161 } // namespace WebCore |
| OLD | NEW |