In WebKit2, page zooming does not work with PDF
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 8 Jan 2011 23:47:39 +0000 (23:47 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 8 Jan 2011 23:47:39 +0000 (23:47 +0000)
commit4063ec7c842443786a43b5c109aab7cad0b7f190
tree9c3dc47e8920c031f0c539dd459bbca80c66986b
parent5088113ff13b483ae081532ceba4aab550611605
In WebKit2, page zooming does not work with PDF
https://bugs.webkit.org/show_bug.cgi?id=52113

Reviewed by Maciej Stachowiak.

* UIProcess/API/C/WKPage.cpp:
(WKPageSupportsTextZoom): Added. Returns whether the page currently supports text-only zoom.
* UIProcess/API/C/WKPage.h:
* UIProcess/API/mac/PDFViewController.h: Made pdfDocumentClass() private and declared new
member functions.
* UIProcess/API/mac/PDFViewController.mm:
(WebKit::PDFViewController::zoomFactor): Added.
(WebKit::PDFViewController::setZoomFactor): Added.
* UIProcess/API/mac/PageClientImpl.h:
* UIProcess/API/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::customRepresentationZoomFactor): Added. Calls through to the WKView.
(WebKit::PageClientImpl::setCustomRepresentationZoomFactor): Ditto.
* UIProcess/API/mac/WKView.mm:
(-[WKView _customRepresentationZoomFactor]): Added. Calls through to the PDFViewController.
(-[WKView _setCustomRepresentationZoomFactor:]): Ditto.
* UIProcess/API/mac/WKViewInternal.h:
* UIProcess/API/qt/qwkpage_p.h:
(QWKPagePrivate::customRepresentationZoomFactor): Added.
(QWKPagePrivate::setCustomRepresentationZoomFactor): Added.
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy): Coding style fix.
(WebKit::WebPageProxy::supportsTextZoom): Added. Returns false if the main frame has a custom
representation or is a standalone image, true otherwise.
(WebKit::WebPageProxy::setTextZoomFactor): Bail out if the main frame has a custom representation.
(WebKit::WebPageProxy::pageZoomFactor): If the main frame has a custom representation, get the
zoom factor from the page client.
(WebKit::WebPageProxy::setPageZoomFactor): If the main frame has a custom representation, have
the client set the zoom factor.
(WebKit::WebPageProxy::setPageAndTextZoomFactors): Ditto.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::textZoomFactor): Changed to return 1 if the main frame has a custom
representation.
* UIProcess/win/WebView.cpp:
(WebKit::WebView::customRepresentationZoomFactor): Added.
(WebKit::WebView::setCustomRepresentationZoomFactor): Added.
* UIProcess/win/WebView.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75331 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
WebKit2/ChangeLog
WebKit2/UIProcess/API/C/WKPage.cpp
WebKit2/UIProcess/API/C/WKPage.h
WebKit2/UIProcess/API/mac/PDFViewController.h
WebKit2/UIProcess/API/mac/PDFViewController.mm
WebKit2/UIProcess/API/mac/PageClientImpl.h
WebKit2/UIProcess/API/mac/PageClientImpl.mm
WebKit2/UIProcess/API/mac/WKView.mm
WebKit2/UIProcess/API/mac/WKViewInternal.h
WebKit2/UIProcess/API/qt/qwkpage_p.h
WebKit2/UIProcess/PageClient.h
WebKit2/UIProcess/WebPageProxy.cpp
WebKit2/UIProcess/WebPageProxy.h
WebKit2/UIProcess/win/WebView.cpp
WebKit2/UIProcess/win/WebView.h