Removing line in computeViewportAttributes that enforces a minimum scale factor to...
authorfsamuel@chromium.org <fsamuel@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 May 2012 19:41:39 +0000 (19:41 +0000)
committerfsamuel@chromium.org <fsamuel@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 May 2012 19:41:39 +0000 (19:41 +0000)
https://bugs.webkit.org/show_bug.cgi?id=70609

Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

Make Viewport Attributes' 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/blackberry:

* WebKitSupport/DumpRenderTreeSupport.cpp:
(DumpRenderTreeSupport::dumpConfigurationForViewport):

Source/WebKit/efl:

* WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
(DumpRenderTreeSupportEfl::dumpConfigurationForViewport):

Source/WebKit/gtk:

* WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
(DumpRenderTreeSupportGtk::dumpConfigurationForViewport):

Source/WebKit/qt:

* Api/qwebpage.cpp:
(QWebPage::viewportAttributesForSize):
* Api/qwebpage.h:
* WebCoreSupport/DumpRenderTreeSupportQt.cpp:
(DumpRenderTreeSupportQt::viewportAsText):

Source/WebKit2:

* UIProcess/API/qt/qwebviewportinfo.cpp:
(QWebViewportInfo::layoutSize):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::sendViewportAttributesChanged):
(WebKit::WebPage::viewportConfigurationAsText):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@115998 268f45cc-cd09-0410-ab3c-d52691b4dbfc

19 files changed:
LayoutTests/fast/viewport/viewport-86-expected.txt
LayoutTests/platform/gtk/test_expectations.txt
LayoutTests/platform/qt/Skipped
Source/WebCore/ChangeLog
Source/WebCore/dom/ViewportArguments.cpp
Source/WebCore/dom/ViewportArguments.h
Source/WebKit/blackberry/ChangeLog
Source/WebKit/blackberry/WebKitSupport/DumpRenderTreeSupport.cpp
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp
Source/WebKit/qt/Api/qwebpage.cpp
Source/WebKit/qt/Api/qwebpage.h
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/qt/qwebviewportinfo.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp

index ecf9265..3328deb 100644 (file)
@@ -1,2 +1,2 @@
-viewport size 457x503 scale 0.700000 with limits [0.700000, 5.000000] and userScalable -1.000000
+viewport size 457x502 scale 0.700000 with limits [0.700000, 5.000000] and userScalable -1.000000
 
index f005998..99059e2 100644 (file)
@@ -1297,29 +1297,6 @@ BUGWKGTK SKIP WONTFIX : accessibility/plugin.html = FAIL
 BUGWK71022 : fast/canvas/canvas-composite-image.html = FAIL
 BUGWK71022 : fast/canvas/canvas-composite-canvas.html = FAIL
 
-// REGRESSION(r99195)
-BUGWK70609 : fast/viewport/viewport-121.html = FAIL
-BUGWK70609 : fast/viewport/viewport-122.html = FAIL
-BUGWK70609 : fast/viewport/viewport-125.html = FAIL
-BUGWK70609 : fast/viewport/viewport-129.html = FAIL
-BUGWK70609 : fast/viewport/viewport-18.html = FAIL
-BUGWK70609 : fast/viewport/viewport-36.html = FAIL
-BUGWK70609 : fast/viewport/viewport-37.html = FAIL
-BUGWK70609 : fast/viewport/viewport-43.html = FAIL
-BUGWK70609 : fast/viewport/viewport-46.html = FAIL
-BUGWK70609 : fast/viewport/viewport-52.html = FAIL
-BUGWK70609 : fast/viewport/viewport-53.html = FAIL
-BUGWK70609 : fast/viewport/viewport-54.html = FAIL
-BUGWK70609 : fast/viewport/viewport-55.html = FAIL
-BUGWK70609 : fast/viewport/viewport-60.html = FAIL
-BUGWK70609 : fast/viewport/viewport-75.html = FAIL
-BUGWK70609 : fast/viewport/viewport-76.html = FAIL
-BUGWK70609 : fast/viewport/viewport-83.html = FAIL
-BUGWK70609 : fast/viewport/viewport-86.html = FAIL
-BUGWK70609 : fast/viewport/viewport-warnings-3.html = FAIL
-BUGWK70609 : fast/viewport/viewport-warnings-4.html = FAIL
-BUGWK70609 : fast/viewport/viewport-warnings-6.html = FAIL
-
 // viewport meta tag tests that failed because window.devicePixelRatio is not implemented
 BUGWKGTK : fast/viewport/viewport-133.html = FAIL
 
index 35e5575..398d193 100644 (file)
@@ -2459,30 +2459,6 @@ fast/events/touch/page-scaled-touch-gesture-click.html
 fast/canvas/canvas-composite-image.html
 fast/canvas/canvas-composite-canvas.html
 
