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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 Document* result = nullptr; | 66 Document* result = nullptr; |
67 DocumentInit init(sourceIsDocument ? ownerDocument->url() : KURL(), frame); | 67 DocumentInit init(sourceIsDocument ? ownerDocument->url() : KURL(), frame); |
68 | 68 |
69 bool forceXHTML = sourceMIMEType == "text/plain"; | 69 bool forceXHTML = sourceMIMEType == "text/plain"; |
70 if (forceXHTML) | 70 if (forceXHTML) |
71 transformTextStringToXHTMLDocumentString(documentSource); | 71 transformTextStringToXHTMLDocumentString(documentSource); |
72 | 72 |
73 if (frame) { | 73 if (frame) { |
74 Document* oldDocument = frame->document(); | 74 Document* oldDocument = frame->document(); |
75 // Before parsing, we need to save & detach the old document and get the
new document | 75 // Before parsing, we need to save & detach the old document and get the
new document |
76 // in place. Document::detachLayoutTree() tears down the FrameView, so r
emember whether or not | 76 // in place. Document::shutdown() tears down the FrameView, so remember
whether or not |
77 // there was one. | 77 // there was one. |
78 bool hasView = frame->view(); | 78 bool hasView = frame->view(); |
79 oldDocument->detachLayoutTree(); | 79 oldDocument->shutdown(); |
80 // Re-create the FrameView if needed. | 80 // Re-create the FrameView if needed. |
81 if (hasView) | 81 if (hasView) |
82 frame->loader().client()->transitionToCommittedForNewPage(); | 82 frame->loader().client()->transitionToCommittedForNewPage(); |
83 result = frame->localDOMWindow()->installNewDocument(sourceMIMEType, ini
t, forceXHTML); | 83 result = frame->localDOMWindow()->installNewDocument(sourceMIMEType, ini
t, forceXHTML); |
84 | 84 |
85 if (oldDocument) { | 85 if (oldDocument) { |
86 DocumentXSLT::from(*result).setTransformSourceDocument(oldDocument); | 86 DocumentXSLT::from(*result).setTransformSourceDocument(oldDocument); |
87 result->updateSecurityOrigin(oldDocument->getSecurityOrigin()); | 87 result->updateSecurityOrigin(oldDocument->getSecurityOrigin()); |
88 result->setCookieURL(oldDocument->cookieURL()); | 88 result->setCookieURL(oldDocument->cookieURL()); |
89 | 89 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 } | 156 } |
157 | 157 |
158 DEFINE_TRACE(XSLTProcessor) | 158 DEFINE_TRACE(XSLTProcessor) |
159 { | 159 { |
160 visitor->trace(m_stylesheet); | 160 visitor->trace(m_stylesheet); |
161 visitor->trace(m_stylesheetRootNode); | 161 visitor->trace(m_stylesheetRootNode); |
162 visitor->trace(m_document); | 162 visitor->trace(m_document); |
163 } | 163 } |
164 | 164 |
165 } // namespace blink | 165 } // namespace blink |
OLD | NEW |