[WK2] Neuter WKFrameIsFrameSet() / WKPageGetFrameSetLargestFrame() C API
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 May 2020 23:38:42 +0000 (23:38 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 May 2020 23:38:42 +0000 (23:38 +0000)
https://bugs.webkit.org/show_bug.cgi?id=211808

Reviewed by Darin Adler.

Source/WebCore:

Neuter WKFrameIsFrameSet() / WKPageGetFrameSetLargestFrame() C API. This is only SPI and is only used for slightly
different printing behavior in Safari. Framesets are no longer supported in HTML5 and are now super rare. Support
for this C API adds quite a bit of code complexity and crashes such as <rdar://problem/60322282>, it just does not
seem worth it anymore.

* dom/Document.cpp:
(WebCore::Document::resume):
* html/HTMLFrameSetElement.cpp:
(WebCore::HTMLFrameSetElement::insertedIntoAncestor):
(WebCore::HTMLFrameSetElement::removedFromAncestor):
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoaderClient.h:

Source/WebKit:

Neuter WKFrameIsFrameSet() / WKPageGetFrameSetLargestFrame() C API. This is only SPI and is only used for slightly
different printing behavior in Safari. Framesets are no longer supported in HTML5 and are now super rare. Support
for this C API adds quite a bit of code complexity and crashes such as <rdar://problem/60322282>, it just does not
seem worth it anymore.

* UIProcess/API/C/WKFrame.cpp:
(WKFrameIsFrameSet):
* UIProcess/API/C/WKPage.cpp:
(WKPageGetFrameSetLargestFrame):
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::didCommitLoad):
* UIProcess/WebFrameProxy.h:
(WebKit::WebFrameProxy::setIsFrameSet): Deleted.
(WebKit::WebFrameProxy::isFrameSet const): Deleted.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::resetState):
(WebKit::WebPageProxy::frameDidBecomeFrameSet): Deleted.
(WebKit::WebPageProxy::frameSetLargestFrameChanged): Deleted.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::focusedFrame const):
(WebKit::WebPageProxy::frameSetLargestFrame const): Deleted.
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::contentsSizeChanged const):
(WebKit::findLargestFrameInFrameSet): Deleted.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidBecomeFrameset): Deleted.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

Source/WebKitLegacy/mac:

* WebCoreSupport/WebFrameLoaderClient.h:
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::dispatchDidBecomeFrameset): Deleted.

Source/WebKitLegacy/win:

* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::dispatchDidBecomeFrameset): Deleted.
* WebCoreSupport/WebFrameLoaderClient.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261586 268f45cc-cd09-0410-ab3c-d52691b4dbfc

26 files changed:
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/html/HTMLFrameSetElement.cpp
Source/WebCore/loader/EmptyFrameLoaderClient.h
Source/WebCore/loader/FrameLoaderClient.h
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/C/WKFrame.cpp
Source/WebKit/UIProcess/API/C/WKFrame.h
Source/WebKit/UIProcess/API/C/WKPage.cpp
Source/WebKit/UIProcess/API/C/WKPage.h
Source/WebKit/UIProcess/WebFrameProxy.cpp
Source/WebKit/UIProcess/WebFrameProxy.h
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.h
Source/WebKit/UIProcess/WebPageProxy.messages.in
Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h
Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.h
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.h
Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm
Source/WebKitLegacy/win/ChangeLog
Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.h
Tools/TestWebKitAPI/Tests/WebKit/ReloadPageAfterCrash.cpp

