Changeset 75349 in webkit


Ignore:
Timestamp:
Jan 9, 2011 3:22:47 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-01-09 Xianzhu Wang <phnixwxz@gmail.com>

Reviewed by Darin Fisher.

https://bugs.webkit.org/show_bug.cgi?id=41441
createWindow method should only do window-creating without URL navigation.
Let client APIs know which URL a new window will start with

  • loader/FrameLoader.cpp: (WebCore::createWindow):
  • page/ContextMenuController.cpp: (WebCore::openNewWindow):
  • page/DOMWindow.cpp: (WebCore::DOMWindow::createWindow):

2011-01-09 Xianzhu Wang <phnixwxz@gmail.com>

Reviewed by Darin Fisher.

https://bugs.webkit.org/show_bug.cgi?id=41441
createWindow method should only do window-creating without URL navigation.
Pass URL request to createView.

  • public/WebViewClient.h: (WebKit::WebViewClient::createView):
  • src/ChromeClientImpl.cpp: (WebKit::ChromeClientImpl::createWindow):

2011-01-09 Xianzhu Wang <phnixwxz@gmail.com>

Reviewed by Darin Fisher.

https://bugs.webkit.org/show_bug.cgi?id=41441
createWindow method should only do window-creating without URL navigation

  • WebCoreSupport/ChromeClientEfl.cpp: (WebCore::ChromeClientEfl::createWindow):

2011-01-09 Xianzhu Wang <phnixwxz@gmail.com>

Reviewed by Darin Fisher.

https://bugs.webkit.org/show_bug.cgi?id=41441
createWindow method should only do window-creating without URL navigation

  • WebCoreSupport/ChromeClientGtk.cpp: (WebKit::ChromeClient::createWindow):

2011-01-09 Xianzhu Wang <phnixwxz@gmail.com>

Reviewed by Darin Fisher.

https://bugs.webkit.org/show_bug.cgi?id=41441
createWindow method should only do window-creating without URL navigation

  • WebCoreSupport/WebChromeClient.mm: (WebChromeClient::createWindow):

2011-01-09 Xianzhu Wang <phnixwxz@gmail.com>

Reviewed by Darin Fisher.

https://bugs.webkit.org/show_bug.cgi?id=41441
createWindow method should only do window-creating without URL navigation

  • Api/qwebpage.cpp: (openNewWindow):
  • WebCoreSupport/ChromeClientQt.cpp: (WebCore::ChromeClientQt::createWindow):

2011-01-09 Xianzhu Wang <phnixwxz@gmail.com>

Reviewed by Darin Fisher.

https://bugs.webkit.org/show_bug.cgi?id=41441
createWindow method should only do window-creating without URL navigation

  • WebCoreSupport/WebChromeClient.cpp: (WebChromeClient::createWindow):

2011-01-09 Xianzhu Wang <phnixwxz@gmail.com>

Reviewed by Darin Fisher.

https://bugs.webkit.org/show_bug.cgi?id=41441
createWindow method should only do window-creating without URL navigation

  • WebKitSupport/ChromeClientWx.cpp: (WebCore::ChromeClientWx::createWindow):
