NavigationAction should track whether the navigation was initiated by the main frame
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Jul 2017 17:25:37 +0000 (17:25 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Jul 2017 17:25:37 +0000 (17:25 +0000)
commitc49c95d2e99df34bbf91a3cce6d5cb896f4583b1
treea3b95616c8c356153b9c70d060ca3e759ca4f619
parentb2866a8d94b069fdde9af6759b7dcd051ea9cd76
NavigationAction should track whether the navigation was initiated by the main frame
https://bugs.webkit.org/show_bug.cgi?id=174386
<rdar://problem/33245267>

Reviewed by Brady Eidson.

Source/WebCore:

Although we added state to NavigationAction to track whether the navigation was
initiated by the main frame in r219170 it is not possible to initialize this state
when instantiating a NavigationAction. Having NavigationAction track this state
will be useful to ensure that we can always compute the source frame information
when asking the embedding client whether to allow a navigation. We will make use
of it in the fix for <https://bugs.webkit.org/show_bug.cgi?id=174385>.

No behavior changed. So, no new tests.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL): Pass whether the load was initiated by the main frame
when instantiating the NavigationAction.
(WebCore::FrameLoader::load): For now, pass InitiatedByMainFrame::Unknown when instantiating
the NavigationAction as we do not know if the load was initiated by the main frame.
(WebCore::FrameLoader::loadWithDocumentLoader): Ditto.
(WebCore::FrameLoader::reload): Ditto
(WebCore::FrameLoader::loadDifferentDocumentItem): Ditto.
(WebCore::createWindow): Pass whether the load was initiated by the main frame when
instantiating the NavigationAction.
* loader/NavigationAction.cpp:
(WebCore::NavigationAction::NavigationAction): Modified to take argument of type InitiatedByMainFrame
that indicates whether the navigation was initiated by the main frame.
* loader/NavigationAction.h:
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy): For now, pass InitiatedByMainFrame::Unknown
when instantiating the NavigationAction as we do not know if the load was initiated by the
main frame.
* page/ContextMenuController.cpp:
(WebCore::openNewWindow): Pass whether the load was initiated by the main frame when
instantiating the NavigationAction.

Source/WebKit2:

* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::openInNewTab): Pass whether the load was initiated by the main frame
when instantiating the NavigationAction.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@219407 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/NavigationAction.cpp
Source/WebCore/loader/NavigationAction.h
Source/WebCore/loader/PolicyChecker.cpp
Source/WebCore/page/ContextMenuController.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/WebInspector.cpp