-# REGRESSION(r99195)
-# https://bugs.webkit.org/show_bug.cgi?id=70609
-fast/viewport/viewport-83.html
-fast/viewport/viewport-54.html
-fast/viewport/viewport-37.html
-fast/viewport/viewport-121.html
-fast/viewport/viewport-86.html
-fast/viewport/viewport-52.html
-fast/viewport/viewport-129.html
-fast/viewport/viewport-36.html
-fast/viewport/viewport-122.html
-fast/viewport/viewport-125.html
-fast/viewport/viewport-60.html
-fast/viewport/viewport-55.html
-fast/viewport/viewport-18.html
-fast/viewport/viewport-46.html
-fast/viewport/viewport-warnings-4.html
-fast/viewport/viewport-43.html
-fast/viewport/viewport-53.html
-fast/viewport/viewport-75.html
-fast/viewport/viewport-76.html
-fast/viewport/viewport-warnings-6.html
-fast/viewport/viewport-warnings-3.html
-
 # track not functional yet.
 fast/events/constructors/track-event-constructor.html
 http/tests/security/text-track-crossorigin.html
index 520cf35..715f713 100644 (file)
@@ -1,3 +1,18 @@
+2012-05-03  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 Viewport Attributes' 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-03  Joshua Bell  <jsbell@chromium.org>
 
         IndexedDB: Handle generated keys up to 2^53
