Refactor ViewportArguments to only use CSS units
authorkenneth@webkit.org <kenneth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Nov 2012 08:20:25 +0000 (08:20 +0000)
committerkenneth@webkit.org <kenneth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Nov 2012 08:20:25 +0000 (08:20 +0000)
commit70dbd68d55e4627ab1033f95af079fb14772dcb9
tree1074f8c5fac133824d6efd703ccaaa6139776cc0
parenta580caaa0095f4b75666dd7fd00d67dbbb15052a
Refactor ViewportArguments to only use CSS units
https://bugs.webkit.org/show_bug.cgi?id=102287

Reviewed by Noam Rosenthal.

Refactor the ViewportArgument code to use a member method for
resolving the viewport. This new method only uses arguments in
CSS units.

This is preparation for adding the CSS Device Adaptation support.

Tested by existing tests fast/viewport.

* dom/ViewportArguments.cpp:
(WebCore::clampLengthValue):
(WebCore::clampScaleValue): New utility functions.
(WebCore::ViewportArguments::resolve):
(WebCore::convertToUserSpace): Added until everyone provides arguments
only in CSS units and not device ones.
(WebCore::computeViewportAttributes):
(WebCore::computeMinimumScaleFactorForContentContained):
(WebCore):
(WebCore::restrictMinimumScaleFactorToViewportSize):
* dom/ViewportArguments.h:
(ViewportArguments):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@134749 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/dom/ViewportArguments.cpp
Source/WebCore/dom/ViewportArguments.h