Chromium Code Reviews| Index: Source/core/loader/FrameLoader.cpp |
| diff --git a/Source/core/loader/FrameLoader.cpp b/Source/core/loader/FrameLoader.cpp |
| index 8147af34e14c1077d603442f6fea78bacb2dd1b5..d145ce57558f155c6466fd472d50fa6db07f80d7 100644 |
| --- a/Source/core/loader/FrameLoader.cpp |
| +++ b/Source/core/loader/FrameLoader.cpp |
| @@ -1272,6 +1272,31 @@ bool FrameLoader::shouldClose() |
| return shouldClose; |
| } |
| +bool FrameLoader::validateTransitionNavigationMode() |
| +{ |
| + if (frame()->document()->inQuirksMode()) { |
| + frame()->document()->addConsoleMessage(JSMessageSource, ErrorMessageLevel, "Ignoring transition elements due to quirks mode."); |
| + return false; |
| + } |
| + |
| + // FIXME(oysteine): Also check for width=device-width here, to avoid zoom/scaling issues. |
| + return true; |
| +} |
| + |
| +bool FrameLoader::dispatchAnyNavigationTransitionData() |
| +{ |
| + Vector<Document::TransitionElementData> elementData; |
| + frame()->document()->getTransitionElementData(&elementData, IGNORE_EXCEPTION); |
|
esprehn
2014/06/13 08:50:18
We don't allow NodeList and the other things you u
oystein (OOO til 10th of July)
2014/06/13 17:52:27
Avoiding getElementsByTagName seems easy enough, b
|
| + if (elementData.isEmpty() || !validateTransitionNavigationMode()) |
|
esprehn
2014/06/13 08:50:18
The validateTransitionNavigationMode() check shoul
oystein (OOO til 10th of July)
2014/06/18 00:04:08
validateTransitionNavigationMode() also tosses som
|
| + return false; |
| + |
| + Vector<Document::TransitionElementData>::iterator iter = elementData.begin(); |
| + for (; iter != elementData.end(); ++iter) |
| + client()->dispatchAddNavigationTransitionData(iter->scope, iter->markup); |
| + |
| + return true; |
| +} |
| + |
| void FrameLoader::loadWithNavigationAction(const NavigationAction& action, FrameLoadType type, PassRefPtrWillBeRawPtr<FormState> formState, const SubstituteData& substituteData, ClientRedirectPolicy clientRedirect, const AtomicString& overrideEncoding) |
| { |
| ASSERT(client()->hasWebView()); |
| @@ -1301,9 +1326,14 @@ void FrameLoader::loadWithNavigationAction(const NavigationAction& action, Frame |
| else if (m_documentLoader) |
| m_policyDocumentLoader->setOverrideEncoding(m_documentLoader->overrideEncoding()); |
| + |
| + bool isTransitionNavigation = false; |
| + if (RuntimeEnabledFeatures::navigationTransitionsEnabled()) |
| + isTransitionNavigation = dispatchAnyNavigationTransitionData(); |
|
esprehn
2014/06/13 08:50:18
Remove "Any".
oystein (OOO til 10th of July)
2014/06/18 00:04:08
Done.
|
| + |
| // stopAllLoaders can detach the LocalFrame, so protect it. |
| RefPtr<LocalFrame> protect(m_frame); |
| - if ((!m_policyDocumentLoader->shouldContinueForNavigationPolicy(request) || !shouldClose()) && m_policyDocumentLoader) { |
| + if ((!m_policyDocumentLoader->shouldContinueForNavigationPolicy(request, isTransitionNavigation) || !shouldClose()) && m_policyDocumentLoader) { |
| m_policyDocumentLoader->detachFromFrame(); |
| m_policyDocumentLoader = nullptr; |
| return; |
| @@ -1337,7 +1367,7 @@ void FrameLoader::loadWithNavigationAction(const NavigationAction& action, Frame |
| if (m_provisionalDocumentLoader->isClientRedirect()) |
| m_provisionalDocumentLoader->appendRedirect(m_frame->document()->url()); |
| m_provisionalDocumentLoader->appendRedirect(m_provisionalDocumentLoader->request().url()); |
| - client()->dispatchDidStartProvisionalLoad(); |
| + client()->dispatchDidStartProvisionalLoad(isTransitionNavigation); |
| ASSERT(m_provisionalDocumentLoader); |
| m_provisionalDocumentLoader->startLoadingMainResource(); |
| } |