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 result = Document::create(frame, sourceIsDocument ? ownerDocument->url()
: KURL()); | 77 result = Document::create(frame, sourceIsDocument ? ownerDocument->url()
: KURL()); |
78 transformTextStringToXHTMLDocumentString(documentSource); | 78 transformTextStringToXHTMLDocumentString(documentSource); |
79 } else | 79 } else |
80 result = DOMImplementation::createDocument(sourceMIMEType, frame, source
IsDocument ? ownerDocument->url() : KURL(), false); | 80 result = DOMImplementation::createDocument(sourceMIMEType, frame, source
IsDocument ? ownerDocument->url() : KURL(), false); |
81 | 81 |
82 // Before parsing, we need to save & detach the old document and get the new
document | 82 // Before parsing, we need to save & detach the old document and get the new
document |
83 // in place. We have to do this only if we're rendering the result document. | 83 // in place. We have to do this only if we're rendering the result document. |
84 if (frame) { | 84 if (frame) { |
85 if (FrameView* view = frame->view()) | 85 if (FrameView* view = frame->view()) |
86 view->clear(); | 86 view->clear(); |
87 result->setTransformSourceDocument(frame->document()); | 87 |
| 88 if (Document* oldDocument = frame->document()) { |
| 89 result->setTransformSourceDocument(oldDocument); |
| 90 result->setSecurityOrigin(oldDocument->securityOrigin()); |
| 91 result->setCookieURL(oldDocument->cookieURL()); |
| 92 } |
| 93 |
88 frame->setDocument(result); | 94 frame->setDocument(result); |
89 } | 95 } |
90 | 96 |
91 RefPtr<TextResourceDecoder> decoder = TextResourceDecoder::create(sourceMIME
Type); | 97 RefPtr<TextResourceDecoder> decoder = TextResourceDecoder::create(sourceMIME
Type); |
92 decoder->setEncoding(sourceEncoding.isEmpty() ? UTF8Encoding() : TextEncodin
g(sourceEncoding), TextResourceDecoder::EncodingFromXMLHeader); | 98 decoder->setEncoding(sourceEncoding.isEmpty() ? UTF8Encoding() : TextEncodin
g(sourceEncoding), TextResourceDecoder::EncodingFromXMLHeader); |
93 result->setDecoder(decoder.release()); | 99 result->setDecoder(decoder.release()); |
94 | 100 |
95 result->setContent(documentSource); | 101 result->setContent(documentSource); |
96 | 102 |
97 return result.release(); | 103 return result.release(); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 void XSLTProcessor::reset() | 177 void XSLTProcessor::reset() |
172 { | 178 { |
173 m_stylesheet.clear(); | 179 m_stylesheet.clear(); |
174 m_stylesheetRootNode.clear(); | 180 m_stylesheetRootNode.clear(); |
175 m_parameters.clear(); | 181 m_parameters.clear(); |
176 } | 182 } |
177 | 183 |
178 } // namespace WebCore | 184 } // namespace WebCore |
179 | 185 |
180 #endif // ENABLE(XSLT) | 186 #endif // ENABLE(XSLT) |
OLD | NEW |