Changeset 68292 in webkit


Ignore:
Timestamp:
Sep 24, 2010 2:54:25 PM (14 years ago)
Author:
luiz@webkit.org
Message:

2010-09-24 Luiz Agostini <luiz.agostini@openbossa.org>

Reviewed by Kenneth Rohde Christiansen.

Keep viewport information in Document
https://bugs.webkit.org/show_bug.cgi?id=46385

The viewport meta data (layout viewport, scale) needs to be set again when bringing
back a page from the page cache. As the viewport metadata is only retrieved while parsing
the document, we need to store it in the Document class.

  • fast/viewport/viewport-128-expected.txt: Copied from LayoutTests/fast/viewport/viewport-19-expected.txt.
  • fast/viewport/viewport-128.html: Added.

2010-09-24 Luiz Agostini <luiz.agostini@openbossa.org>

Reviewed by Kenneth Rohde Christiansen.

Keep viewport information in Document
https://bugs.webkit.org/show_bug.cgi?id=46385

The viewport meta data (layout viewport, scale) needs to be set again when bringing
back a page from the page cache. As the viewport metadata is only retrieved while parsing
the document, we need to store it in the Document class.

Test: fast/viewport/viewport-128.html

  • WebCore.xcodeproj/project.pbxproj:
  • dom/Document.cpp: (WebCore::Document::processViewport): (WebCore::Document::setInPageCache):
  • dom/Document.h: (WebCore::Document::viewportArguments):

2010-09-24 Luiz Agostini <luiz.agostini@openbossa.org>

Reviewed by Kenneth Rohde Christiansen.

Keep viewport information in Document
https://bugs.webkit.org/show_bug.cgi?id=46385

The viewport meta data (layout viewport, scale) needs to be set again when bringing
back a page from the page cache. As the viewport metadata is only retrieved while parsing
the document, we need to store it in the Document class.

  • Api/qwebframe.cpp: (QWebFramePrivate::viewportArguments):
  • Api/qwebframe_p.h:
  • Api/qwebpage.cpp: (QWebPage::viewportConfigurationForSize):
  • WebCoreSupport/ChromeClientQt.cpp: (WebCore::ChromeClientQt::didReceiveViewportArguments):
  • WebCoreSupport/DumpRenderTreeSupportQt.cpp: (DumpRenderTreeSupportQt::viewportAsText):
  • WebCoreSupport/FrameLoaderClientQt.cpp: (WebCore::FrameLoaderClientQt::dispatchDidCommitLoad):
