Changeset 207325 in webkit


Ignore:
Timestamp:
Oct 13, 2016 11:29:36 PM (8 years ago)
Author:
Carlos Garcia Campos
Message:

WebView and WebPage URLs not updated after URL is modified by InjectedBundlePageResourceLoadClient::willSendRequestForFrame
https://bugs.webkit.org/show_bug.cgi?id=146306

Reviewed by Darin Adler.

Source/WebCore:

Notify about the provisional URL change when new request set for main resource load in DocumentLoader has a
different URL than the previous one.

  • loader/DocumentLoader.cpp:

(WebCore::DocumentLoader::setRequest):

Tools:

Add unit test to check that the committed URL is updated when changed in willSendRequest callback.

  • TestWebKitAPI/CMakeLists.txt:
  • TestWebKitAPI/PlatformEfl.cmake:
  • TestWebKitAPI/PlatformGTK.cmake:
  • TestWebKitAPI/Tests/WebKit2/ProvisionalURLAfterWillSendRequestCallback.cpp: Added.

(TestWebKitAPI::didCommitLoadForFrame):
(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit2/ProvisionalURLAfterWillSendRequestCallback_Bundle.cpp: Added.

(TestWebKitAPI::ProvisionalURLAfterWillSendRequestCallbackTest::ProvisionalURLAfterWillSendRequestCallbackTest):
(TestWebKitAPI::ProvisionalURLAfterWillSendRequestCallbackTest::willSendRequestForFrame):
(TestWebKitAPI::ProvisionalURLAfterWillSendRequestCallbackTest::didCommitLoadForFrame):

Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r207324 r207325  
     12016-10-13  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        WebView and WebPage URLs not updated after URL is modified by InjectedBundlePageResourceLoadClient::willSendRequestForFrame
     4        https://bugs.webkit.org/show_bug.cgi?id=146306
     5
     6        Reviewed by Darin Adler.
     7
     8        Notify about the provisional URL change when new request set for main resource load in DocumentLoader has a
     9        different URL than the previous one.
     10
     11        * loader/DocumentLoader.cpp:
     12        (WebCore::DocumentLoader::setRequest):
     13
    1142016-10-13  Youenn Fablet  <youenn@apple.com>
    215
  • trunk/Source/WebCore/loader/DocumentLoader.cpp

    r207323 r207325  
    235235    handlingUnreachableURL = m_substituteData.isValid() && !m_substituteData.failingURL().isEmpty();
    236236
     237    bool shouldNotifyAboutProvisionalURLChange = false;
    237238    if (handlingUnreachableURL)
    238239        m_committed = false;
     240    else if (isLoadingMainResource() && req.url() != m_request.url())
     241        shouldNotifyAboutProvisionalURLChange = true;
    239242
    240243    // We should never be getting a redirect callback after the data
     
    244247
    245248    m_request = req;
     249    if (shouldNotifyAboutProvisionalURLChange)
     250        frameLoader()->client().dispatchDidChangeProvisionalURL();
    246251}
    247252
  • trunk/Tools/ChangeLog

    r207321 r207325  
     12016-10-13  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        WebView and WebPage URLs not updated after URL is modified by InjectedBundlePageResourceLoadClient::willSendRequestForFrame
     4        https://bugs.webkit.org/show_bug.cgi?id=146306
     5
     6        Reviewed by Darin Adler.
     7
     8        Add unit test to check that the committed URL is updated when changed in willSendRequest callback.
     9
     10        * TestWebKitAPI/CMakeLists.txt:
     11        * TestWebKitAPI/PlatformEfl.cmake:
     12        * TestWebKitAPI/PlatformGTK.cmake:
     13        * TestWebKitAPI/Tests/WebKit2/ProvisionalURLAfterWillSendRequestCallback.cpp: Added.
     14        (TestWebKitAPI::didCommitLoadForFrame):
     15        (TestWebKitAPI::TEST):
     16        * TestWebKitAPI/Tests/WebKit2/ProvisionalURLAfterWillSendRequestCallback_Bundle.cpp: Added.
     17        (TestWebKitAPI::ProvisionalURLAfterWillSendRequestCallbackTest::ProvisionalURLAfterWillSendRequestCallbackTest):
     18        (TestWebKitAPI::ProvisionalURLAfterWillSendRequestCallbackTest::willSendRequestForFrame):
     19        (TestWebKitAPI::ProvisionalURLAfterWillSendRequestCallbackTest::didCommitLoadForFrame):
     20
    1212016-10-13  Alex Christensen  <achristensen@webkit.org>
    222
  • trunk/Tools/TestWebKitAPI/CMakeLists.txt

    r206470 r207325  
    150150        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayout_Bundle.cpp
    151151        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ParentFrame_Bundle.cpp
     152        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ProvisionalURLAfterWillSendRequestCallback_Bundle.cpp
    152153        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ResponsivenessTimerDoesntFireEarly_Bundle.cpp
    153154        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ShouldGoToBackForwardListItem_Bundle.cpp
  • trunk/Tools/TestWebKitAPI/PlatformEfl.cmake

    r200621 r207325  
    9898    PreventEmptyUserAgent
    9999    PrivateBrowsingPushStateNoHistoryCallback
     100    ProvisionalURLAfterWillSendRequestCallback
    100101    ResponsivenessTimerDoesntFireEarly
    101102    ShouldGoToBackForwardListItem
  • trunk/Tools/TestWebKitAPI/PlatformGTK.cmake

    r204380 r207325  
    102102    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/PreventEmptyUserAgent.cpp
    103103    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/PrivateBrowsingPushStateNoHistoryCallback.cpp
     104    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ProvisionalURLAfterWillSendRequestCallback.cpp
    104105    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ReloadPageAfterCrash.cpp
    105106    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ResizeWindowAfterCrash.cpp
Note: See TracChangeset for help on using the changeset viewer.