index 17e6855..6c5e913 100644 (file)
@@ -1,3 +1,23 @@
+2020-05-12  Chris Dumez  <cdumez@apple.com>
+
+        [WK2] Neuter WKFrameIsFrameSet() / WKPageGetFrameSetLargestFrame() C API
+        https://bugs.webkit.org/show_bug.cgi?id=211808
+
+        Reviewed by Darin Adler.
+
+        Neuter WKFrameIsFrameSet() / WKPageGetFrameSetLargestFrame() C API. This is only SPI and is only used for slightly
+        different printing behavior in Safari. Framesets are no longer supported in HTML5 and are now super rare. Support
+        for this C API adds quite a bit of code complexity and crashes such as <rdar://problem/60322282>, it just does not
+        seem worth it anymore.
+
+        * dom/Document.cpp:
+        (WebCore::Document::resume):
+        * html/HTMLFrameSetElement.cpp:
+        (WebCore::HTMLFrameSetElement::insertedIntoAncestor):
+        (WebCore::HTMLFrameSetElement::removedFromAncestor):
+        * loader/EmptyFrameLoaderClient.h:
+        * loader/FrameLoaderClient.h:
+
 2020-05-12  Simon Fraser  <simon.fraser@apple.com>
 
         Clean up some transformOrigin and perspectiveOrigin code
index 49f98e2..bef4869 100644 (file)
@@ -5390,7 +5390,6 @@ void Document::resume(ReasonForSuspension reason)
     page()->lockAllOverlayScrollbarsToHidden(false);
 
     ASSERT(m_frame);
-    m_frame->loader().client().dispatchDidBecomeFrameset(isFrameSet());
 
     if (RuntimeEnabledFeatures::sharedFeatures().webAnimationsCSSIntegrationEnabled()) {
         if (m_timelinesController)
index 83ac680..465a029 100644 (file)
@@ -214,21 +214,12 @@ void HTMLFrameSetElement::willRecalcStyle(Style::Change)
 Node::InsertedIntoAncestorResult HTMLFrameSetElement::insertedIntoAncestor(InsertionType insertionType, ContainerNode& parentOfInsertedTree)
 {
     HTMLElement::insertedIntoAncestor(insertionType, parentOfInsertedTree);
-    if (insertionType.connectedToDocument) {
-        if (RefPtr<Frame> frame = document().frame())
-            frame->loader().client().dispatchDidBecomeFrameset(document().isFrameSet());
-    }
-
     return InsertedIntoAncestorResult::Done;
 }
 
 void HTMLFrameSetElement::removedFromAncestor(RemovalType removalType, ContainerNode& oldParentOfRemovedTree)
 {
     HTMLElement::removedFromAncestor(removalType, oldParentOfRemovedTree);
-    if (removalType.disconnectedFromDocument) {
-        if (RefPtr<Frame> frame = document().frame())
-            frame->loader().client().dispatchDidBecomeFrameset(document().isFrameSet());
-    }
 }
 
 WindowProxy* HTMLFrameSetElement::namedItem(const AtomString& name)
index ab2e024..63edebd 100644 (file)
@@ -165,8 +165,6 @@ class WEBCORE_EXPORT EmptyFrameLoaderClient : public FrameLoaderClient {
 
     void didRestoreFromBackForwardCache() final { }
 
-    void dispatchDidBecomeFrameset(bool) final { }
-
     void updateGlobalHistory() final { }
     void updateGlobalHistoryRedirectLinks() final { }
     bool shouldGoToHistoryItem(HistoryItem&) const final { return false; }
index 9231b45..0facc27 100644 (file)
@@ -281,8 +281,6 @@ public:
 
     virtual void didRestoreFromBackForwardCache() = 0;
 
-    virtual void dispatchDidBecomeFrameset(bool) = 0; // Can change due to navigation or DOM modification.
-
     virtual bool canCachePage() const = 0;
     virtual void convertMainResourceLoadToDownload(DocumentLoader*, const ResourceRequest&, const ResourceResponse&) = 0;
 
index 53eb9b5..e008797 100644 (file)
@@ -1,3 +1,40 @@
+2020-05-12  Chris Dumez  <cdumez@apple.com>
+
+        [WK2] Neuter WKFrameIsFrameSet() / WKPageGetFrameSetLargestFrame() C API
+        https://bugs.webkit.org/show_bug.cgi?id=211808
+
+        Reviewed by Darin Adler.
+
+        Neuter WKFrameIsFrameSet() / WKPageGetFrameSetLargestFrame() C API. This is only SPI and is only used for slightly
+        different printing behavior in Safari. Framesets are no longer supported in HTML5 and are now super rare. Support
+        for this C API adds quite a bit of code complexity and crashes such as <rdar://problem/60322282>, it just does not
+        seem worth it anymore.
+
+        * UIProcess/API/C/WKFrame.cpp:
+        (WKFrameIsFrameSet):
+        * UIProcess/API/C/WKPage.cpp:
+        (WKPageGetFrameSetLargestFrame):
+        * UIProcess/WebFrameProxy.cpp:
+        (WebKit::WebFrameProxy::didCommitLoad):
+        * UIProcess/WebFrameProxy.h:
+        (WebKit::WebFrameProxy::setIsFrameSet): Deleted.
+        (WebKit::WebFrameProxy::isFrameSet const): Deleted.
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::resetState):
+        (WebKit::WebPageProxy::frameDidBecomeFrameSet): Deleted.
+        (WebKit::WebPageProxy::frameSetLargestFrameChanged): Deleted.
+        * UIProcess/WebPageProxy.h:
+        (WebKit::WebPageProxy::focusedFrame const):
+        (WebKit::WebPageProxy::frameSetLargestFrame const): Deleted.
+        * UIProcess/WebPageProxy.messages.in:
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::contentsSizeChanged const):
+        (WebKit::findLargestFrameInFrameSet): Deleted.
+        * WebProcess/WebCoreSupport/WebChromeClient.h:
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::dispatchDidBecomeFrameset): Deleted.
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
+
 2020-05-12  Per Arne Vollan  <pvollan@apple.com>
 
         [iOS] Rebuild MobileGestalt cache if needed
