| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 | 53 |
| 54 XSLTProcessor::~XSLTProcessor() | 54 XSLTProcessor::~XSLTProcessor() |
| 55 { | 55 { |
| 56 // Stylesheet shouldn't outlive its root node. | 56 // Stylesheet shouldn't outlive its root node. |
| 57 ASSERT(!m_stylesheetRootNode || !m_stylesheet || m_stylesheet->hasOneRef()); | 57 ASSERT(!m_stylesheetRootNode || !m_stylesheet || m_stylesheet->hasOneRef()); |
| 58 } | 58 } |
| 59 | 59 |
| 60 PassRefPtr<Document> XSLTProcessor::createDocumentFromSource(const String& sourc
eString, | 60 PassRefPtr<Document> XSLTProcessor::createDocumentFromSource(const String& sourc
eString, |
| 61 const String& sourceEncoding, const String& sourceMIMEType, Node* sourceNode
, Frame* frame) | 61 const String& sourceEncoding, const String& sourceMIMEType, Node* sourceNode
, Frame* frame) |
| 62 { | 62 { |
| 63 RefPtr<Document> ownerDocument = sourceNode->document(); | 63 RefPtr<Document> ownerDocument = &sourceNode->document(); |
| 64 bool sourceIsDocument = (sourceNode == ownerDocument.get()); | 64 bool sourceIsDocument = (sourceNode == ownerDocument.get()); |
| 65 String documentSource = sourceString; | 65 String documentSource = sourceString; |
| 66 | 66 |
| 67 RefPtr<Document> result; | 67 RefPtr<Document> result; |
| 68 if (sourceMIMEType == "text/plain") { | 68 if (sourceMIMEType == "text/plain") { |
| 69 result = Document::create(DocumentInit(sourceIsDocument ? ownerDocument-
>url() : KURL(), frame)); | 69 result = Document::create(DocumentInit(sourceIsDocument ? ownerDocument-
>url() : KURL(), frame)); |
| 70 transformTextStringToXHTMLDocumentString(documentSource); | 70 transformTextStringToXHTMLDocumentString(documentSource); |
| 71 } else | 71 } else |
| 72 result = DOMImplementation::createDocument(sourceMIMEType, frame, source
IsDocument ? ownerDocument->url() : KURL(), false); | 72 result = DOMImplementation::createDocument(sourceMIMEType, frame, source
IsDocument ? ownerDocument->url() : KURL(), false); |
| 73 | 73 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 } | 145 } |
| 146 | 146 |
| 147 void XSLTProcessor::reset() | 147 void XSLTProcessor::reset() |
| 148 { | 148 { |
| 149 m_stylesheet.clear(); | 149 m_stylesheet.clear(); |
| 150 m_stylesheetRootNode.clear(); | 150 m_stylesheetRootNode.clear(); |
| 151 m_parameters.clear(); | 151 m_parameters.clear(); |
| 152 } | 152 } |
| 153 | 153 |
| 154 } // namespace WebCore | 154 } // namespace WebCore |
| OLD | NEW |