Changeset 99173 in webkit


Ignore:
Timestamp:
Nov 3, 2011, 5:21:27 AM (14 years ago)
Author:
kenneth@webkit.org
Message:

Differentiate implicit viewport from that of the meta tag
https://bugs.webkit.org/show_bug.cgi?id=71453

Reviewed by Simon Hausmann.

This is needed because of DPI adjustment taking place with the meta
tag. This is to be avoided when no viewport meta tag is present.

  • dom/Document.cpp:

(WebCore::Document::processViewport):

  • dom/ViewportArguments.cpp:

(WebCore::computeViewportAttributes):

  • dom/ViewportArguments.h:

(WebCore::ViewportArguments::ViewportArguments):
(WebCore::ViewportArguments::operator==):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r99171 r99173  
     12011-11-03  Kenneth Rohde Christiansen  <kenneth@webkit.org>
     2
     3        Differentiate implicit viewport from that of the meta tag
     4        https://bugs.webkit.org/show_bug.cgi?id=71453
     5
     6        Reviewed by Simon Hausmann.
     7
     8        This is needed because of DPI adjustment taking place with the meta
     9        tag. This is to be avoided when no viewport meta tag is present.
     10
     11        * dom/Document.cpp:
     12        (WebCore::Document::processViewport):
     13        * dom/ViewportArguments.cpp:
     14        (WebCore::computeViewportAttributes):
     15        * dom/ViewportArguments.h:
     16        (WebCore::ViewportArguments::ViewportArguments):
     17        (WebCore::ViewportArguments::operator==):
     18
    1192011-11-03  Andreas Kling  <kling@webkit.org>
    220
  • trunk/Source/WebCore/dom/Document.cpp

    r98656 r99173  
    26712671    ASSERT(!features.isNull());
    26722672
    2673     m_viewportArguments = ViewportArguments();
     2673    m_viewportArguments = ViewportArguments(ViewportArguments::ViewportMeta);
    26742674    processArguments(features, (void*)&m_viewportArguments, &setViewportFeature);
    26752675
  • trunk/Source/WebCore/dom/ViewportArguments.cpp

    r97538 r99173  
    5151    ASSERT(availableWidth > 0 && availableHeight > 0);
    5252
     53    float autoDPI;
     54
     55    switch (args.type) {
     56    case ViewportArguments::Implicit:
     57        autoDPI = deviceDPI;
     58        break;
     59    case ViewportArguments::ViewportMeta:
     60        autoDPI = 160;
     61        break;
     62    }
     63
    5364    switch (int(args.targetDensityDpi)) {
    5465    case ViewportArguments::ValueDeviceDPI:
     
    5970        break;
    6071    case ViewportArguments::ValueAuto:
     72        args.targetDensityDpi = autoDPI;
     73        break;
    6174    case ViewportArguments::ValueMediumDPI:
    6275        args.targetDensityDpi = 160;
  • trunk/Source/WebCore/dom/ViewportArguments.h

    r95901 r99173  
    5757struct ViewportArguments {
    5858
     59    enum Type {
     60        Implicit,
     61        ViewportMeta
     62    } type;
     63
    5964    enum {
    6065        ValueAuto = -1,
     
    6873    };
    6974
    70     ViewportArguments()
    71         : initialScale(ValueAuto)
     75    ViewportArguments(Type type = Implicit)
     76        : type(type)
     77        , initialScale(ValueAuto)
    7278        , minimumScale(ValueAuto)
    7379        , maximumScale(ValueAuto)
     
    8995    bool operator==(const ViewportArguments& other) const
    9096    {
     97        // Used for figuring out whether to reset the viewport or not,
     98        // thus we are not taking type into account.
    9199        return initialScale == other.initialScale
    92100            && minimumScale == other.minimumScale
Note: See TracChangeset for help on using the changeset viewer.