Location:
trunk
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r75348 r75349  
     12011-01-09  Xianzhu Wang  <phnixwxz@gmail.com>
     2
     3        Reviewed by Darin Fisher.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=41441
     6        createWindow method should only do window-creating without URL navigation.
     7        Let client APIs know which URL a new window will start with
     8
     9        * loader/FrameLoader.cpp:
     10        (WebCore::createWindow):
     11        * page/ContextMenuController.cpp:
     12        (WebCore::openNewWindow):
     13        * page/DOMWindow.cpp:
     14        (WebCore::DOMWindow::createWindow):
     15
    1162011-01-09  Dirk Schulze  <krit@webkit.org>
    217
  • trunk/Source/WebCore/loader/FrameLoader.cpp

    r75336 r75349  
    34753475        Frame* frame = lookupFrame->tree()->find(request.frameName());
    34763476        if (frame && openerFrame->loader()->shouldAllowNavigation(frame)) {
    3477             if (!request.resourceRequest().url().isEmpty())
    3478                 frame->loader()->loadFrameRequest(request, false, false, 0, 0, SendReferrer);
    34793477            if (Page* page = frame->page())
    34803478                page->chrome()->focus();
  • trunk/Source/WebCore/page/ChromeClient.h

    r75277 r75349  
    101101        // should not be shown to the user until the ChromeClient of the newly
    102102        // created Page has its show method called.
     103        // The FrameLoadRequest parameter is only for ChromeClient to check if the
     104        // request could be fulfilled.  The ChromeClient should not load the request.
    103105        virtual Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&, const NavigationAction&) = 0;
    104106        virtual void show() = 0;
  • trunk/Source/WebCore/page/ContextMenuController.cpp

    r75047 r75349  
    159159    if (Page* oldPage = frame->page()) {
    160160        FrameLoadRequest request(frame->document()->securityOrigin(), ResourceRequest(urlToLoad, frame->loader()->outgoingReferrer()));
    161         WindowFeatures features;
    162         if (Page* newPage = oldPage->chrome()->createWindow(frame, request, features, NavigationAction()))
     161        if (Page* newPage = oldPage->chrome()->createWindow(frame, request, WindowFeatures(), NavigationAction())) {
     162            newPage->mainFrame()->loader()->loadFrameRequest(request, false, false, 0, 0, SendReferrer);   
    163163            newPage->chrome()->show();
     164        }
    164165    }
    165166}
  • trunk/Source/WebCore/page/DOMWindow.cpp

    r75276 r75349  
    16971697    Frame* activeFrame = activeWindow->frame();
    16981698
    1699     // FIXME: It's much better for client API if a new window starts with a URL, here where we
    1700     // know what URL we are going to open. Unfortunately, this code passes the empty string
    1701     // for the URL, but there's a reason for that. Before loading we have to set up the opener,
    1702     // openedByDOM, and dialogArguments values. Also, to decide whether to use the URL we currently
    1703     // do an isInsecureScriptAccess call using the window we create, which can't be done before
    1704     // creating it. We'd have to resolve all those issues to pass the URL instead of an empty string.
    1705 
    17061699    // For whatever reason, Firefox uses the first frame to determine the outgoingReferrer. We replicate that behavior here.
    17071700    String referrer = firstFrame->loader()->outgoingReferrer();
    17081701
    1709     ResourceRequest request(KURL(), referrer);
     1702    KURL completedURL = urlString.isEmpty() ? KURL(ParsedURLString, "") : firstFrame->document()->completeURL(urlString);
     1703    ResourceRequest request(completedURL, referrer);
    17101704    FrameLoader::addHTTPOriginIfNeeded(request, firstFrame->loader()->outgoingOrigin());
    17111705    FrameLoadRequest frameRequest(activeWindow->securityOrigin(), request, frameName);
     
    17261720    if (function)
    17271721        function(newFrame->domWindow(), functionContext);
    1728 
    1729     KURL completedURL = urlString.isEmpty() ? KURL(ParsedURLString, "") : firstFrame->document()->completeURL(urlString);
    17301722
    17311723    if (created)
  • trunk/WebKit/chromium/ChangeLog

    r75317 r75349  
     12011-01-09  Xianzhu Wang  <phnixwxz@gmail.com>
     2
     3        Reviewed by Darin Fisher.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=41441
     6        createWindow method should only do window-creating without URL navigation.
     7        Pass URL request to createView.
     8
     9        * public/WebViewClient.h:
     10        (WebKit::WebViewClient::createView):
     11        * src/ChromeClientImpl.cpp:
     12        (WebKit::ChromeClientImpl::createWindow):
     13
    1142011-01-08  Adam Barth  <abarth@webkit.org>
    215
  • trunk/WebKit/chromium/public/WebViewClient.h

    r73724 r75349  
    6565class WebStorageNamespace;
    6666class WebURL;
     67class WebURLRequest;
    6768class WebView;
    6869class WebWidget;
     
    8384    // so any subsequent calls to createSessionStorageNamespace conform to the
    8485    // WebStorage specification.
     86    // FIXME: This method is DEPRECATED and should be removed once the new
     87    // createView() (the next method) is implemented at Chromium side.
    8588    virtual WebView* createView(WebFrame* creator,
    8689                                const WebWindowFeatures& features,
    8790                                const WebString& name) { return 0; }
     91
     92    // Create a new related WebView.  This method must clone its session storage
     93    // so any subsequent calls to createSessionStorageNamespace conform to the
     94    // WebStorage specification.
     95    // The request parameter is only for the client to check if the request
     96    // could be fulfilled.  The client should not load the request.
     97    virtual WebView* createView(WebFrame* creator,
     98                                const WebURLRequest& request,
     99                                const WebWindowFeatures& features,
     100                                const WebString& name) {
     101        // FIXME: This is a temporary default implementation which calls the old
     102        // version of createView(). Should change to 'return 0' when the old one
     103        // is removed.
     104        (void)request;
     105        return createView(creator, features, name);
     106    }
    88107
    89108    // Create a new WebPopupMenu.  In the second form, the client is
  • trunk/WebKit/chromium/src/ChromeClientImpl.cpp

    r73724 r75349  
    264264        return 0;
    265265
     266    WrappedResourceRequest request;
     267    if (!r.resourceRequest().isEmpty())
     268        request.bind(r.resourceRequest());
    266269    WebViewImpl* newView = static_cast<WebViewImpl*>(
    267         m_webView->client()->createView(WebFrameImpl::fromFrame(frame), features, r.frameName()));
     270        m_webView->client()->createView(WebFrameImpl::fromFrame(frame), request, features, r.frameName()));
    268271    if (!newView)
    269272        return 0;
    270 
    271     // The request is empty when we are just being asked to open a blank window.
    272     // This corresponds to window.open(""), for example.
    273     if (!r.resourceRequest().isEmpty()) {
    274         WrappedResourceRequest request(r.resourceRequest());
    275         newView->mainFrame()->loadRequest(request);
    276     }
    277273
    278274    return newView->page();
  • trunk/WebKit/efl/ChangeLog

    r74684 r75349  
     12011-01-09  Xianzhu Wang <phnixwxz@gmail.com>
     2
     3        Reviewed by Darin Fisher.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=41441
     6        createWindow method should only do window-creating without URL navigation
     7
     8        * WebCoreSupport/ChromeClientEfl.cpp:
     9        (WebCore::ChromeClientEfl::createWindow):
     10
    1112010-12-27  Rafael Antognolli  <antognolli@profusion.mobi>
    212
  • trunk/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp

    r71541 r75349  
    155155        return 0;
    156156
    157     if (!frameLoadRequest.isEmpty())
    158         ewk_view_uri_set(newView, frameLoadRequest.resourceRequest().url().string().utf8().data());
    159 
    160157    return ewk_view_core_page_get(newView);
    161158}
  • trunk/WebKit/gtk/ChangeLog

    r75346 r75349  
     12011-01-09  Xianzhu Wang <phnixwxz@gmail.com>
     2
     3        Reviewed by Darin Fisher.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=41441
     6        createWindow method should only do window-creating without URL navigation
     7
     8        * WebCoreSupport/ChromeClientGtk.cpp:
     9        (WebKit::ChromeClient::createWindow):
     10
    1112011-01-08  Martin Robinson  <mrobinson@igalia.com>
    212
  • trunk/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp

    r75009 r75349  
    161161    g_object_set(webView, "window-features", webWindowFeatures.get(), NULL);
    162162
    163     if (!frameLoadRequest.isEmpty())
    164         webkit_web_view_open(webView, frameLoadRequest.resourceRequest().url().string().utf8().data());
    165 
    166163    return core(webView);
    167164}
  • trunk/WebKit/mac/ChangeLog

    r75316 r75349  
     12011-01-09  Xianzhu Wang <phnixwxz@gmail.com>
     2
     3        Reviewed by Darin Fisher.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=41441
     6        createWindow method should only do window-creating without URL navigation
     7
     8        * WebCoreSupport/WebChromeClient.mm:
     9        (WebChromeClient::createWindow):
     10
    1112011-01-08  Dan Bernstein  <mitz@apple.com>
    212
  • trunk/WebKit/mac/WebCoreSupport/WebChromeClient.mm

    r75277 r75349  
    198198}
    199199
    200 Page* WebChromeClient::createWindow(Frame* frame, const FrameLoadRequest& request, const WindowFeatures& features, const NavigationAction&)
    201 {
    202     NSURLRequest *URLRequest = nil;
    203     if (!request.isEmpty())
    204         URLRequest = request.resourceRequest().nsURLRequest();
    205    
     200Page* WebChromeClient::createWindow(Frame* frame, const FrameLoadRequest&, const WindowFeatures& features, const NavigationAction&)
     201{
    206202    id delegate = [m_webView UIDelegate];
    207203    WebView *newWebView;
     
    239235            [dictFeatures setObject:height forKey:@"height"];
    240236       
    241         newWebView = CallUIDelegate(m_webView, @selector(webView:createWebViewWithRequest:windowFeatures:), URLRequest, dictFeatures);
     237        newWebView = CallUIDelegate(m_webView, @selector(webView:createWebViewWithRequest:windowFeatures:), nil, dictFeatures);
    242238       
    243239        [dictFeatures release];
     
    254250        [dialog release];
    255251    } else if (features.dialog && [delegate respondsToSelector:@selector(webView:createWebViewModalDialogWithRequest:)]) {
    256         newWebView = CallUIDelegate(m_webView, @selector(webView:createWebViewModalDialogWithRequest:), URLRequest);
     252        newWebView = CallUIDelegate(m_webView, @selector(webView:createWebViewModalDialogWithRequest:), nil);
    257253    } else {
    258         newWebView = CallUIDelegate(m_webView, @selector(webView:createWebViewWithRequest:), URLRequest);
     254        newWebView = CallUIDelegate(m_webView, @selector(webView:createWebViewWithRequest:), nil);
    259255    }
    260256
  • trunk/WebKit/qt/Api/qwebpage.cpp

    r75242 r75349  
    22632263        WindowFeatures features;
    22642264        NavigationAction action;
    2265         if (Page* newPage = oldPage->chrome()->createWindow(frame,
    2266                 frameLoadRequest(url, frame), features, action))
     2265        FrameLoadRequest request = frameLoadRequest(url, frame);
     2266        if (Page* newPage = oldPage->chrome()->createWindow(frame, request, features, action)) {
     2267            newPage->mainFrame()->loader()->loadFrameRequest(request, false, false, 0, 0, SendReferrer);
    22672268            newPage->chrome()->show();
     2269        }
    22682270    }
    22692271}
  • trunk/WebKit/qt/ChangeLog

    r75337 r75349  
     12011-01-09  Xianzhu Wang <phnixwxz@gmail.com>
     2
     3        Reviewed by Darin Fisher.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=41441
     6        createWindow method should only do window-creating without URL navigation
     7
     8        * Api/qwebpage.cpp:
     9        (openNewWindow):
     10        * WebCoreSupport/ChromeClientQt.cpp:
     11        (WebCore::ChromeClientQt::createWindow):
     12
    1132011-01-08  Benjamin Poulain  <benjamin.poulain@nokia.com>
    214
  • trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp

    r73867 r75349  
    183183    // A call to QWebPage::mainFrame() implicitly creates the main frame.
    184184    // Make sure it exists, as WebCore expects it when returning from this call.
    185     QWebFrame* mainFrame = newPage->mainFrame();
    186 
    187     if (!request.isEmpty())
    188         mainFrame->load(request.resourceRequest().url());
     185    newPage->mainFrame();
    189186    return newPage->d->page;
    190187}
  • trunk/WebKit/win/ChangeLog

    r75313 r75349  
     12011-01-09  Xianzhu Wang <phnixwxz@gmail.com>
     2
     3        Reviewed by Darin Fisher.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=41441
     6        createWindow method should only do window-creating without URL navigation
     7
     8        * WebCoreSupport/WebChromeClient.cpp:
     9        (WebChromeClient::createWindow):
     10
    1112011-01-07  Adam Barth  <abarth@webkit.org>
    212
  • trunk/WebKit/win/WebCoreSupport/WebChromeClient.cpp

    r75262 r75349  
    197197}
    198198
    199 Page* WebChromeClient::createWindow(Frame*, const FrameLoadRequest& frameLoadRequest, const WindowFeatures& features, const NavigationAction&)
     199Page* WebChromeClient::createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures& features, const NavigationAction&)
    200200{
    201201    COMPtr<IWebUIDelegate> delegate = uiDelegate();
     
    203203        return 0;
    204204
    205     COMPtr<IWebMutableURLRequest> request(AdoptCOM, WebMutableURLRequest::createInstance(frameLoadRequest.resourceRequest()));
     205    // Just create a blank request because createWindow() is only required to create window but not to load URL.
     206    COMPtr<IWebMutableURLRequest> request(AdoptCOM, WebMutableURLRequest::createInstance());
    206207
    207208    COMPtr<IWebUIDelegatePrivate2> delegatePrivate(Query, delegate);
  • trunk/WebKit/wx/ChangeLog

    r75313 r75349  
     12011-01-09  Xianzhu Wang <phnixwxz@gmail.com>
     2
     3        Reviewed by Darin Fisher.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=41441
     6        createWindow method should only do window-creating without URL navigation
     7
     8        * WebKitSupport/ChromeClientWx.cpp:
     9        (WebCore::ChromeClientWx::createWindow):
     10
    1112011-01-07  Adam Barth  <abarth@webkit.org>
    212
  • trunk/WebKit/wx/WebKitSupport/ChromeClientWx.cpp

    r71541 r75349  
    142142}
    143143
    144 Page* ChromeClientWx::createWindow(Frame*, const FrameLoadRequest& request, const WindowFeatures& features, const NavigationAction&)
     144Page* ChromeClientWx::createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures& features, const NavigationAction&)
    145145{
    146146    Page* myPage = 0;
    147147    wxWebViewNewWindowEvent wkEvent(m_webView);
    148     wkEvent.SetURL(request.resourceRequest().url().string());
    149148   
    150149    wxWebKitWindowFeatures wkFeatures = wkFeaturesforWindowFeatures(features);
Note: See TracChangeset for help on using the changeset viewer.