| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 902 RefPtr<Document> document = DOMImplementation::createDocument(mimeType, fram
e, url, frame->inViewSourceMode()); | 902 RefPtr<Document> document = DOMImplementation::createDocument(mimeType, fram
e, url, frame->inViewSourceMode()); |
| 903 if (document->isPluginDocument() && document->isSandboxed(SandboxPlugins)) | 903 if (document->isPluginDocument() && document->isSandboxed(SandboxPlugins)) |
| 904 document = SinkDocument::create(DocumentInit(url, frame)); | 904 document = SinkDocument::create(DocumentInit(url, frame)); |
| 905 bool shouldReuseDefaultView = frame->loader()->stateMachine()->isDisplayingI
nitialEmptyDocument() && frame->document()->isSecureTransitionTo(url); | 905 bool shouldReuseDefaultView = frame->loader()->stateMachine()->isDisplayingI
nitialEmptyDocument() && frame->document()->isSecureTransitionTo(url); |
| 906 | 906 |
| 907 ClearOptions options = 0; | 907 ClearOptions options = 0; |
| 908 if (!shouldReuseDefaultView) | 908 if (!shouldReuseDefaultView) |
| 909 options = ClearWindowProperties | ClearScriptObjects; | 909 options = ClearWindowProperties | ClearScriptObjects; |
| 910 frame->loader()->clear(options); | 910 frame->loader()->clear(options); |
| 911 | 911 |
| 912 if (frame->document() && frame->document()->attached()) | 912 if (frame->document() && frame->document()->confusingAndOftenMisusedAttached
()) |
| 913 frame->document()->prepareForDestruction(); | 913 frame->document()->prepareForDestruction(); |
| 914 | 914 |
| 915 if (!shouldReuseDefaultView) | 915 if (!shouldReuseDefaultView) |
| 916 frame->setDOMWindow(DOMWindow::create(frame)); | 916 frame->setDOMWindow(DOMWindow::create(frame)); |
| 917 | 917 |
| 918 frame->loader()->setOutgoingReferrer(url); | 918 frame->loader()->setOutgoingReferrer(url); |
| 919 frame->domWindow()->setDocument(document); | 919 frame->domWindow()->setDocument(document); |
| 920 | 920 |
| 921 if (ownerDocument) { | 921 if (ownerDocument) { |
| 922 document->setCookieURL(ownerDocument->cookieURL()); | 922 document->setCookieURL(ownerDocument->cookieURL()); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 941 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume
nt) | 941 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume
nt) |
| 942 { | 942 { |
| 943 m_frame->loader()->stopAllLoaders(); | 943 m_frame->loader()->stopAllLoaders(); |
| 944 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url(
), mimeType(), m_writer ? m_writer->encoding() : "", m_writer ? m_writer->encod
ingWasChosenByUser() : false, true); | 944 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url(
), mimeType(), m_writer ? m_writer->encoding() : "", m_writer ? m_writer->encod
ingWasChosenByUser() : false, true); |
| 945 if (!source.isNull()) | 945 if (!source.isNull()) |
| 946 m_writer->appendReplacingData(source); | 946 m_writer->appendReplacingData(source); |
| 947 endWriting(m_writer.get()); | 947 endWriting(m_writer.get()); |
| 948 } | 948 } |
| 949 | 949 |
| 950 } // namespace WebCore | 950 } // namespace WebCore |
| OLD | NEW |