Location:
trunk
Files:
2 added
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r68286 r68292  
     12010-09-24  Luiz Agostini  <luiz.agostini@openbossa.org>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        Keep viewport information in Document
     6        https://bugs.webkit.org/show_bug.cgi?id=46385
     7
     8        The viewport meta data (layout viewport, scale) needs to be set again when bringing
     9        back a page from the page cache. As the viewport metadata is only retrieved while parsing
     10        the document, we need to store it in the Document class.
     11
     12        * fast/viewport/viewport-128-expected.txt: Copied from LayoutTests/fast/viewport/viewport-19-expected.txt.
     13        * fast/viewport/viewport-128.html: Added.
     14
    1152010-09-24  Stephen White  <senorblanco@chromium.org>
    216
  • trunk/WebCore/ChangeLog

    r68283 r68292  
     12010-09-24  Luiz Agostini  <luiz.agostini@openbossa.org>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        Keep viewport information in Document
     6        https://bugs.webkit.org/show_bug.cgi?id=46385
     7
     8        The viewport meta data (layout viewport, scale) needs to be set again when bringing
     9        back a page from the page cache. As the viewport metadata is only retrieved while parsing
     10        the document, we need to store it in the Document class.
     11
     12        Test: fast/viewport/viewport-128.html
     13
     14        * WebCore.xcodeproj/project.pbxproj:
     15        * dom/Document.cpp:
     16        (WebCore::Document::processViewport):
     17        (WebCore::Document::setInPageCache):
     18        * dom/Document.h:
     19        (WebCore::Document::viewportArguments):
     20
    1212010-09-24  David Hyatt  <hyatt@apple.com>
    222
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r68180 r68292  
    51735173                CEA3949D11D45CDA003094CF /* StaticHashSetNodeList.h in Headers */ = {isa = PBXBuildFile; fileRef = CEA3949B11D45CDA003094CF /* StaticHashSetNodeList.h */; };
    51745174                CEF418CE1179678C009D112C /* ViewportArguments.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEF418CC1179678C009D112C /* ViewportArguments.cpp */; };
    5175                 CEF418CF1179678C009D112C /* ViewportArguments.h in Headers */ = {isa = PBXBuildFile; fileRef = CEF418CD1179678C009D112C /* ViewportArguments.h */; };
     5175                CEF418CF1179678C009D112C /* ViewportArguments.h in Headers */ = {isa = PBXBuildFile; fileRef = CEF418CD1179678C009D112C /* ViewportArguments.h */; settings = {ATTRIBUTES = (Private, ); }; };
    51765176                D000EBA211BDAFD400C47726 /* FrameLoaderStateMachine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D000EBA011BDAFD400C47726 /* FrameLoaderStateMachine.cpp */; };
    51775177                D000EBA311BDAFD400C47726 /* FrameLoaderStateMachine.h in Headers */ = {isa = PBXBuildFile; fileRef = D000EBA111BDAFD400C47726 /* FrameLoaderStateMachine.h */; settings = {ATTRIBUTES = (Private, ); }; };
  • trunk/WebCore/dom/Document.cpp

    r68240 r68292  
    130130#include "UIEvent.h"
    131131#include "UserContentURLPattern.h"
    132 #include "ViewportArguments.h"
    133132#include "WebKitAnimationEvent.h"
    134133#include "WebKitTransitionEvent.h"
     
    25912590    ASSERT(!features.isNull());
    25922591
     2592    m_viewportArguments = ViewportArguments();
     2593    processArguments(features, (void*)&m_viewportArguments, &setViewportFeature);
     2594
    25932595    Frame* frame = this->frame();
    2594     if (!frame)
    2595         return;
    2596 
    2597     if (frame->page()) {
    2598         ViewportArguments arguments;
    2599         processArguments(features, (void*)&arguments, &setViewportFeature);
    2600 
    2601         frame->page()->chrome()->client()->didReceiveViewportArguments(frame, arguments);
    2602     }
     2596    if (!frame || !frame->page())
     2597        return;
     2598
     2599    frame->page()->chrome()->client()->didReceiveViewportArguments(frame, m_viewportArguments);
    26032600}
    26042601
     
    38163813        setRenderer(m_savedRenderer);
    38173814        m_savedRenderer = 0;
     3815
     3816        if (frame() && frame()->page())
     3817            frame()->page()->chrome()->client()->didReceiveViewportArguments(frame(), m_viewportArguments);
     3818
    38183819        if (childNeedsStyleRecalc())
    38193820            scheduleStyleRecalc();
  • trunk/WebCore/dom/Document.h

    r68198 r68292  
    3737#include "ScriptExecutionContext.h"
    3838#include "Timer.h"
     39#include "ViewportArguments.h"
    3940#include <wtf/FixedArray.h>
    4041#include <wtf/HashCountedSet.h>
     
    277278#endif
    278279
     280    ViewportArguments viewportArguments() const { return m_viewportArguments; }
     281
    279282    DocumentType* doctype() const { return m_docType.get(); }
    280283
     
    13151318
    13161319    int m_loadEventDelayCount;
     1320
     1321    ViewportArguments m_viewportArguments;
    13171322};
    13181323
  • trunk/WebKit/qt/Api/qwebframe.cpp

    r67762 r68292  
    231231}
    232232
     233WebCore::ViewportArguments QWebFramePrivate::viewportArguments()
     234{
     235    if (!frame || !frame->document())
     236        return WebCore::ViewportArguments();
     237
     238    return frame->document()->viewportArguments();
     239}
     240
    233241void QWebFramePrivate::setPage(QWebPage* newPage)
    234242{
  • trunk/WebKit/qt/Api/qwebframe_p.h

    r67376 r68292  
    9191#endif
    9292
     93    WebCore::ViewportArguments viewportArguments();
     94
    9395    QWebFrame *q;
    9496    Qt::ScrollBarPolicy horizontalScrollBarPolicy;
     
    102104    int marginHeight;
    103105    bool zoomTextOnly;
    104     WebCore::ViewportArguments viewportArguments;
    105106};
    106107
  • trunk/WebKit/qt/Api/qwebpage.cpp

    r68056 r68292  
    23492349    int deviceHeight = rect.height();
    23502350
    2351     WebCore::ViewportConfiguration conf = WebCore::findConfigurationForViewportData(mainFrame()->d->viewportArguments, desktopWidth, deviceWidth, deviceHeight, deviceDPI, availableSize);
     2351    WebCore::ViewportConfiguration conf = WebCore::findConfigurationForViewportData(mainFrame()->d->viewportArguments(), desktopWidth, deviceWidth, deviceHeight, deviceDPI, availableSize);
    23522352
    23532353    ViewportConfiguration result;
  • trunk/WebKit/qt/ChangeLog

    r68204 r68292  
     12010-09-24  Luiz Agostini  <luiz.agostini@openbossa.org>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        Keep viewport information in Document
     6        https://bugs.webkit.org/show_bug.cgi?id=46385
     7
     8        The viewport meta data (layout viewport, scale) needs to be set again when bringing
     9        back a page from the page cache. As the viewport metadata is only retrieved while parsing
     10        the document, we need to store it in the Document class.
     11
     12        * Api/qwebframe.cpp:
     13        (QWebFramePrivate::viewportArguments):
     14        * Api/qwebframe_p.h:
     15        * Api/qwebpage.cpp:
     16        (QWebPage::viewportConfigurationForSize):
     17        * WebCoreSupport/ChromeClientQt.cpp:
     18        (WebCore::ChromeClientQt::didReceiveViewportArguments):
     19        * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
     20        (DumpRenderTreeSupportQt::viewportAsText):
     21        * WebCoreSupport/FrameLoaderClientQt.cpp:
     22        (WebCore::FrameLoaderClientQt::dispatchDidCommitLoad):
     23
    1242010-09-23  Ademar de Souza Reis Jr  <ademar.reis@openbossa.org>
    225
  • trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp

    r67612 r68292  
    645645void ChromeClientQt::didReceiveViewportArguments(Frame* frame, const ViewportArguments& arguments) const
    646646{
    647     m_webPage->mainFrame()->d->viewportArguments = arguments;
    648 
    649647    emit m_webPage->viewportChangeRequested();
    650648}
  • trunk/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp

    r67653 r68292  
    632632QString DumpRenderTreeSupportQt::viewportAsText(QWebPage* page, const QSize& availableSize)
    633633{
    634     WebCore::ViewportArguments args = page->mainFrame()->d->viewportArguments;
     634    WebCore::ViewportArguments args = page->mainFrame()->d->viewportArguments();
    635635    WebCore::ViewportConfiguration conf = WebCore::findConfigurationForViewportData(args,
    636636        /* desktop-width */ 980,
  • trunk/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp

    r67612 r68292  
    443443        return;
    444444
    445     // Clear the viewport arguments.
    446     m_webFrame->d->viewportArguments = WebCore::ViewportArguments();
    447 
    448445    emit m_webFrame->urlChanged(m_webFrame->url());
    449446    m_webFrame->page()->d->updateNavigationActions();
Note: See TracChangeset for help on using the changeset viewer.