index 2b6fb07..8e4e1a5 100644 (file)
@@ -124,7 +124,7 @@ bool WKFrameIsDisplayingMarkupDocument(WKFrameRef frameRef)
 
 bool WKFrameIsFrameSet(WKFrameRef frameRef)
 {
-    return toImpl(frameRef)->isFrameSet();
+    return false;
 }
 
 WKFrameHandleRef WKFrameCreateFrameHandle(WKFrameRef frameRef)
index 2d6af9a..d5bfae8 100644 (file)
@@ -67,7 +67,7 @@ WK_EXPORT bool WKFrameCanShowMIMEType(WKFrameRef frame, WKStringRef mimeType);
 WK_EXPORT bool WKFrameIsDisplayingStandaloneImageDocument(WKFrameRef frame);
 WK_EXPORT bool WKFrameIsDisplayingMarkupDocument(WKFrameRef frame);
 
-WK_EXPORT bool WKFrameIsFrameSet(WKFrameRef frame);
+WK_EXPORT bool WKFrameIsFrameSet(WKFrameRef frame) WK_C_API_DEPRECATED;
 
 WK_EXPORT WKFrameHandleRef WKFrameCreateFrameHandle(WKFrameRef frame);
 WK_EXPORT WKFrameInfoRef WKFrameCreateFrameInfo(WKFrameRef frame) WK_C_API_DEPRECATED;
index b68e646..27fcb40 100644 (file)
@@ -390,7 +390,7 @@ WKFrameRef WKPageGetFocusedFrame(WKPageRef pageRef)
 
 WKFrameRef WKPageGetFrameSetLargestFrame(WKPageRef pageRef)
 {
-    return toAPI(toImpl(pageRef)->frameSetLargestFrame());
+    return nullptr;
 }
 
 uint64_t WKPageGetRenderTreeSize(WKPageRef page)
