Prepare submitForm for seamless navigation
https://bugs.webkit.org/show_bug.cgi?id=83838

Reviewed by Ryosuke Niwa.

Previously, FrameLoader::submitForm called FrameTree::find and
Document::canNavigate separately.  This patch refactors this function
to call findFrameForNavigation, which does both checks.

This doesn't change any behavior today, but it prepares us to implement
seamless navigation.  Once the seamless branch lands, this change will
be tested by seamless-form-* in https://github.com/eseidel/webkit/tree/seamless/LayoutTests/fast/frames/seamless

For context, see:
https://github.com/eseidel/webkit/commit/3f27340577ac91b2cc0a834dd2c6fdfcac296c32

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::submitForm):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114093 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp
index 57bef6a..1de8374 100644
--- a/Source/WebCore/loader/FrameLoader.cpp
+++ b/Source/WebCore/loader/FrameLoader.cpp
@@ -310,9 +310,7 @@
         return;
     }
 
-    Frame* targetFrame = m_frame->tree()->find(submission->target());
-    if (!submission->state()->sourceDocument()->canNavigate(targetFrame))
-        return;
+    Frame* targetFrame = findFrameForNavigation(submission->target(), submission->state()->sourceDocument());
     if (!targetFrame) {
         if (!DOMWindow::allowPopUp(m_frame) && !ScriptController::processingUserGesture())
             return;