Changeset 115998 in webkit


Ignore:
Timestamp:
May 3, 2012 12:41:39 PM (12 years ago)
Author:
fsamuel@chromium.org
Message:

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.

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):

Location:
trunk
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/fast/viewport/viewport-86-expected.txt

    r88134 r115998  
    1 viewport size 457x503 scale 0.700000 with limits [0.700000, 5.000000] and userScalable -1.000000
     1viewport size 457x502 scale 0.700000 with limits [0.700000, 5.000000] and userScalable -1.000000
    22
  • trunk/LayoutTests/platform/gtk/test_expectations.txt

    r115892 r115998  
    12971297BUGWK71022 : fast/canvas/canvas-composite-image.html = FAIL
    12981298BUGWK71022 : fast/canvas/canvas-composite-canvas.html = FAIL
    1299 
    1300 // REGRESSION(r99195)
    1301 BUGWK70609 : fast/viewport/viewport-121.html = FAIL
    1302 BUGWK70609 : fast/viewport/viewport-122.html = FAIL
    1303 BUGWK70609 : fast/viewport/viewport-125.html = FAIL
    1304 BUGWK70609 : fast/viewport/viewport-129.html = FAIL
    1305 BUGWK70609 : fast/viewport/viewport-18.html = FAIL
    1306 BUGWK70609 : fast/viewport/viewport-36.html = FAIL
    1307 BUGWK70609 : fast/viewport/viewport-37.html = FAIL
    1308 BUGWK70609 : fast/viewport/viewport-43.html = FAIL
    1309 BUGWK70609 : fast/viewport/viewport-46.html = FAIL
    1310 BUGWK70609 : fast/viewport/viewport-52.html = FAIL
    1311 BUGWK70609 : fast/viewport/viewport-53.html = FAIL
    1312 BUGWK70609 : fast/viewport/viewport-54.html = FAIL
    1313 BUGWK70609 : fast/viewport/viewport-55.html = FAIL
    1314 BUGWK70609 : fast/viewport/viewport-60.html = FAIL
    1315 BUGWK70609 : fast/viewport/viewport-75.html = FAIL
    1316 BUGWK70609 : fast/viewport/viewport-76.html = FAIL
    1317 BUGWK70609 : fast/viewport/viewport-83.html = FAIL
    1318 BUGWK70609 : fast/viewport/viewport-86.html = FAIL
    1319 BUGWK70609 : fast/viewport/viewport-warnings-3.html = FAIL
    1320 BUGWK70609 : fast/viewport/viewport-warnings-4.html = FAIL
    1321 BUGWK70609 : fast/viewport/viewport-warnings-6.html = FAIL
    13221299
    13231300// viewport meta tag tests that failed because window.devicePixelRatio is not implemented
  • trunk/LayoutTests/platform/qt/Skipped

    r115941 r115998  
    24602460fast/canvas/canvas-composite-canvas.html
    24612461
    2462 # REGRESSION(r99195)
    2463 # https://bugs.webkit.org/show_bug.cgi?id=70609
    2464 fast/viewport/viewport-83.html
    2465 fast/viewport/viewport-54.html
    2466 fast/viewport/viewport-37.html
    2467 fast/viewport/viewport-121.html
    2468 fast/viewport/viewport-86.html
    2469 fast/viewport/viewport-52.html
    2470 fast/viewport/viewport-129.html
    2471 fast/viewport/viewport-36.html
    2472 fast/viewport/viewport-122.html
    2473 fast/viewport/viewport-125.html
    2474 fast/viewport/viewport-60.html
    2475 fast/viewport/viewport-55.html
    2476 fast/viewport/viewport-18.html
    2477 fast/viewport/viewport-46.html
    2478 fast/viewport/viewport-warnings-4.html
    2479 fast/viewport/viewport-43.html
    2480 fast/viewport/viewport-53.html
    2481 fast/viewport/viewport-75.html
    2482 fast/viewport/viewport-76.html
    2483 fast/viewport/viewport-warnings-6.html
    2484 fast/viewport/viewport-warnings-3.html
    2485 
    24862462# track not functional yet.
    24872463fast/events/constructors/track-event-constructor.html
  • trunk/Source/WebCore/ChangeLog

    r115997 r115998  
     12012-05-03  Fady Samuel  <fsamuel@chromium.org>
     2
     3        Removing line in computeViewportAttributes that enforces a minimum scale factor to never allow zooming out more than viewport
     4        https://bugs.webkit.org/show_bug.cgi?id=70609
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        Make Viewport Attributes' layoutSize be a FloatRect to avoid rounding
     9        too early, and the occasional off by one fixed layout dimensions.
     10
     11        * dom/ViewportArguments.cpp:
     12        (WebCore::computeViewportAttributes):
     13        * dom/ViewportArguments.h:
     14        (ViewportAttributes):
     15
    1162012-05-03  Joshua Bell  <jsbell@chromium.org>
    217
  • trunk/Source/WebCore/dom/ViewportArguments.cpp

    r115939 r115998  
    178178    width = max<float>(width, availableWidth / result.initialScale);
    179179    height = max<float>(height, availableHeight / result.initialScale);
    180     result.layoutSize.setWidth(static_cast<int>(roundf(width)));
    181     result.layoutSize.setHeight(static_cast<int>(roundf(height)));
     180    result.layoutSize.setWidth(width);
     181    result.layoutSize.setHeight(height);
    182182
    183183    result.userScalable = args.userScalable;
  • trunk/Source/WebCore/dom/ViewportArguments.h

    r115939 r115998  
    2828#define ViewportArguments_h
    2929
    30 #include "IntSize.h"
     30#include "FloatSize.h"
    3131#include <wtf/Forward.h>
    3232
     
    4444
    4545struct ViewportAttributes {
    46     IntSize layoutSize;
     46    FloatSize layoutSize;
    4747
    4848    float devicePixelRatio;
  • trunk/Source/WebKit/blackberry/ChangeLog

    r115974 r115998  
     12012-05-03  Fady Samuel  <fsamuel@chromium.org>
     2
     3        Removing line in computeViewportAttributes that enforces a minimum scale factor to never allow zooming out more than viewport
     4        https://bugs.webkit.org/show_bug.cgi?id=70609
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        * WebKitSupport/DumpRenderTreeSupport.cpp:
     9        (DumpRenderTreeSupport::dumpConfigurationForViewport):
     10
    1112012-05-03  Mike Fenton  <mifenton@rim.com>
    212
  • trunk/Source/WebKit/blackberry/WebKitSupport/DumpRenderTreeSupport.cpp

    r112720 r115998  
    9292    restrictScaleFactorToInitialScaleIfNotUserScalable(attrs);
    9393
    94     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);
     94    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);
    9595}
    9696
  • trunk/Source/WebKit/efl/ChangeLog

    r115926 r115998  
     12012-05-03  Fady Samuel  <fsamuel@chromium.org>
     2
     3        Removing line in computeViewportAttributes that enforces a minimum scale factor to never allow zooming out more than viewport
     4        https://bugs.webkit.org/show_bug.cgi?id=70609
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        * WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
     9        (DumpRenderTreeSupportEfl::dumpConfigurationForViewport):
     10
    1112012-04-18  Jon Honeycutt  <jhoneycutt@apple.com>
    212
  • trunk/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp

    r115332 r115998  
    535535    restrictMinimumScaleFactorToViewportSize(attributes, availableSize);
    536536    restrictScaleFactorToInitialScaleIfNotUserScalable(attributes);
    537     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);
     537    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);
    538538}
    539539
  • trunk/Source/WebKit/gtk/ChangeLog

    r115926 r115998  
     12012-05-03  Fady Samuel  <fsamuel@chromium.org>
     2
     3        Removing line in computeViewportAttributes that enforces a minimum scale factor to never allow zooming out more than viewport
     4        https://bugs.webkit.org/show_bug.cgi?id=70609
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
     9        (DumpRenderTreeSupportGtk::dumpConfigurationForViewport):
     10
    1112012-04-18  Jon Honeycutt  <jhoneycutt@apple.com>
    212
  • trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp

    r115621 r115998  
    672672    restrictMinimumScaleFactorToViewportSize(attrs, IntSize(availableWidth, availableHeight));
    673673    restrictScaleFactorToInitialScaleIfNotUserScalable(attrs);
    674     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);
     674    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);
    675675}
    676676
  • trunk/Source/WebKit/qt/Api/qwebpage.cpp

    r115939 r115998  
    25342534
    25352535    result.m_isValid = true;
    2536     result.m_size = conf.layoutSize;
     2536    result.m_size = QSizeF(conf.layoutSize.width(), conf.layoutSize.height());
    25372537    result.m_initialScaleFactor = conf.initialScale;
    25382538    result.m_minimumScaleFactor = conf.minimumScale;
  • trunk/Source/WebKit/qt/Api/qwebpage.h

    r115939 r115998  
    233233        inline bool isUserScalable() const { return m_isUserScalable; }
    234234        inline bool isValid() const { return m_isValid; }
    235         inline QSize size() const { return m_size; }
     235        inline QSizeF size() const { return m_size; }
    236236
    237237    private:
     
    243243        bool m_isUserScalable;
    244244        bool m_isValid;
    245         QSize m_size;
     245        QSizeF m_size;
    246246
    247247        friend class WebCore::ChromeClientQt;
  • trunk/Source/WebKit/qt/ChangeLog

    r115943 r115998  
     12012-05-03  Fady Samuel  <fsamuel@chromium.org>
     2
     3        Removing line in computeViewportAttributes that enforces a minimum scale factor to never allow zooming out more than viewport
     4        https://bugs.webkit.org/show_bug.cgi?id=70609
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        * Api/qwebpage.cpp:
     9        (QWebPage::viewportAttributesForSize):
     10        * Api/qwebpage.h:
     11        * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
     12        (DumpRenderTreeSupportQt::viewportAsText):
     13
    1142012-04-27  Jon Lee  <jonlee@apple.com>
    215
  • trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp

    r115939 r115998  
    812812    QString res;
    813813    res = res.sprintf("viewport size %dx%d scale %f with limits [%f, %f] and userScalable %f\n",
    814             conf.layoutSize.width(),
    815             conf.layoutSize.height(),
     814            static_cast<int>(conf.layoutSize.width()),
     815            static_cast<int>(conf.layoutSize.height()),
    816816            conf.initialScale,
    817817            conf.minimumScale,
  • trunk/Source/WebKit2/ChangeLog

    r115973 r115998  
     12012-05-03  Fady Samuel  <fsamuel@chromium.org>
     2
     3        Removing line in computeViewportAttributes that enforces a minimum scale factor to never allow zooming out more than viewport
     4        https://bugs.webkit.org/show_bug.cgi?id=70609
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        * UIProcess/API/qt/qwebviewportinfo.cpp:
     9        (QWebViewportInfo::layoutSize):
     10        * WebProcess/WebPage/WebPage.cpp:
     11        (WebKit::WebPage::sendViewportAttributesChanged):
     12        (WebKit::WebPage::viewportConfigurationAsText):
     13
    1142012-05-03  Michael Brüning  <michael.bruning@nokia.com>
    215
  • trunk/Source/WebKit2/UIProcess/API/qt/qwebviewportinfo.cpp

    r115939 r115998  
    7878QVariant QWebViewportInfo::layoutSize() const
    7979{
    80     return QSize(m_webViewPrivate->attributes.layoutSize);
     80    return QSizeF(m_webViewPrivate->attributes.layoutSize.width(), m_webViewPrivate->attributes.layoutSize.height());
    8181}
    8282
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r115948 r115998  
    883883    ViewportAttributes attr = computeViewportAttributes(m_page->viewportArguments(), minimumLayoutFallbackWidth, settings->deviceWidth(), settings->deviceHeight(), static_cast<int>(160 * settings->devicePixelRatio()), m_viewportSize);
    884884
    885     setResizesToContentsUsingLayoutSize(attr.layoutSize);
     885    setResizesToContentsUsingLayoutSize(IntSize(static_cast<int>(attr.layoutSize.width()), static_cast<int>(attr.layoutSize.height())));
    886886    send(Messages::WebPageProxy::DidChangeViewportProperties(attr));
    887887}
     
    30443044    WebCore::restrictMinimumScaleFactorToViewportSize(attrs, IntSize(availableWidth, availableHeight));
    30453045    WebCore::restrictScaleFactorToInitialScaleIfNotUserScalable(attrs);
    3046     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);
     3046    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);
    30473047}
    30483048
Note: See TracChangeset for help on using the changeset viewer.