Diff
Modified: trunk/Source/WebKit/win/ChangeLog (154630 => 154631)
--- trunk/Source/WebKit/win/ChangeLog 2013-08-26 20:01:55 UTC (rev 154630)
+++ trunk/Source/WebKit/win/ChangeLog 2013-08-26 20:08:31 UTC (rev 154631)
@@ -1,3 +1,24 @@
+2013-08-26 Brent Fulgham <bfulg...@apple.com>
+
+ [Windows] Let Page create the main Frame.
+ https://bugs.webkit.org/show_bug.cgi?id=120323
+
+ Reviewed by Anders Carlsson.
+
+ * WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebFrameLoaderClient::WebFrameLoaderClient): Remove assertion that frame
+ is passed as construction argument.
+ (WebFrameLoaderClient::createFrame): Call new 'createSubframeWithOwnerElement'
+ * WebCoreSupport/WebFrameLoaderClient.h: Update constructor to
+ handle case of no default frame argument.
+ (WebFrameLoaderClient::setWebFrame): Added.
+ * WebFrame.cpp:
+ (WebFrame::createSubframeWithOwnerElement): Renamed from 'init'.
+ (WebFrame::initWithWebFrameView): Added for new page-driven load path.
+ * WebFrame.h: Added new method signatures.
+ * WebView.cpp:
+ (WebView::initWithFrame): Update to match behavior of other ports.
+
2013-08-23 Roger Fong <roger_f...@apple.com>
<https://bugs.webkit.org/show_bug.cgi?id=119829> Add IAccessibleText and IAccessibleEditableText implementation.
Modified: trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp (154630 => 154631)
--- trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp 2013-08-26 20:01:55 UTC (rev 154630)
+++ trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp 2013-08-26 20:08:31 UTC (rev 154631)
@@ -108,7 +108,6 @@
, m_policyListenerPrivate(adoptPtr(new WebFramePolicyListenerPrivate))
, m_hasSentResponseToPlugin(false)
{
- ASSERT_ARG(webFrame, webFrame);
}
WebFrameLoaderClient::~WebFrameLoaderClient()
@@ -1089,7 +1088,7 @@
COMPtr<WebFrame> webFrame(AdoptCOM, WebFrame::createInstance());
- RefPtr<Frame> childFrame = webFrame->init(m_webFrame->webView(), coreFrame->page(), ownerElement);
+ RefPtr<Frame> childFrame = webFrame->createSubframeWithOwnerElement(m_webFrame->webView(), coreFrame->page(), ownerElement);
childFrame->tree().setName(name);
coreFrame->tree().appendChild(childFrame);
Modified: trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h (154630 => 154631)
--- trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h 2013-08-26 20:01:55 UTC (rev 154630)
+++ trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h 2013-08-26 20:08:31 UTC (rev 154631)
@@ -43,9 +43,10 @@
class WebFrameLoaderClient : public WebCore::FrameLoaderClient {
public:
- WebFrameLoaderClient(WebFrame*);
+ WebFrameLoaderClient(WebFrame* = 0);
~WebFrameLoaderClient();
+ void setWebFrame(WebFrame* webFrame) { m_webFrame = webFrame; }
WebFrame* webFrame() const { return m_webFrame; }
virtual bool hasWebView() const;
Modified: trunk/Source/WebKit/win/WebFrame.cpp (154630 => 154631)
--- trunk/Source/WebKit/win/WebFrame.cpp 2013-08-26 20:01:55 UTC (rev 154630)
+++ trunk/Source/WebKit/win/WebFrame.cpp 2013-08-26 20:08:31 UTC (rev 154631)
@@ -1071,7 +1071,7 @@
// WebFrame ---------------------------------------------------------------
-PassRefPtr<Frame> WebFrame::init(IWebView* webView, Page* page, HTMLFrameOwnerElement* ownerElement)
+PassRefPtr<Frame> WebFrame::createSubframeWithOwnerElement(IWebView* webView, Page* page, HTMLFrameOwnerElement* ownerElement)
{
webView->QueryInterface(&d->webView);
d->webView->Release(); // don't hold the extra ref
@@ -1085,6 +1085,18 @@
return frame.release();
}
+void WebFrame::initWithWebView(IWebView* webView, Page* page)
+{
+ webView->QueryInterface(&d->webView);
+ d->webView->Release(); // don't hold the extra ref
+
+ HWND viewWindow;
+ d->webView->viewWindow((OLE_HANDLE*)&viewWindow);
+
+ this->AddRef(); // We release this ref in frameLoaderDestroyed()
+ d->frame = page->mainFrame();
+}
+
Frame* WebFrame::impl()
{
return d->frame;
Modified: trunk/Source/WebKit/win/WebFrame.h (154630 => 154631)
--- trunk/Source/WebKit/win/WebFrame.h 2013-08-26 20:01:55 UTC (rev 154630)
+++ trunk/Source/WebKit/win/WebFrame.h 2013-08-26 20:08:31 UTC (rev 154631)
@@ -298,7 +298,8 @@
virtual void frameLoaderDestroyed();
// WebFrame
- PassRefPtr<WebCore::Frame> init(IWebView*, WebCore::Page*, WebCore::HTMLFrameOwnerElement*);
+ PassRefPtr<WebCore::Frame> createSubframeWithOwnerElement(IWebView*, WebCore::Page*, WebCore::HTMLFrameOwnerElement*);
+ void initWithWebView(IWebView*, WebCore::Page*);
WebCore::Frame* impl();
void invalidate();
void unmarkAllMisspellings();
Modified: trunk/Source/WebKit/win/WebView.cpp (154630 => 154631)
--- trunk/Source/WebKit/win/WebView.cpp 2013-08-26 20:01:55 UTC (rev 154630)
+++ trunk/Source/WebKit/win/WebView.cpp 2013-08-26 20:08:31 UTC (rev 154631)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple, Inc. All rights reserved.
+ * Copyright (C) 2006-2013 Apple, Inc. All rights reserved.
* Copyright (C) 2009, 2010, 2011 Appcelerator, Inc. All rights reserved.
* Copyright (C) 2011 Brent Fulgham. All rights reserved.
*
@@ -45,6 +45,7 @@
#include "WebEditorClient.h"
#include "WebElementPropertyBag.h"
#include "WebFrame.h"
+#include "WebFrameLoaderClient.h"
#include "WebFrameNetworkingContext.h"
#include "WebGeolocationClient.h"
#include "WebGeolocationPosition.h"
@@ -2718,6 +2719,7 @@
#if ENABLE(INSPECTOR)
pageClients.inspectorClient = m_inspectorClient;
#endif // ENABLE(INSPECTOR)
+ pageClients.loaderClientForMainFrame = new WebFrameLoaderClient;
m_page = new Page(pageClients);
provideGeolocationTo(m_page, new WebGeolocationClient(this));
@@ -2736,12 +2738,13 @@
}
WebFrame* webFrame = WebFrame::createInstance();
- RefPtr<Frame> coreFrame = webFrame->init(this, m_page, 0);
+ webFrame->initWithWebView(this, m_page);
+ static_cast<WebFrameLoaderClient&>(m_page->mainFrame()->loader().client()).setWebFrame(webFrame);
m_mainFrame = webFrame;
webFrame->Release(); // The WebFrame is owned by the Frame, so release our reference to it.
- coreFrame->tree().setName(toString(frameName));
- coreFrame->init();
+ m_page->mainFrame()->tree().setName(toString(frameName));
+ m_page->mainFrame()->init();
setGroupName(groupName);
addToAllWebViewsSet();