Changeset 115907 in webkit


Ignore:
Timestamp:
May 2, 2012 4:15:41 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 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):

Location:
trunk/Source
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r115902 r115907  
     12012-05-02  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 ViewportAttributes' 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-02  Joshua Bell  <jsbell@chromium.org>
    217
  • trunk/Source/WebCore/dom/ViewportArguments.cpp

    r113454 r115907  
    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

    r99195 r115907  
    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/qt/Api/qwebpage.cpp

    r115828 r115907  
    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

    r96345 r115907  
    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

    r115832 r115907  
     12012-05-02  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.h:
     9        * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
     10        (DumpRenderTreeSupportQt::viewportAsText):
     11
    1122012-05-02  Milian Wolff  <milian.wolff@kdab.com>
    213
  • trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp

    r115210 r115907  
    811811
    812812    QString res;
    813     res = res.sprintf("viewport size %dx%d scale %f with limits [%f, %f] and userScalable %f\n",
     813    res = res.sprintf("viewport size %fx%f scale %f with limits [%f, %f] and userScalable %f\n",
    814814            conf.layoutSize.width(),
    815815            conf.layoutSize.height(),
  • trunk/Source/WebKit2/ChangeLog

    r115877 r115907  
     12012-05-02  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::viewportConfigurationAsText):
     12
    1132012-05-02  Emil A Eklund  <eae@chromium.org>
    214
  • trunk/Source/WebKit2/UIProcess/API/qt/qwebviewportinfo.cpp

    r114897 r115907  
    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

    r115877 r115907  
    893893    ViewportAttributes attr = computeViewportAttributes(m_page->viewportArguments(), minimumLayoutFallbackWidth, settings->deviceWidth(), settings->deviceHeight(), settings->deviceDPI(), m_viewportSize);
    894894
    895     setResizesToContentsUsingLayoutSize(attr.layoutSize);
     895    setResizesToContentsUsingLayoutSize(IntSize(static_cast<int>(attr.layoutSize.width()), static_cast<int>(attr.layoutSize.height())));
    896896    send(Messages::WebPageProxy::DidChangeViewportProperties(attr));
    897897}
     
    30533053    WebCore::restrictMinimumScaleFactorToViewportSize(attrs, IntSize(availableWidth, availableHeight));
    30543054    WebCore::restrictScaleFactorToInitialScaleIfNotUserScalable(attrs);
    3055     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);
     3055    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);
    30563056}
    30573057
Note: See TracChangeset for help on using the changeset viewer.