Title: [200611] trunk/Source/WebKit2
Revision
200611
Author
timothy_hor...@apple.com
Date
2016-05-09 20:40:58 -0700 (Mon, 09 May 2016)

Log Message

REGRESSION (r191922): Zoom in/Zoom Out is not working for PDFs
https://bugs.webkit.org/show_bug.cgi?id=157503
<rdar://problem/23736297>

Reviewed by Anders Carlsson.

* WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h:
Restore a requiresUnifiedScaleFactor that was lost in r191922.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::mainFramePluginHandlesPageScaleGestureDidChange):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:        
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::didInitializePlugin):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
Separate mainFramePluginHandlesPageScaleGesture changes out from didCommitLoadForFrame,
because the PluginView doesn't exist at this point, so it can't answer
the handlesPageScaleGesture question correctly (or at all).
Instead, we'll send the message when the main-frame PluginView is initialized.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (200610 => 200611)


--- trunk/Source/WebKit2/ChangeLog	2016-05-10 03:22:39 UTC (rev 200610)
+++ trunk/Source/WebKit2/ChangeLog	2016-05-10 03:40:58 UTC (rev 200611)
@@ -1,3 +1,28 @@
+2016-05-09  Tim Horton  <timothy_hor...@apple.com>
+
+        REGRESSION (r191922): Zoom in/Zoom Out is not working for PDFs
+        https://bugs.webkit.org/show_bug.cgi?id=157503
+        <rdar://problem/23736297>
+
+        Reviewed by Anders Carlsson.
+
+        * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h:
+        Restore a requiresUnifiedScaleFactor that was lost in r191922.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::didCommitLoadForFrame):
+        (WebKit::WebPageProxy::mainFramePluginHandlesPageScaleGestureDidChange):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:        
+        * WebProcess/Plugins/PluginView.cpp:
+        (WebKit::PluginView::didInitializePlugin):
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
+        Separate mainFramePluginHandlesPageScaleGesture changes out from didCommitLoadForFrame,
+        because the PluginView doesn't exist at this point, so it can't answer
+        the handlesPageScaleGesture question correctly (or at all).
+        Instead, we'll send the message when the main-frame PluginView is initialized.
+
 2016-05-09  Simon Fraser  <simon.fra...@apple.com>
 
         [iOS] visibility:hidden -webkit-overflow-scrolling: touch divs can interfere with page scrolling

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (200610 => 200611)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2016-05-10 03:22:39 UTC (rev 200610)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2016-05-10 03:40:58 UTC (rev 200611)
@@ -3036,7 +3036,7 @@
     }
 }
 
-void WebPageProxy::didCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, const String& mimeType, bool frameHasCustomContentProvider, bool pluginHandlesPageScaleGesture, uint32_t opaqueFrameLoadType, const WebCore::CertificateInfo& certificateInfo, bool containsPluginDocument, const UserData& userData)
+void WebPageProxy::didCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, const String& mimeType, bool frameHasCustomContentProvider, uint32_t opaqueFrameLoadType, const WebCore::CertificateInfo& certificateInfo, bool containsPluginDocument, const UserData& userData)
 {
     PageClientProtector protector(m_pageClient);
 
@@ -3096,11 +3096,10 @@
     // plugin is handling page scaling itself) so we should reset it to the default
     // for standard main frame loads.
     if (frame->isMainFrame()) {
-        m_mainFramePluginHandlesPageScaleGesture = pluginHandlesPageScaleGesture;
-
         if (static_cast<FrameLoadType>(opaqueFrameLoadType) == FrameLoadType::Standard) {
             m_pageScaleFactor = 1;
             m_pluginScaleFactor = 1;
+            m_mainFramePluginHandlesPageScaleGesture = false;
         }
     }
 
@@ -3342,6 +3341,11 @@
     m_loaderClient->didDetectXSSForFrame(*this, *frame, m_process->transformHandlesToObjects(userData.object()).get());
 }
 
+void WebPageProxy::mainFramePluginHandlesPageScaleGestureDidChange(bool mainFramePluginHandlesPageScaleGesture)
+{
+    m_mainFramePluginHandlesPageScaleGesture = mainFramePluginHandlesPageScaleGesture;
+}
+
 void WebPageProxy::frameDidBecomeFrameSet(uint64_t frameID, bool value)
 {
     PageClientProtector protector(m_pageClient);

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (200610 => 200611)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2016-05-10 03:22:39 UTC (rev 200610)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2016-05-10 03:40:58 UTC (rev 200611)
@@ -1150,7 +1150,7 @@
     void didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, const String&, const UserData&);
     void didChangeProvisionalURLForFrame(uint64_t frameID, uint64_t navigationID, const String& url);
     void didFailProvisionalLoadForFrame(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, const String& provisionalURL, const WebCore::ResourceError&, const UserData&);
-    void didCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, const String& mimeType, bool frameHasCustomContentProvider, bool mainFramePluginHandlesPageScaleGesture, uint32_t frameLoadType, const WebCore::CertificateInfo&, bool containsPluginDocument, const UserData&);
+    void didCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, const String& mimeType, bool frameHasCustomContentProvider, uint32_t frameLoadType, const WebCore::CertificateInfo&, bool containsPluginDocument, const UserData&);
     void didFinishDocumentLoadForFrame(uint64_t frameID, uint64_t navigationID, const UserData&);
     void didFinishLoadForFrame(uint64_t frameID, uint64_t navigationID, const UserData&);
     void didFailLoadForFrame(uint64_t frameID, uint64_t navigationID, const WebCore::ResourceError&, const UserData&);