index b7bdf59..670b5e9 100644 (file)
@@ -113,7 +113,7 @@ WK_EXPORT WKURLRef WKPageCopyCommittedURL(WKPageRef page);
 
 WK_EXPORT WKFrameRef WKPageGetMainFrame(WKPageRef page);
 WK_EXPORT WKFrameRef WKPageGetFocusedFrame(WKPageRef page); // The focused frame may be inactive.
-WK_EXPORT WKFrameRef WKPageGetFrameSetLargestFrame(WKPageRef page);
+WK_EXPORT WKFrameRef WKPageGetFrameSetLargestFrame(WKPageRef page) WK_C_API_DEPRECATED;
 WK_EXPORT double WKPageGetEstimatedProgress(WKPageRef page);
 
 WK_EXPORT uint64_t WKPageGetRenderTreeSize(WKPageRef page);
index a46db07..de9e9d1 100644 (file)
@@ -168,7 +168,6 @@ void WebFrameProxy::didCommitLoad(const String& contentType, WebCertificateInfo&
 
     m_title = String();
     m_MIMEType = contentType;
-    m_isFrameSet = false;
     m_certificateInfo = &certificateInfo;
     m_containsPluginDocument = containsPluginDocument;
 }
index 5eae22b..6c6f130 100644 (file)
@@ -75,9 +75,6 @@ public:
 
     bool isMainFrame() const;
 
-    void setIsFrameSet(bool value) { m_isFrameSet = value; }
-    bool isFrameSet() const { return m_isFrameSet; }
-
     FrameLoadState& frameLoadState() { return m_frameLoadState; }
 
     void loadURL(const URL&, const String& referrer = String());
@@ -140,7 +137,6 @@ private:
 
     String m_MIMEType;
     String m_title;
-    bool m_isFrameSet { false };
     bool m_containsPluginDocument { false };
     RefPtr<WebCertificateInfo> m_certificateInfo;
     RefPtr<WebFramePolicyListenerProxy> m_activeListener;
index 26a6d34..2d93ee8 100644 (file)
@@ -5046,18 +5046,6 @@ void WebPageProxy::mainFramePluginHandlesPageScaleGestureDidChange(bool mainFram
     m_mainFramePluginHandlesPageScaleGesture = mainFramePluginHandlesPageScaleGesture;
 }
 
-void WebPageProxy::frameDidBecomeFrameSet(FrameIdentifier frameID, bool value)
-{
-    PageClientProtector protector(pageClient());
-
-    WebFrameProxy* frame = m_process->webFrame(frameID);
-    MESSAGE_CHECK(m_process, frame);
-
-    frame->setIsFrameSet(value);
-    if (frame->isMainFrame())
-        m_frameSetLargestFrame = value ? m_mainFrame : 0;
-}
-
 #if !PLATFORM(COCOA)
 void WebPageProxy::beginSafeBrowsingCheck(const URL&, bool, WebFramePolicyListenerProxy& listener)
 {
@@ -7296,19 +7284,6 @@ void WebPageProxy::focusedFrameChanged(const Optional<FrameIdentifier>& frameID)
     m_focusedFrame = frame;
 }
 
