https://bugs.webkit.org/show_bug.cgi?id=70609
Reviewed by Kenneth Rohde Christiansen.
Source/WebCore:
Make ViewportAttributes' layoutSize be a FloatRect to avoid rounding
too early, and the occasional off by one fixed layout dimensions.
* dom/ViewportArguments.cpp:
(WebCore::computeViewportAttributes):
* dom/ViewportArguments.h:
(ViewportAttributes):
Source/WebKit/qt:
* Api/qwebpage.h:
* WebCoreSupport/DumpRenderTreeSupportQt.cpp:
(DumpRenderTreeSupportQt::viewportAsText):
Source/WebKit2:
* UIProcess/API/qt/qwebviewportinfo.cpp:
(QWebViewportInfo::layoutSize):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::viewportConfigurationAsText):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@115907
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-05-02 Fady Samuel <fsamuel@chromium.org>
+
+ Removing line in computeViewportAttributes that enforces a minimum scale factor to never allow zooming out more than viewport
+ https://bugs.webkit.org/show_bug.cgi?id=70609
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Make ViewportAttributes' layoutSize be a FloatRect to avoid rounding
+ too early, and the occasional off by one fixed layout dimensions.
+
+ * dom/ViewportArguments.cpp:
+ (WebCore::computeViewportAttributes):
+ * dom/ViewportArguments.h:
+ (ViewportAttributes):
+
2012-05-02 Joshua Bell <jsbell@chromium.org>
IndexedDB: Handle generated keys up to 2^53
// Extend width and height to fill the visual viewport for the resolved initial-scale.
width = max<float>(width, availableWidth / result.initialScale);
height = max<float>(height, availableHeight / result.initialScale);
- result.layoutSize.setWidth(static_cast<int>(roundf(width)));
- result.layoutSize.setHeight(static_cast<int>(roundf(height)));
+ result.layoutSize.setWidth(width);
+ result.layoutSize.setHeight(height);
result.userScalable = args.userScalable;
#ifndef ViewportArguments_h
#define ViewportArguments_h
-#include "IntSize.h"
+#include "FloatSize.h"
#include <wtf/Forward.h>
namespace WebCore {
};
struct ViewportAttributes {
- IntSize layoutSize;
+ FloatSize layoutSize;
float devicePixelRatio;
WebCore::restrictScaleFactorToInitialScaleIfNotUserScalable(conf);
result.m_isValid = true;
- result.m_size = conf.layoutSize;
+ result.m_size = QSizeF(conf.layoutSize.width(), conf.layoutSize.height());
result.m_initialScaleFactor = conf.initialScale;
result.m_minimumScaleFactor = conf.minimumScale;
result.m_maximumScaleFactor = conf.maximumScale;
inline qreal devicePixelRatio() const { return m_devicePixelRatio; }
inline bool isUserScalable() const { return m_isUserScalable; }
inline bool isValid() const { return m_isValid; }
- inline QSize size() const { return m_size; }
+ inline QSizeF size() const { return m_size; }
private:
QSharedDataPointer<QtViewportAttributesPrivate> d;
qreal m_devicePixelRatio;
bool m_isUserScalable;
bool m_isValid;
- QSize m_size;
+ QSizeF m_size;
friend class WebCore::ChromeClientQt;
friend class QWebPage;
+2012-05-02 Fady Samuel <fsamuel@chromium.org>
+
+ Removing line in computeViewportAttributes that enforces a minimum scale factor to never allow zooming out more than viewport
+ https://bugs.webkit.org/show_bug.cgi?id=70609
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * Api/qwebpage.h:
+ * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+ (DumpRenderTreeSupportQt::viewportAsText):
+
2012-05-02 Milian Wolff <milian.wolff@kdab.com>
[Qt] Pass page-height to PrintContext::begin to fix print layouting
WebCore::restrictScaleFactorToInitialScaleIfNotUserScalable(conf);
QString res;
- res = res.sprintf("viewport size %dx%d scale %f with limits [%f, %f] and userScalable %f\n",
+ res = res.sprintf("viewport size %fx%f scale %f with limits [%f, %f] and userScalable %f\n",
conf.layoutSize.width(),
conf.layoutSize.height(),
conf.initialScale,
+2012-05-02 Fady Samuel <fsamuel@chromium.org>
+
+ Removing line in computeViewportAttributes that enforces a minimum scale factor to never allow zooming out more than viewport
+ https://bugs.webkit.org/show_bug.cgi?id=70609
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * UIProcess/API/qt/qwebviewportinfo.cpp:
+ (QWebViewportInfo::layoutSize):
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::viewportConfigurationAsText):
+
2012-05-02 Emil A Eklund <eae@chromium.org>
Fix usage of layout types in platform code
QVariant QWebViewportInfo::layoutSize() const
{
- return QSize(m_webViewPrivate->attributes.layoutSize);
+ return QSizeF(m_webViewPrivate->attributes.layoutSize.width(), m_webViewPrivate->attributes.layoutSize.height());
}
void QWebViewportInfo::didUpdateContentsSize()
ViewportAttributes attr = computeViewportAttributes(m_page->viewportArguments(), minimumLayoutFallbackWidth, settings->deviceWidth(), settings->deviceHeight(), settings->deviceDPI(), m_viewportSize);
- setResizesToContentsUsingLayoutSize(attr.layoutSize);
+ setResizesToContentsUsingLayoutSize(IntSize(static_cast<int>(attr.layoutSize.width()), static_cast<int>(attr.layoutSize.height())));
send(Messages::WebPageProxy::DidChangeViewportProperties(attr));
}
ViewportAttributes attrs = WebCore::computeViewportAttributes(arguments, /* default layout width for non-mobile pages */ 980, deviceWidth, deviceHeight, deviceDPI, IntSize(availableWidth, availableHeight));
WebCore::restrictMinimumScaleFactorToViewportSize(attrs, IntSize(availableWidth, availableHeight));
WebCore::restrictScaleFactorToInitialScaleIfNotUserScalable(attrs);
- return String::format("viewport size %dx%d scale %f with limits [%f, %f] and userScalable %f\n", attrs.layoutSize.width(), attrs.layoutSize.height(), attrs.initialScale, attrs.minimumScale, attrs.maximumScale, attrs.userScalable);
+ return String::format("viewport size %fx%f scale %f with limits [%f, %f] and userScalable %f\n", attrs.layoutSize.width(), attrs.layoutSize.height(), attrs.initialScale, attrs.minimumScale, attrs.maximumScale, attrs.userScalable);
}
void WebPage::setCompositionForTesting(const String& compositionString, uint64_t from, uint64_t length)