index c131fcc..0f329ac 100644 (file)
@@ -177,8 +177,8 @@ ViewportAttributes computeViewportAttributes(ViewportArguments args, int desktop
     // 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;
 
index 59b41de..79651d2 100644 (file)
@@ -27,7 +27,7 @@
 #ifndef ViewportArguments_h
 #define ViewportArguments_h
 
-#include "IntSize.h"
+#include "FloatSize.h"
 #include <wtf/Forward.h>
 
 namespace WebCore {
@@ -43,7 +43,7 @@ enum ViewportErrorCode {
 };
 
 struct ViewportAttributes {
-    IntSize layoutSize;
+    FloatSize layoutSize;
 
     float devicePixelRatio;
 
index 746e80b..f32aaf1 100644 (file)
@@ -1,3 +1,13 @@
+2012-05-03  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.
+
+        * WebKitSupport/DumpRenderTreeSupport.cpp:
+        (DumpRenderTreeSupport::dumpConfigurationForViewport):
+
 2012-05-03  Mike Fenton  <mifenton@rim.com>
 
         [BlackBerry] Add special attribute for alternate selection touch handling.
index d2f4859..cd1cb4c 100644 (file)
@@ -91,7 +91,7 @@ void DumpRenderTreeSupport::dumpConfigurationForViewport(Frame* mainFrame, int d
     restrictMinimumScaleFactorToViewportSize(attrs, IntSize(availableWidth, availableHeight));
     restrictScaleFactorToInitialScaleIfNotUserScalable(attrs);
 
-    fprintf(stdout, "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);
+    fprintf(stdout, "viewport size %dx%d scale %f with limits [%f, %f] and userScalable %f\n", static_cast<int>(attrs.layoutSize.width()), static_cast<int>(attrs.layoutSize.height()), attrs.initialScale, attrs.minimumScale, attrs.maximumScale, attrs.userScalable);
 }
 
 int DumpRenderTreeSupport::numberOfPendingGeolocationPermissionRequests(WebPage* webPage)
index 0b819a3..5a61d0b 100644 (file)
@@ -1,3 +1,13 @@
+2012-05-03  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.
+
+        * WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
+        (DumpRenderTreeSupportEfl::dumpConfigurationForViewport):
+
 2012-04-18  Jon Honeycutt  <jhoneycutt@apple.com>
 
         FrameLoaderClient::dispatchWillSendSubmitEvent() should be given more
index c47b9cc..933794b 100644 (file)
@@ -534,7 +534,7 @@ void DumpRenderTreeSupportEfl::dumpConfigurationForViewport(Evas_Object* ewkView
             availableSize);
     restrictMinimumScaleFactorToViewportSize(attributes, availableSize);
     restrictScaleFactorToInitialScaleIfNotUserScalable(attributes);
-    fprintf(stdout, "viewport size %dx%d scale %f with limits [%f, %f] and userScalable %f\n", attributes.layoutSize.width(), attributes.layoutSize.height(), attributes.initialScale, attributes.minimumScale, attributes.maximumScale, attributes.userScalable);
+    fprintf(stdout, "viewport size %dx%d scale %f with limits [%f, %f] and userScalable %f\n", static_cast<int>(attributes.layoutSize.width()), static_cast<int>(attributes.layoutSize.height()), attributes.initialScale, attributes.minimumScale, attributes.maximumScale, attributes.userScalable);
 }
 
 void DumpRenderTreeSupportEfl::deliverAllMutationsIfNecessary()
index c73835f..8c21a73 100644 (file)
@@ -1,3 +1,13 @@
+2012-05-03  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.
+
+        * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
+        (DumpRenderTreeSupportGtk::dumpConfigurationForViewport):
+
 2012-04-18  Jon Honeycutt  <jhoneycutt@apple.com>
 
         FrameLoaderClient::dispatchWillSendSubmitEvent() should be given more
index 50b0209..c00cc84 100644 (file)
@@ -671,7 +671,7 @@ void DumpRenderTreeSupportGtk::dumpConfigurationForViewport(WebKitWebView* webVi
     ViewportAttributes attrs = computeViewportAttributes(arguments, /* default layout width for non-mobile pages */ 980, deviceWidth, deviceHeight, deviceDPI, IntSize(availableWidth, availableHeight));
     restrictMinimumScaleFactorToViewportSize(attrs, IntSize(availableWidth, availableHeight));
     restrictScaleFactorToInitialScaleIfNotUserScalable(attrs);
-    fprintf(stdout, "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);
+    fprintf(stdout, "viewport size %dx%d scale %f with limits [%f, %f] and userScalable %f\n", static_cast<int>(attrs.layoutSize.width()), static_cast<int>(attrs.layoutSize.height()), attrs.initialScale, attrs.minimumScale, attrs.maximumScale, attrs.userScalable);
 }
 
 void DumpRenderTreeSupportGtk::clearOpener(WebKitWebFrame* frame)
index 1c47958..e85dfd2 100644 (file)
@@ -2533,7 +2533,7 @@ QWebPage::ViewportAttributes QWebPage::viewportAttributesForSize(const QSize& av
     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;
index fd2fd4b..0bf35e2 100644 (file)
@@ -232,7 +232,7 @@ public:
         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;
@@ -242,7 +242,7 @@ public:
         qreal m_devicePixelRatio;
         bool m_isUserScalable;
         bool m_isValid;
-        QSize m_size;
+        QSizeF m_size;
 
         friend class WebCore::ChromeClientQt;
         friend class QWebPage;
index 89a9cf1..e786a05 100644 (file)
@@ -1,3 +1,16 @@
+2012-05-03  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.cpp:
+        (QWebPage::viewportAttributesForSize):
+        * Api/qwebpage.h:
+        * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+        (DumpRenderTreeSupportQt::viewportAsText):
+
 2012-04-27  Jon Lee  <jonlee@apple.com>
 
         Migrate permission functions to Notification from NotificationCenter
index 63f77d6..0d2c2fd 100644 (file)
@@ -811,8 +811,8 @@ QString DumpRenderTreeSupportQt::viewportAsText(QWebPage* page, int deviceDPI, c
 
     QString res;
     res = res.sprintf("viewport size %dx%d scale %f with limits [%f, %f] and userScalable %f\n",
-            conf.layoutSize.width(),
-            conf.layoutSize.height(),
+            static_cast<int>(conf.layoutSize.width()),
+            static_cast<int>(conf.layoutSize.height()),
             conf.initialScale,
             conf.minimumScale,
             conf.maximumScale,
index 8182bb7..97d6253 100644 (file)
@@ -1,3 +1,16 @@
+2012-05-03  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::sendViewportAttributesChanged):
+        (WebKit::WebPage::viewportConfigurationAsText):
+
 2012-05-03  Michael BrĂ¼ning  <michael.bruning@nokia.com>
 
         [Qt][WK2] Also update Qt::ImEnabled flag when updating the input method.
index 56b1327..170604d 100644 (file)
@@ -77,7 +77,7 @@ QVariant QWebViewportInfo::isScalable() const
 
 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()
index 8c1617b..145cd82 100644 (file)
@@ -882,7 +882,7 @@ void WebPage::sendViewportAttributesChanged()
 
     ViewportAttributes attr = computeViewportAttributes(m_page->viewportArguments(), minimumLayoutFallbackWidth, settings->deviceWidth(), settings->deviceHeight(), static_cast<int>(160 * settings->devicePixelRatio()), m_viewportSize);
 
-    setResizesToContentsUsingLayoutSize(attr.layoutSize);
+    setResizesToContentsUsingLayoutSize(IntSize(static_cast<int>(attr.layoutSize.width()), static_cast<int>(attr.layoutSize.height())));
     send(Messages::WebPageProxy::DidChangeViewportProperties(attr));
 }
 
@@ -3043,7 +3043,7 @@ String WebPage::viewportConfigurationAsText(int deviceDPI, int deviceWidth, int
     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 %dx%d scale %f with limits [%f, %f] and userScalable %f\n", static_cast<int>(attrs.layoutSize.width()), static_cast<int>(attrs.layoutSize.height()), attrs.initialScale, attrs.minimumScale, attrs.maximumScale, attrs.userScalable);
 }
 
 void WebPage::setCompositionForTesting(const String& compositionString, uint64_t from, uint64_t length)