-void WebPageProxy::frameSetLargestFrameChanged(const Optional<FrameIdentifier>& frameID)
-{
-    if (!frameID) {
-        m_frameSetLargestFrame = nullptr;
-        return;
-    }
-
-    WebFrameProxy* frame = m_process->webFrame(*frameID);
-    MESSAGE_CHECK(m_process, frame);
-
-    m_frameSetLargestFrame = frame;
-}
-
 void WebPageProxy::processDidBecomeUnresponsive()
 {
     RELEASE_LOG_ERROR_IF_ALLOWED(Process, "processDidBecomeUnresponsive:");
@@ -7491,7 +7466,6 @@ void WebPageProxy::resetState(ResetStateReason resetStateReason)
 {
     m_mainFrame = nullptr;
     m_focusedFrame = nullptr;
-    m_frameSetLargestFrame = nullptr;
     m_suspendedPageKeptToPreventFlashing = nullptr;
     m_lastSuspendedPage = nullptr;
 
index 6a90d35..a430a51 100644 (file)
@@ -448,7 +448,6 @@ public:
 
     WebFrameProxy* mainFrame() const { return m_mainFrame.get(); }
     WebFrameProxy* focusedFrame() const { return m_focusedFrame.get(); }
-    WebFrameProxy* frameSetLargestFrame() const { return m_frameSetLargestFrame.get(); }
 
     DrawingAreaProxy* drawingArea() const { return m_drawingArea.get(); }
     DrawingAreaProxy* provisionalDrawingArea() const;
@@ -1834,7 +1833,6 @@ private:
     void didRunInsecureContentForFrame(WebCore::FrameIdentifier, const UserData&);
     void didDetectXSSForFrame(WebCore::FrameIdentifier, const UserData&);
     void mainFramePluginHandlesPageScaleGestureDidChange(bool);
-    void frameDidBecomeFrameSet(WebCore::FrameIdentifier, bool);
     void didStartProgress();
     void didChangeProgress(double);
     void didFinishProgress();
@@ -2106,7 +2104,6 @@ private:
 #endif
 
     void focusedFrameChanged(const Optional<WebCore::FrameIdentifier>&);
-    void frameSetLargestFrameChanged(const Optional<WebCore::FrameIdentifier>&);
 
     void didFinishLoadingDataForCustomContentProvider(const String& suggestedFilename, const IPC::DataReference&);
 
@@ -2365,7 +2362,6 @@ private:
     RefPtr<WebFrameProxy> m_mainFrame;
 
     RefPtr<WebFrameProxy> m_focusedFrame;
-    RefPtr<WebFrameProxy> m_frameSetLargestFrame;
 
     String m_userAgent;
     String m_applicationNameForUserAgent;
index 73f9321..1eb0534 100644 (file)
@@ -45,7 +45,6 @@ messages -> WebPageProxy {
     SetFocus(bool focused)
     TakeFocus(uint32_t direction)
     FocusedFrameChanged(Optional<WebCore::FrameIdentifier> frameID)
-    FrameSetLargestFrameChanged(Optional<WebCore::FrameIdentifier> frameID)
     SetRenderTreeSize(uint64_t treeSize)
     SetToolbarsAreVisible(bool toolbarsAreVisible)
     GetToolbarsAreVisible() -> (bool toolbarsAreVisible) Synchronous
@@ -144,8 +143,6 @@ messages -> WebPageProxy {
 
     MainFramePluginHandlesPageScaleGestureDidChange(bool mainFramePluginHandlesPageScaleGesture)
 
-    FrameDidBecomeFrameSet(WebCore::FrameIdentifier frameID, bool value)
-
     # History client messages.
     DidNavigateWithNavigationData(struct WebKit::WebNavigationDataStore store, WebCore::FrameIdentifier frameID)
     DidPerformClientRedirect(String sourceURLString, String destinationURLString, WebCore::FrameIdentifier frameID)
index 878e2b4..966787f 100644 (file)
@@ -108,33 +108,6 @@ namespace WebKit {
 using namespace WebCore;
 using namespace HTMLNames;
 
-static double area(WebFrame* frame)
-{
-    IntSize size = frame->visibleContentBoundsExcludingScrollbars().size();
-    return static_cast<double>(size.height()) * size.width();
-}
-
-static WebFrame* findLargestFrameInFrameSet(WebPage& page)
-{
-    // Approximate what a user could consider a default target frame for application menu operations.
-
-    auto& mainFrame = page.mainWebFrame();
-    if (!mainFrame.isFrameSet())
-        return nullptr;
-
-    WebFrame* largestSoFar = nullptr;
-
-    Ref<API::Array> frameChildren = mainFrame.childFrames();
-    size_t count = frameChildren->size();
-    for (size_t i = 0; i < count; ++i) {
-        auto* childFrame = frameChildren->at<WebFrame>(i);
-        if (!largestSoFar || area(childFrame) > area(largestSoFar))
-            largestSoFar = childFrame;
-    }
-
-    return largestSoFar;
-}
-
 WebChromeClient::WebChromeClient(WebPage& page)
     : m_page(page)
 {
@@ -626,14 +599,6 @@ void WebChromeClient::contentsSizeChanged(Frame& frame, const IntSize& size) con
 {
     FrameView* frameView = frame.view();
 
-    if (frameView && frameView->effectiveFrameFlattening() == FrameFlattening::Disabled) {
-        WebFrame* largestFrame = findLargestFrameInFrameSet(m_page);
-        if (largestFrame != m_cachedFrameSetLargestFrame.get()) {
-            m_cachedFrameSetLargestFrame = largestFrame;
-            m_page.send(Messages::WebPageProxy::FrameSetLargestFrameChanged(largestFrame ? makeOptional(largestFrame->frameID()) : WTF::nullopt));
-        }
-    }
-
     if (&frame.page()->mainFrame() != &frame)
         return;
 
index 7eae3d3..d95897e 100644 (file)
@@ -401,7 +401,6 @@ private:
     void setMockWebAuthenticationConfiguration(const WebCore::MockWebAuthenticationConfiguration&) final;
 #endif
 
-    mutable RefPtr<WebFrame> m_cachedFrameSetLargestFrame;
     mutable bool m_cachedMainFrameHasHorizontalScrollbar { false };
     mutable bool m_cachedMainFrameHasVerticalScrollbar { false };
 #if ENABLE(GPU_PROCESS)
index 62858e9..f0c806e 100644 (file)
@@ -1551,15 +1551,6 @@ void WebFrameLoaderClient::didRestoreFromBackForwardCache()
     m_frameCameFromBackForwardCache = true;
 }
 
-void WebFrameLoaderClient::dispatchDidBecomeFrameset(bool value)
-{
-    WebPage* webPage = m_frame->page();
-    if (!webPage)
-        return;
-
-    webPage->send(Messages::WebPageProxy::FrameDidBecomeFrameSet(m_frame->frameID(), value));
-}
-
 bool WebFrameLoaderClient::canCachePage() const
 {
     // We cannot cache frames that have custom representations because they are
index a0fda7c..545259a 100644 (file)
@@ -209,8 +209,6 @@ private:
 
     void didRestoreFromBackForwardCache() final;
 
-    void dispatchDidBecomeFrameset(bool) final;
-
     bool canCachePage() const final;
     void convertMainResourceLoadToDownload(WebCore::DocumentLoader*, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&) final;
 
index 5da5310..8de03bc 100644 (file)
@@ -1,3 +1,14 @@
+2020-05-12  Chris Dumez  <cdumez@apple.com>
+
+        [WK2] Neuter WKFrameIsFrameSet() / WKPageGetFrameSetLargestFrame() C API
+        https://bugs.webkit.org/show_bug.cgi?id=211808
+
+        Reviewed by Darin Adler.
+
+        * WebCoreSupport/WebFrameLoaderClient.h:
+        * WebCoreSupport/WebFrameLoaderClient.mm:
+        (WebFrameLoaderClient::dispatchDidBecomeFrameset): Deleted.
+
 2020-05-11  Peng Liu  <peng.liu6@apple.com>
 
         Enable the mock video presentation mode in related layout tests and fix test failures
index a255a1c..808f5c7 100644 (file)
@@ -186,8 +186,6 @@ private:
 
     void didRestoreFromBackForwardCache() final;
 
-    void dispatchDidBecomeFrameset(bool) final;
-
     bool canHandleRequest(const WebCore::ResourceRequest&) const final;
     bool canShowMIMEType(const WTF::String& MIMEType) const final;
     bool canShowMIMETypeAsHTML(const WTF::String& MIMEType) const final;
index 6d29ca0..ec02bdf 100644 (file)
@@ -1511,10 +1511,6 @@ void WebFrameLoaderClient::didRestoreFromBackForwardCache()
 #endif
 }
 
-void WebFrameLoaderClient::dispatchDidBecomeFrameset(bool)
-{
-}
-
 RetainPtr<WebFramePolicyListener> WebFrameLoaderClient::setUpPolicyListener(WebCore::PolicyCheckIdentifier identifier, WebCore::FramePolicyFunction&& function, WebCore::PolicyAction defaultPolicy, NSURL *appLinkURL)
 {
     // FIXME: <rdar://5634381> We need to support multiple active policy listeners.
index 48792e0..ab4b66c 100644 (file)
@@ -1,3 +1,14 @@
+2020-05-12  Chris Dumez  <cdumez@apple.com>
+
+        [WK2] Neuter WKFrameIsFrameSet() / WKPageGetFrameSetLargestFrame() C API
+        https://bugs.webkit.org/show_bug.cgi?id=211808
+
+        Reviewed by Darin Adler.
+
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebFrameLoaderClient::dispatchDidBecomeFrameset): Deleted.
+        * WebCoreSupport/WebFrameLoaderClient.h:
+
 2020-05-12  Fujii Hironori  <Hironori.Fujii@sony.com>
 
         [WinCairo][WK1] requestAnimationFrame doesn't work since r244182 in Accelerated Compositing mode
index f832709..3389d17 100644 (file)
@@ -971,10 +971,6 @@ void WebFrameLoaderClient::didRestoreFromBackForwardCache()
 {
 }
 
-void WebFrameLoaderClient::dispatchDidBecomeFrameset(bool)
-{
-}
-
 String WebFrameLoaderClient::userAgent(const URL& url) const
 {
     return m_webFrame->webView()->userAgentForKURL(url);
index b8e7c7d..e427e21 100644 (file)
@@ -173,8 +173,6 @@ public:
 
     void didRestoreFromBackForwardCache() override;
 
-    void dispatchDidBecomeFrameset(bool) override;
-
     bool canCachePage() const override;
 
     RefPtr<WebCore::Frame> createFrame(const WTF::String& name, WebCore::HTMLFrameOwnerElement&) override;
index cf72c63..e2625b0 100644 (file)
@@ -140,36 +140,6 @@ TEST(WebKit, FocusedFrameAfterCrash)
     Util::run(&calledCrashHandler);
 }
 
-TEST(WebKit, FrameSetLargestFrameAfterCrash)
-{
-    WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreateWithConfiguration(nullptr));
-    PlatformWebView webView(context.get());
-
-    WKPageNavigationClientV0 loaderClient;
-    memset(&loaderClient, 0, sizeof(loaderClient));
-
-    loaderClient.base.version = 0;
-    loaderClient.didFinishNavigation = didFinishLoad;
-    loaderClient.webProcessDidCrash = didCrashCheckFrames;
-
-    WKPageSetPageNavigationClient(webView.page(), &loaderClient.base);
-
-    WKRetainPtr<WKURLRef> baseURL = adoptWK(WKURLCreateWithUTF8CString("about:blank"));
-    WKRetainPtr<WKStringRef> htmlString = Util::toWK("<frameset cols='25%,*,25%'><frame src='about:blank'><frame src='about:blank'><frame src='about:blank'></frameset>");
-
-    WKPageLoadHTMLString(webView.page(), htmlString.get(), baseURL.get());
-    Util::run(&loadBeforeCrash);
-
-    EXPECT_FALSE(!WKPageGetMainFrame(webView.page()));
-
-    while (!WKPageGetFrameSetLargestFrame(webView.page()))
-        Util::spinRunLoop(10);
-
-    kill(WKPageGetProcessIdentifier(webView.page()), 9);
-
-    Util::run(&calledCrashHandler);
-}
-
 #endif // !PLATFORM(WIN)
 
 } // namespace TestWebKitAPI