Changeset 244590 in webkit


Ignore:
Timestamp:
Apr 24, 2019 8:44:28 AM (5 years ago)
Author:
Chris Dumez
Message:

URL set by document.open() is communicated with the WebPageProxy but not the WebFrameProxy
https://bugs.webkit.org/show_bug.cgi?id=197214
<rdar://problem/49237544>

Reviewed by Alex Christensen.

Source/WebKit:

URL set by document.open() is communicated with the WebPageProxy (since r244361) but not the
WebFrameProxy. This patch fixes this.

  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView _mainFrameURL]):

  • UIProcess/API/Cocoa/WKWebViewPrivate.h:
  • UIProcess/FrameLoadState.cpp:

(WebKit::FrameLoadState::didExplicitOpen):

  • UIProcess/FrameLoadState.h:
  • UIProcess/WebFrameProxy.cpp:

(WebKit::WebFrameProxy::didExplicitOpen):

  • UIProcess/WebFrameProxy.h:
  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::didExplicitOpenForFrame):

Tools:

Extend API test coverage.

  • TestWebKitAPI/Tests/WebKitCocoa/OpenAndCloseWindow.mm:

(TEST):

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r244589 r244590  
     12019-04-24  Chris Dumez  <cdumez@apple.com>
     2
     3        URL set by document.open() is communicated with the WebPageProxy but not the WebFrameProxy
     4        https://bugs.webkit.org/show_bug.cgi?id=197214
     5        <rdar://problem/49237544>
     6
     7        Reviewed by Alex Christensen.
     8
     9        URL set by document.open() is communicated with the WebPageProxy (since r244361) but not the
     10        WebFrameProxy. This patch fixes this.
     11
     12        * UIProcess/API/Cocoa/WKWebView.mm:
     13        (-[WKWebView _mainFrameURL]):
     14        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
     15        * UIProcess/FrameLoadState.cpp:
     16        (WebKit::FrameLoadState::didExplicitOpen):
     17        * UIProcess/FrameLoadState.h:
     18        * UIProcess/WebFrameProxy.cpp:
     19        (WebKit::WebFrameProxy::didExplicitOpen):
     20        * UIProcess/WebFrameProxy.h:
     21        * UIProcess/WebPageProxy.cpp:
     22        (WebKit::WebPageProxy::didExplicitOpenForFrame):
     23
    1242019-04-24  Chris Dumez  <cdumez@apple.com>
    225
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm

    r244582 r244590  
    47054705}
    47064706
     4707- (NSURL *)_mainFrameURL
     4708{
     4709    if (auto* frame = _page->mainFrame())
     4710        return frame->url();
     4711    return nil;
     4712}
     4713
    47074714- (void)_loadAlternateHTMLString:(NSString *)string baseURL:(NSURL *)baseURL forUnreachableURL:(NSURL *)unreachableURL
    47084715{
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h

    r244151 r244590  
    137137
    138138@property (nonatomic, readonly) NSURL *_unreachableURL;
     139@property (nonatomic, readonly) NSURL *_mainFrameURL WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
    139140
    140141- (void)_loadAlternateHTMLString:(NSString *)string baseURL:(NSURL *)baseURL forUnreachableURL:(NSURL *)unreachableURL;
  • trunk/Source/WebKit/UIProcess/FrameLoadState.cpp

    r238771 r244590  
    3939    m_state = State::Provisional;
    4040    m_provisionalURL = url;
     41}
     42
     43void FrameLoadState::didExplicitOpen(const URL& url)
     44{
     45    m_url = url;
     46    m_provisionalURL = { };
    4147}
    4248
  • trunk/Source/WebKit/UIProcess/FrameLoadState.h

    r238771 r244590  
    4141
    4242    void didStartProvisionalLoad(const URL&);
     43    void didExplicitOpen(const URL&);
    4344    void didReceiveServerRedirectForProvisionalLoad(const URL&);
    4445    void didFailProvisionalLoad();
  • trunk/Source/WebKit/UIProcess/WebFrameProxy.cpp

    r244148 r244590  
    147147}
    148148
     149void WebFrameProxy::didExplicitOpen(const URL& url)
     150{
     151    m_frameLoadState.didExplicitOpen(url);
     152}
     153
    149154void WebFrameProxy::didReceiveServerRedirectForProvisionalLoad(const URL& url)
    150155{
  • trunk/Source/WebKit/UIProcess/WebFrameProxy.h

    r244148 r244590  
    112112
    113113    void didStartProvisionalLoad(const URL&);
     114    void didExplicitOpen(const URL&);
    114115    void didReceiveServerRedirectForProvisionalLoad(const URL&);
    115116    void didFailProvisionalLoad();
  • trunk/Source/WebKit/UIProcess/WebPageProxy.cpp

    r244582 r244590  
    39373937        m_pageLoadState.didExplicitOpen(transaction, url);
    39383938
     3939    frame->didExplicitOpen(url);
     3940
    39393941    m_hasCommittedAnyProvisionalLoads = true;
    39403942    m_process->didCommitProvisionalLoad();
  • trunk/Tools/ChangeLog

    r244585 r244590  
     12019-04-24  Chris Dumez  <cdumez@apple.com>
     2
     3        URL set by document.open() is communicated with the WebPageProxy but not the WebFrameProxy
     4        https://bugs.webkit.org/show_bug.cgi?id=197214
     5        <rdar://problem/49237544>
     6
     7        Reviewed by Alex Christensen.
     8
     9        Extend API test coverage.
     10
     11        * TestWebKitAPI/Tests/WebKitCocoa/OpenAndCloseWindow.mm:
     12        (TEST):
     13
    1142019-04-24  Philippe Normand  <pnormand@igalia.com>
    215
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/OpenAndCloseWindow.mm

    r244361 r244590  
    317317    while (![[[openedWebView URL] absoluteString] isEqualToString:[[webView URL] absoluteString]])
    318318        TestWebKitAPI::Util::sleep(0.1);
    319 }
     319
     320    EXPECT_TRUE([[[openedWebView _mainFrameURL] absoluteString] isEqualToString:[[webView URL] absoluteString]]);
     321}
Note: See TracChangeset for help on using the changeset viewer.