Changeset 75349 in webkit
- Timestamp:
- Jan 9, 2011 3:22:47 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r75348 r75349 1 2011-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 1 16 2011-01-09 Dirk Schulze <krit@webkit.org> 2 17 -
trunk/Source/WebCore/loader/FrameLoader.cpp
r75336 r75349 3475 3475 Frame* frame = lookupFrame->tree()->find(request.frameName()); 3476 3476 if (frame && openerFrame->loader()->shouldAllowNavigation(frame)) { 3477 if (!request.resourceRequest().url().isEmpty())3478 frame->loader()->loadFrameRequest(request, false, false, 0, 0, SendReferrer);3479 3477 if (Page* page = frame->page()) 3480 3478 page->chrome()->focus(); -
trunk/Source/WebCore/page/ChromeClient.h
r75277 r75349 101 101 // should not be shown to the user until the ChromeClient of the newly 102 102 // 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. 103 105 virtual Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&, const NavigationAction&) = 0; 104 106 virtual void show() = 0; -
trunk/Source/WebCore/page/ContextMenuController.cpp
r75047 r75349 159 159 if (Page* oldPage = frame->page()) { 160 160 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); 163 163 newPage->chrome()->show(); 164 } 164 165 } 165 166 } -
trunk/Source/WebCore/page/DOMWindow.cpp
r75276 r75349 1697 1697 Frame* activeFrame = activeWindow->frame(); 1698 1698 1699 // FIXME: It's much better for client API if a new window starts with a URL, here where we1700 // know what URL we are going to open. Unfortunately, this code passes the empty string1701 // 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 currently1703 // do an isInsecureScriptAccess call using the window we create, which can't be done before1704 // creating it. We'd have to resolve all those issues to pass the URL instead of an empty string.1705 1706 1699 // For whatever reason, Firefox uses the first frame to determine the outgoingReferrer. We replicate that behavior here. 1707 1700 String referrer = firstFrame->loader()->outgoingReferrer(); 1708 1701 1709 ResourceRequest request(KURL(), referrer); 1702 KURL completedURL = urlString.isEmpty() ? KURL(ParsedURLString, "") : firstFrame->document()->completeURL(urlString); 1703 ResourceRequest request(completedURL, referrer); 1710 1704 FrameLoader::addHTTPOriginIfNeeded(request, firstFrame->loader()->outgoingOrigin()); 1711 1705 FrameLoadRequest frameRequest(activeWindow->securityOrigin(), request, frameName); … … 1726 1720 if (function) 1727 1721 function(newFrame->domWindow(), functionContext); 1728 1729 KURL completedURL = urlString.isEmpty() ? KURL(ParsedURLString, "") : firstFrame->document()->completeURL(urlString);1730 1722 1731 1723 if (created) -
trunk/WebKit/chromium/ChangeLog
r75317 r75349 1 2011-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 1 14 2011-01-08 Adam Barth <abarth@webkit.org> 2 15 -
trunk/WebKit/chromium/public/WebViewClient.h
r73724 r75349 65 65 class WebStorageNamespace; 66 66 class WebURL; 67 class WebURLRequest; 67 68 class WebView; 68 69 class WebWidget; … … 83 84 // so any subsequent calls to createSessionStorageNamespace conform to the 84 85 // 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. 85 88 virtual WebView* createView(WebFrame* creator, 86 89 const WebWindowFeatures& features, 87 90 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 } 88 107 89 108 // Create a new WebPopupMenu. In the second form, the client is -
trunk/WebKit/chromium/src/ChromeClientImpl.cpp
r73724 r75349 264 264 return 0; 265 265 266 WrappedResourceRequest request; 267 if (!r.resourceRequest().isEmpty()) 268 request.bind(r.resourceRequest()); 266 269 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())); 268 271 if (!newView) 269 272 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 }277 273 278 274 return newView->page(); -
trunk/WebKit/efl/ChangeLog
r74684 r75349 1 2011-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 1 11 2010-12-27 Rafael Antognolli <antognolli@profusion.mobi> 2 12 -
trunk/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
r71541 r75349 155 155 return 0; 156 156 157 if (!frameLoadRequest.isEmpty())158 ewk_view_uri_set(newView, frameLoadRequest.resourceRequest().url().string().utf8().data());159 160 157 return ewk_view_core_page_get(newView); 161 158 } -
trunk/WebKit/gtk/ChangeLog
r75346 r75349 1 2011-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 1 11 2011-01-08 Martin Robinson <mrobinson@igalia.com> 2 12 -
trunk/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
r75009 r75349 161 161 g_object_set(webView, "window-features", webWindowFeatures.get(), NULL); 162 162 163 if (!frameLoadRequest.isEmpty())164 webkit_web_view_open(webView, frameLoadRequest.resourceRequest().url().string().utf8().data());165 166 163 return core(webView); 167 164 } -
trunk/WebKit/mac/ChangeLog
r75316 r75349 1 2011-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 1 11 2011-01-08 Dan Bernstein <mitz@apple.com> 2 12 -
trunk/WebKit/mac/WebCoreSupport/WebChromeClient.mm
r75277 r75349 198 198 } 199 199 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 200 Page* WebChromeClient::createWindow(Frame* frame, const FrameLoadRequest&, const WindowFeatures& features, const NavigationAction&) 201 { 206 202 id delegate = [m_webView UIDelegate]; 207 203 WebView *newWebView; … … 239 235 [dictFeatures setObject:height forKey:@"height"]; 240 236 241 newWebView = CallUIDelegate(m_webView, @selector(webView:createWebViewWithRequest:windowFeatures:), URLRequest, dictFeatures);237 newWebView = CallUIDelegate(m_webView, @selector(webView:createWebViewWithRequest:windowFeatures:), nil, dictFeatures); 242 238 243 239 [dictFeatures release]; … … 254 250 [dialog release]; 255 251 } 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); 257 253 } else { 258 newWebView = CallUIDelegate(m_webView, @selector(webView:createWebViewWithRequest:), URLRequest);254 newWebView = CallUIDelegate(m_webView, @selector(webView:createWebViewWithRequest:), nil); 259 255 } 260 256 -
trunk/WebKit/qt/Api/qwebpage.cpp
r75242 r75349 2263 2263 WindowFeatures features; 2264 2264 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); 2267 2268 newPage->chrome()->show(); 2269 } 2268 2270 } 2269 2271 } -
trunk/WebKit/qt/ChangeLog
r75337 r75349 1 2011-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 1 13 2011-01-08 Benjamin Poulain <benjamin.poulain@nokia.com> 2 14 -
trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
r73867 r75349 183 183 // A call to QWebPage::mainFrame() implicitly creates the main frame. 184 184 // 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(); 189 186 return newPage->d->page; 190 187 } -
trunk/WebKit/win/ChangeLog
r75313 r75349 1 2011-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 1 11 2011-01-07 Adam Barth <abarth@webkit.org> 2 12 -
trunk/WebKit/win/WebCoreSupport/WebChromeClient.cpp
r75262 r75349 197 197 } 198 198 199 Page* WebChromeClient::createWindow(Frame*, const FrameLoadRequest& frameLoadRequest, const WindowFeatures& features, const NavigationAction&)199 Page* WebChromeClient::createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures& features, const NavigationAction&) 200 200 { 201 201 COMPtr<IWebUIDelegate> delegate = uiDelegate(); … … 203 203 return 0; 204 204 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()); 206 207 207 208 COMPtr<IWebUIDelegatePrivate2> delegatePrivate(Query, delegate); -
trunk/WebKit/wx/ChangeLog
r75313 r75349 1 2011-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 1 11 2011-01-07 Adam Barth <abarth@webkit.org> 2 12 -
trunk/WebKit/wx/WebKitSupport/ChromeClientWx.cpp
r71541 r75349 142 142 } 143 143 144 Page* ChromeClientWx::createWindow(Frame*, const FrameLoadRequest& request, const WindowFeatures& features, const NavigationAction&)144 Page* ChromeClientWx::createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures& features, const NavigationAction&) 145 145 { 146 146 Page* myPage = 0; 147 147 wxWebViewNewWindowEvent wkEvent(m_webView); 148 wkEvent.SetURL(request.resourceRequest().url().string());149 148 150 149 wxWebKitWindowFeatures wkFeatures = wkFeaturesforWindowFeatures(features);
Note: See TracChangeset
for help on using the changeset viewer.