OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. |
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> | 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> |
6 * Copyright (C) Research In Motion Limited 2009. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2009. All rights reserved. |
7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> | 7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> |
8 * Copyright (C) 2011 Google Inc. All rights reserved. | 8 * Copyright (C) 2011 Google Inc. All rights reserved. |
9 * | 9 * |
10 * Redistribution and use in source and binary forms, with or without | 10 * Redistribution and use in source and binary forms, with or without |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 #include "core/dom/Event.h" | 44 #include "core/dom/Event.h" |
45 #include "core/dom/EventNames.h" | 45 #include "core/dom/EventNames.h" |
46 #include "core/dom/PageTransitionEvent.h" | 46 #include "core/dom/PageTransitionEvent.h" |
47 #include "core/editing/Editor.h" | 47 #include "core/editing/Editor.h" |
48 #include "core/fetch/FetchContext.h" | 48 #include "core/fetch/FetchContext.h" |
49 #include "core/fetch/ResourceFetcher.h" | 49 #include "core/fetch/ResourceFetcher.h" |
50 #include "core/fetch/ResourceLoader.h" | 50 #include "core/fetch/ResourceLoader.h" |
51 #include "core/history/BackForwardController.h" | 51 #include "core/history/BackForwardController.h" |
52 #include "core/history/HistoryItem.h" | 52 #include "core/history/HistoryItem.h" |
53 #include "core/html/HTMLFormElement.h" | 53 #include "core/html/HTMLFormElement.h" |
54 #include "core/html/HTMLObjectElement.h" | 54 #include "core/html/HTMLFrameOwnerElement.h" |
55 #include "core/html/parser/HTMLParserIdioms.h" | 55 #include "core/html/parser/HTMLParserIdioms.h" |
56 #include "core/inspector/InspectorController.h" | 56 #include "core/inspector/InspectorController.h" |
57 #include "core/inspector/InspectorInstrumentation.h" | 57 #include "core/inspector/InspectorInstrumentation.h" |
58 #include "core/loader/DocumentLoadTiming.h" | 58 #include "core/loader/DocumentLoadTiming.h" |
59 #include "core/loader/DocumentLoader.h" | 59 #include "core/loader/DocumentLoader.h" |
60 #include "core/loader/FormState.h" | 60 #include "core/loader/FormState.h" |
61 #include "core/loader/FormSubmission.h" | 61 #include "core/loader/FormSubmission.h" |
62 #include "core/loader/FrameFetchContext.h" | 62 #include "core/loader/FrameFetchContext.h" |
63 #include "core/loader/FrameLoadRequest.h" | 63 #include "core/loader/FrameLoadRequest.h" |
64 #include "core/loader/FrameLoaderClient.h" | 64 #include "core/loader/FrameLoaderClient.h" |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 if (m_opener) | 510 if (m_opener) |
511 m_opener->loader()->m_openedFrames.remove(m_frame); | 511 m_opener->loader()->m_openedFrames.remove(m_frame); |
512 if (opener) | 512 if (opener) |
513 opener->loader()->m_openedFrames.add(m_frame); | 513 opener->loader()->m_openedFrames.add(m_frame); |
514 m_opener = opener; | 514 m_opener = opener; |
515 | 515 |
516 if (m_frame->document()) | 516 if (m_frame->document()) |
517 m_frame->document()->initSecurityContext(); | 517 m_frame->document()->initSecurityContext(); |
518 } | 518 } |
519 | 519 |
520 // FIXME: This does not belong in FrameLoader! | |
521 void FrameLoader::handleFallbackContent() | |
522 { | |
523 HTMLFrameOwnerElement* owner = m_frame->ownerElement(); | |
524 if (!owner || !owner->hasTagName(objectTag)) | |
525 return; | |
526 toHTMLObjectElement(owner)->renderFallbackContent(); | |
527 } | |
528 | |
529 bool FrameLoader::allowPlugins(ReasonForCallingAllowPlugins reason) | 520 bool FrameLoader::allowPlugins(ReasonForCallingAllowPlugins reason) |
530 { | 521 { |
531 Settings* settings = m_frame->settings(); | 522 Settings* settings = m_frame->settings(); |
532 bool allowed = m_client->allowPlugins(settings && settings->arePluginsEnable
d()); | 523 bool allowed = m_client->allowPlugins(settings && settings->arePluginsEnable
d()); |
533 if (!allowed && reason == AboutToInstantiatePlugin) | 524 if (!allowed && reason == AboutToInstantiatePlugin) |
534 m_client->didNotAllowPlugins(); | 525 m_client->didNotAllowPlugins(); |
535 return allowed; | 526 return allowed; |
536 } | 527 } |
537 | 528 |
538 void FrameLoader::updateForSameDocumentNavigation(const KURL& newURL, SameDocume
ntNavigationSource sameDocumentNavigationSource, PassRefPtr<SerializedScriptValu
e> data, const String& title, UpdateBackForwardListPolicy updateBackForwardList) | 529 void FrameLoader::updateForSameDocumentNavigation(const KURL& newURL, SameDocume
ntNavigationSource sameDocumentNavigationSource, PassRefPtr<SerializedScriptValu
e> data, const String& title, UpdateBackForwardListPolicy updateBackForwardList) |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
956 // FIXME: Is it important for this traversal to be postorder instead of preo
rder? | 947 // FIXME: Is it important for this traversal to be postorder instead of preo
rder? |
957 // If so, add helpers for postorder traversal, and use them. If not, then le
ts not | 948 // If so, add helpers for postorder traversal, and use them. If not, then le
ts not |
958 // use a recursive algorithm here. | 949 // use a recursive algorithm here. |
959 for (Frame* child = m_frame->tree()->firstChild(); child; child = child->tre
e()->nextSibling()) | 950 for (Frame* child = m_frame->tree()->firstChild(); child; child = child->tre
e()->nextSibling()) |
960 child->loader()->closeOldDataSources(); | 951 child->loader()->closeOldDataSources(); |
961 | 952 |
962 if (m_documentLoader) | 953 if (m_documentLoader) |
963 m_client->dispatchWillClose(); | 954 m_client->dispatchWillClose(); |
964 } | 955 } |
965 | 956 |
966 bool FrameLoader::isHostedByObjectElement() const | |
967 { | |
968 HTMLFrameOwnerElement* owner = m_frame->ownerElement(); | |
969 return owner && owner->hasTagName(objectTag); | |
970 } | |
971 | |
972 bool FrameLoader::isLoadingMainFrame() const | 957 bool FrameLoader::isLoadingMainFrame() const |
973 { | 958 { |
974 Page* page = m_frame->page(); | 959 Page* page = m_frame->page(); |
975 return page && m_frame == page->mainFrame(); | 960 return page && m_frame == page->mainFrame(); |
976 } | 961 } |
977 | 962 |
978 bool FrameLoader::subframeIsLoading() const | 963 bool FrameLoader::subframeIsLoading() const |
979 { | 964 { |
980 // It's most likely that the last added frame is the last to load so we walk
backwards. | 965 // It's most likely that the last added frame is the last to load so we walk
backwards. |
981 for (Frame* child = m_frame->tree()->lastChild(); child; child = child->tree
()->previousSibling()) { | 966 for (Frame* child = m_frame->tree()->lastChild(); child; child = child->tree
()->previousSibling()) { |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1296 // Retain because the stop may release the last reference to it. | 1281 // Retain because the stop may release the last reference to it. |
1297 RefPtr<Frame> protect(m_frame); | 1282 RefPtr<Frame> protect(m_frame); |
1298 | 1283 |
1299 RefPtr<DocumentLoader> loader = activeDocumentLoader(); | 1284 RefPtr<DocumentLoader> loader = activeDocumentLoader(); |
1300 if (m_frame->document()->parser()) | 1285 if (m_frame->document()->parser()) |
1301 m_frame->document()->parser()->stopParsing(); | 1286 m_frame->document()->parser()->stopParsing(); |
1302 | 1287 |
1303 // FIXME: We really ought to be able to just check for isCancellation() here
, but there are some | 1288 // FIXME: We really ought to be able to just check for isCancellation() here
, but there are some |
1304 // ResourceErrors that setIsCancellation() but aren't created by ResourceErr
or::cancelledError(). | 1289 // ResourceErrors that setIsCancellation() but aren't created by ResourceErr
or::cancelledError(). |
1305 ResourceError c(ResourceError::cancelledError(KURL())); | 1290 ResourceError c(ResourceError::cancelledError(KURL())); |
1306 if (error.errorCode() != c.errorCode() || error.domain() != c.domain()) | 1291 if ((error.errorCode() != c.errorCode() || error.domain() != c.domain()) &&
m_frame->ownerElement()) |
1307 handleFallbackContent(); | 1292 m_frame->ownerElement()->renderFallbackContent(); |
1308 | 1293 |
1309 checkCompleted(); | 1294 checkCompleted(); |
1310 if (m_frame->page()) | 1295 if (m_frame->page()) |
1311 checkLoadComplete(); | 1296 checkLoadComplete(); |
1312 } | 1297 } |
1313 | 1298 |
1314 void FrameLoader::checkNavigationPolicyAndContinueFragmentScroll(const Navigatio
nAction& action, bool isNewNavigation) | 1299 void FrameLoader::checkNavigationPolicyAndContinueFragmentScroll(const Navigatio
nAction& action, bool isNewNavigation) |
1315 { | 1300 { |
1316 m_documentLoader->setTriggeringAction(action); | 1301 m_documentLoader->setTriggeringAction(action); |
1317 | 1302 |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1711 { | 1696 { |
1712 SandboxFlags flags = m_forcedSandboxFlags; | 1697 SandboxFlags flags = m_forcedSandboxFlags; |
1713 if (Frame* parentFrame = m_frame->tree()->parent()) | 1698 if (Frame* parentFrame = m_frame->tree()->parent()) |
1714 flags |= parentFrame->document()->sandboxFlags(); | 1699 flags |= parentFrame->document()->sandboxFlags(); |
1715 if (HTMLFrameOwnerElement* ownerElement = m_frame->ownerElement()) | 1700 if (HTMLFrameOwnerElement* ownerElement = m_frame->ownerElement()) |
1716 flags |= ownerElement->sandboxFlags(); | 1701 flags |= ownerElement->sandboxFlags(); |
1717 return flags; | 1702 return flags; |
1718 } | 1703 } |
1719 | 1704 |
1720 } // namespace WebCore | 1705 } // namespace WebCore |
OLD | NEW |