https://bugs.webkit.org/show_bug.cgi?id=90575
Patch by Mike Lattanzio <mlattanzio@rim.com> on 2012-07-09
Reviewed by Rob Buis.
.:
Add a manual test to verify wide content doesn't interfere
with initial-scale calculations.
Internal review from Konrad Piascik.
* ManualTests/blackberry/meta-viewport-initial-scale-wide-content.html: Added.
Source/WebKit/blackberry:
Refactor meta viewport handling to multiply the developer
specified scale properties by the devicePixelRatio. This
required moving the setting of these values until after
the call to computeViewportAttributes.
This fixes an isssue where content wider than the meta viewport
would case a zoom-out-to-fit scenario because we misinterpreted
the specified initial-scale.
New test to verify wide content doesn't affect initial-scale:
ManualTests/blackberry/meta-viewport-initial-scale-wide-content.html
Internal review from Konrad Piascik, Arvid Nilsson.
* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::recomputeVirtualViewportFromViewportArguments):
(BlackBerry::WebKit::WebPagePrivate::dispatchViewportPropertiesDidChange):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@122135
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-07-09 Mike Lattanzio <mlattanzio@rim.com>
+
+ [BlackBerry] meta viewport initial-scale doesn't factor in device pixel ratio
+ https://bugs.webkit.org/show_bug.cgi?id=90575
+
+ Reviewed by Rob Buis.
+
+ Add a manual test to verify wide content doesn't interfere
+ with initial-scale calculations.
+
+ Internal review from Konrad Piascik.
+
+ * ManualTests/blackberry/meta-viewport-initial-scale-wide-content.html: Added.
+
2012-07-09 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r122107.
--- /dev/null
+<html>
+<head>
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+<style>
+body { margin: 0; padding: 0; }
+#green { width: 100%; height: 100%; background: green; }
+#red { width: 1024px; height: 2048px; background: red; }
+</style>
+</head>
+<body>
+<div id="green">
+This green box should fully fill the initial viewport, and the text within it
+should wrap at the edge of the screen appropriately. The test is PASSED if
+this green box is fully visible and takes up the whole screen.
+</div>
+<div id="red">
+This should not be visible initially. This test is FAILED if you can see
+can red without first scrolling down.
+</div>
+</body>
+</html>
int deviceHeight = Platform::Graphics::Screen::primaryScreen()->height();
ViewportAttributes result = computeViewportAttributes(m_viewportArguments, desktopWidth, deviceWidth, deviceHeight, m_webSettings->devicePixelRatio(), m_defaultLayoutSize);
m_page->setDeviceScaleFactor(result.devicePixelRatio);
+
+ setUserScalable(m_userScalable && result.userScalable);
+ if (result.initialScale > 0)
+ setInitialScale(result.initialScale * result.devicePixelRatio);
+ if (result.minimumScale > 0)
+ setMinimumScale(result.minimumScale * result.devicePixelRatio);
+ if (result.maximumScale > 0)
+ setMaximumScale(result.maximumScale * result.devicePixelRatio);
+
return IntSize(result.layoutSize.width(), result.layoutSize.height());
}
if (!m_viewportArguments.height)
m_viewportArguments.height = ViewportArguments::ValueDeviceHeight;
- setUserScalable(arguments.userScalable == ViewportArguments::ValueAuto ? true : arguments.userScalable);
- if (arguments.initialScale > 0)
- setInitialScale(arguments.initialScale);
- if (arguments.minimumScale > 0)
- setMinimumScale(arguments.minimumScale);
- if (arguments.maximumScale > 0)
- setMaximumScale(arguments.maximumScale);
-
IntSize virtualViewport = recomputeVirtualViewportFromViewportArguments();
m_webPage->setVirtualViewportSize(virtualViewport.width(), virtualViewport.height());
+2012-07-09 Mike Lattanzio <mlattanzio@rim.com>
+
+ [BlackBerry] meta viewport initial-scale doesn't factor in device pixel ratio
+ https://bugs.webkit.org/show_bug.cgi?id=90575
+
+ Reviewed by Rob Buis.
+
+ Refactor meta viewport handling to multiply the developer
+ specified scale properties by the devicePixelRatio. This
+ required moving the setting of these values until after
+ the call to computeViewportAttributes.
+
+ This fixes an isssue where content wider than the meta viewport
+ would case a zoom-out-to-fit scenario because we misinterpreted
+ the specified initial-scale.
+
+ New test to verify wide content doesn't affect initial-scale:
+ ManualTests/blackberry/meta-viewport-initial-scale-wide-content.html
+
+ Internal review from Konrad Piascik, Arvid Nilsson.
+
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPagePrivate::recomputeVirtualViewportFromViewportArguments):
+ (BlackBerry::WebKit::WebPagePrivate::dispatchViewportPropertiesDidChange):
+
2012-07-07 George Staikos <staikos@webkit.org>
Detach animation clients properly if we clear the web page pointer.