[Chromium] setPageScaleFactor and associated methods should take scaling limits into...
authorfsamuel@chromium.org <fsamuel@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Nov 2011 22:47:05 +0000 (22:47 +0000)
committerfsamuel@chromium.org <fsamuel@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Nov 2011 22:47:05 +0000 (22:47 +0000)
commit8a05cfef27f42185ec36ccbeb72a827813f3a16e
treec12296597179705c88e0a24f1ce14eca832b4961
parent85023835e4ecef0dcf10be28ba0ef4c264bcbb2a
[Chromium] setPageScaleFactor and associated methods should take scaling limits into account
https://bugs.webkit.org/show_bug.cgi?id=72176

Source/WebKit/chromium:

Reviewed by Darin Fisher.

A couple of changes:

1. setPageScaleFactorLimits now affects the behavior of other scaling methods
   including setPageScaleFactor.
2. setPageScaleFactorPreservingScrollOffset introduced that scales the scroll offset
   along with the page, preserving the scroll position within the page bounds.

* public/WebView.h:
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::WebViewImpl):
(WebKit::WebViewImpl::computePageScaleFactorWithinLimits):
(WebKit::WebViewImpl::clampOffsetAtScale):
(WebKit::WebViewImpl::setPageScaleFactorPreservingScrollOffset):
(WebKit::WebViewImpl::setPageScaleFactor):
(WebKit::WebViewImpl::setPageScaleFactorLimits):
(WebKit::WebViewImpl::applyScrollAndScale):
* src/WebViewImpl.h:

LayoutTests:

Reviewed by Darin Fisher.

Rebaselined some tests that broke because we now clamp pageScaleFactor to 0.25 (these test at 0.2).

Since this is a Chromium only change, the new baselines are only for Chromium.

* platform/chromium-linux/fast/repaint/scale-page-shrink-expected.png:
* platform/chromium-linux/fast/repaint/scale-page-shrink-expected.txt: Added.
* platform/chromium/fast/repaint/background-scaling-expected.png: Copied from LayoutTests/platform/chromium-linux/fast/repaint/scale-page-shrink-expected.png.
* platform/chromium/fast/repaint/background-scaling-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@100196 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/chromium-linux/fast/repaint/scale-page-shrink-expected.png
LayoutTests/platform/chromium-linux/fast/repaint/scale-page-shrink-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium/fast/repaint/background-scaling-expected.png [new file with mode: 0644]
LayoutTests/platform/chromium/fast/repaint/background-scaling-expected.txt [new file with mode: 0644]
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/WebView.h
Source/WebKit/chromium/src/WebViewImpl.cpp
Source/WebKit/chromium/src/WebViewImpl.h