@@ -1161,6 +1161,7 @@
     void didDisplayInsecureContentForFrame(uint64_t frameID, const UserData&);
     void didRunInsecureContentForFrame(uint64_t frameID, const UserData&);
     void didDetectXSSForFrame(uint64_t frameID, const UserData&);
+    void mainFramePluginHandlesPageScaleGestureDidChange(bool);
     void frameDidBecomeFrameSet(uint64_t frameID, bool);
     void didStartProgress();
     void didChangeProgress(double);

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (200610 => 200611)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in	2016-05-10 03:22:39 UTC (rev 200610)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in	2016-05-10 03:40:58 UTC (rev 200611)
@@ -126,7 +126,7 @@
     DidReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, String url, WebKit::UserData userData)
     DidChangeProvisionalURLForFrame(uint64_t frameID, uint64_t navigationID, String url)
     DidFailProvisionalLoadForFrame(uint64_t frameID, struct WebCore::SecurityOriginData frameSecurityOrigin, uint64_t navigationID, String provisionalURL, WebCore::ResourceError error, WebKit::UserData userData)
-    DidCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, String mimeType, bool hasCustomContentProvider, bool pluginHandlesPageScaleGesture, uint32_t loadType, WebCore::CertificateInfo certificateInfo, bool containsPluginDocument, WebKit::UserData userData)
+    DidCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, String mimeType, bool hasCustomContentProvider, uint32_t loadType, WebCore::CertificateInfo certificateInfo, bool containsPluginDocument, WebKit::UserData userData)
     DidFailLoadForFrame(uint64_t frameID, uint64_t navigationID, WebCore::ResourceError error, WebKit::UserData userData)
     DidFinishDocumentLoadForFrame(uint64_t frameID, uint64_t navigationID, WebKit::UserData userData)
     DidFinishLoadForFrame(uint64_t frameID, uint64_t navigationID, WebKit::UserData userData)
@@ -140,6 +140,8 @@
     DidSameDocumentNavigationForFrame(uint64_t frameID, uint64_t navigationID, uint32_t type, String url, WebKit::UserData userData)
     DidDestroyNavigation(uint64_t navigationID)
 
+    MainFramePluginHandlesPageScaleGestureDidChange(bool mainFramePluginHandlesPageScaleGesture)
+
     FrameDidBecomeFrameSet(uint64_t frameID, bool value)
 
     # History client messages.

Modified: trunk/Source/WebKit2/WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h (200610 => 200611)


--- trunk/Source/WebKit2/WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h	2016-05-10 03:22:39 UTC (rev 200610)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h	2016-05-10 03:40:58 UTC (rev 200611)
@@ -150,6 +150,7 @@
     bool handleEditingCommand(const String& commandName, const String& argument) override;
     bool isEditingCommandEnabled(const String&) override;
     bool handlesPageScaleFactor() const override;
+    bool requiresUnifiedScaleFactor() const override { return true; }
     void setFocus(bool) override { }
     NPObject* pluginScriptableNPObject() override { return 0; }
     void windowFocusChanged(bool) override { }

Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp (200610 => 200611)


--- trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp	2016-05-10 03:22:39 UTC (rev 200610)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp	2016-05-10 03:40:58 UTC (rev 200611)
@@ -689,6 +689,12 @@
                 frameView->setNeedsLayout();
         }
     }
+
+    if (Frame* frame = m_pluginElement->document().frame()) {
+        auto* webFrame = WebFrame::fromCoreFrame(*frame);
+        if (webFrame->isMainFrame())
+            webFrame->page()->send(Messages::WebPageProxy::MainFramePluginHandlesPageScaleGestureDidChange(handlesPageScaleFactor()));
+    }
 }
 
 #if PLATFORM(COCOA)

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (200610 => 200611)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2016-05-10 03:22:39 UTC (rev 200610)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2016-05-10 03:40:58 UTC (rev 200611)
@@ -468,7 +468,7 @@
 
     // Notify the UIProcess.
 
-    webPage->send(Messages::WebPageProxy::DidCommitLoadForFrame(m_frame->frameID(), documentLoader.navigationID(), documentLoader.response().mimeType(), m_frameHasCustomContentProvider, m_frame->handlesPageScaleGesture(), static_cast<uint32_t>(m_frame->coreFrame()->loader().loadType()), documentLoader.response().certificateInfo(), m_frame->coreFrame()->document()->isPluginDocument(), UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));
+    webPage->send(Messages::WebPageProxy::DidCommitLoadForFrame(m_frame->frameID(), documentLoader.navigationID(), documentLoader.response().mimeType(), m_frameHasCustomContentProvider, static_cast<uint32_t>(m_frame->coreFrame()->loader().loadType()), documentLoader.response().certificateInfo(), m_frame->coreFrame()->document()->isPluginDocument(), UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));
     webPage->didCommitLoad(m_frame);
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to