Changeset 93669 in webkit


Ignore:
Timestamp:
Aug 23, 2011 5:29:27 PM (13 years ago)
Author:
Beth Dakin
Message:

https://bugs.webkit.org/show_bug.cgi?id=66244
Cached pages don't fully update when going back after changing the display scale
factor
-and corresponding-
<rdar://problem/9955656>

Reviewed by Darin Adler.

This patch adds a generalized concept of needing a full style recalc to the
BackForwardController. So when the display scale factor is changed, the
BackForwardController can be informed that all pages will need a full style recalc
when they come out of the cache. This same mechanism is also used to fix a long-
standing bug with full-page/text zoom.

Iterate through the HistoryItems and mark all CachedPages as needing a full style
recalc.

  • history/BackForwardController.cpp:

(WebCore::BackForwardController::markPagesForFullStyleRecalc):

  • history/BackForwardController.h:

ChachedPage has a new bool -- m_needsFullStyleRecalc -- to track whether a full
style recalc is needed when the CachedPage is restored.

  • history/CachedPage.cpp:

(WebCore::CachedPage::CachedPage):
(WebCore::CachedPage::restore):
(WebCore::CachedPage::clear):

  • history/CachedPage.h:

(WebCore::CachedPage::markForFullStyleRecalc):

HistoryItem actually takes care of calling into CachedPage.

  • history/HistoryItem.cpp:

(WebCore::HistoryItem::markForFullStyleRecalc):

  • history/HistoryItem.h:

Fix style recalc issues for full-page/text zoom by calling our new function on
PageCache.

  • page/Frame.cpp:

(WebCore::Frame::setPageAndTextZoomFactors):

Fix style recalc issues for display scale factor changes by calling our new
function on PageCache.

  • page/Page.cpp:

(WebCore::Page::setDeviceScaleFactor):

Location:
trunk/Source/WebCore
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r93657 r93669  
     12011-08-23  Beth Dakin  <bdakin@apple.com>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=66244
     4        Cached pages don't fully update when going back after changing the display scale
     5        factor
     6        -and corresponding-
     7        <rdar://problem/9955656>
     8
     9        Reviewed by Darin Adler.
     10
     11        This patch adds a generalized concept of needing a full style recalc to the
     12        BackForwardController. So when the display scale factor is changed, the
     13        BackForwardController can be informed that all pages will need a full style recalc
     14        when they come out of the cache. This same mechanism is also used to fix a long-
     15        standing bug with full-page/text zoom.
     16
     17        Iterate through the HistoryItems and mark all CachedPages as needing a full style
     18        recalc.
     19        * history/BackForwardController.cpp:
     20        (WebCore::BackForwardController::markPagesForFullStyleRecalc):
     21        * history/BackForwardController.h:
     22
     23        ChachedPage has a new bool -- m_needsFullStyleRecalc -- to track whether a full
     24        style recalc is needed when the CachedPage is restored.
     25        * history/CachedPage.cpp:
     26        (WebCore::CachedPage::CachedPage):
     27        (WebCore::CachedPage::restore):
     28        (WebCore::CachedPage::clear):
     29        * history/CachedPage.h:
     30        (WebCore::CachedPage::markForFullStyleRecalc):
     31
     32        HistoryItem actually takes care of calling into CachedPage.
     33        * history/HistoryItem.cpp:
     34        (WebCore::HistoryItem::markForFullStyleRecalc):
     35        * history/HistoryItem.h:
     36
     37        Fix style recalc issues for full-page/text zoom by calling our new function on
     38        PageCache.
     39        * page/Frame.cpp:
     40        (WebCore::Frame::setPageAndTextZoomFactors):
     41
     42        Fix style recalc issues for display scale factor changes by calling our new
     43        function on PageCache.
     44        * page/Page.cpp:
     45        (WebCore::Page::setDeviceScaleFactor):
     46
    1472011-08-23  Anders Carlsson  <andersca@apple.com>
    248
  • trunk/Source/WebCore/history/BackForwardController.cpp

    r70960 r93669  
    105105}
    106106
     107void BackForwardController::markPagesForFullStyleRecalc()
     108{
     109    int first = -backCount();
     110    int last = forwardCount();
     111    for (int i = first; i <= last; i++) {
     112        if (!i)
     113            continue;
     114        itemAtIndex(i)->markForFullStyleRecalc();
     115    }
     116}
     117
    107118} // namespace WebCore
  • trunk/Source/WebCore/history/BackForwardController.h

    r76248 r93669  
    6868    HistoryItem* forwardItem() { return itemAtIndex(1); }
    6969
     70    void markPagesForFullStyleRecalc();
     71
    7072private:
    7173    Page* m_page;
  • trunk/Source/WebCore/history/CachedPage.cpp

    r86325 r93669  
    5555    , m_cachedMainFrame(CachedFrame::create(page->mainFrame()))
    5656    , m_needStyleRecalcForVisitedLinks(false)
     57    , m_needsFullStyleRecalc(false)
    5758{
    5859#ifndef NDEBUG
     
    9495    }
    9596
     97    if (m_needsFullStyleRecalc)
     98        page->setNeedsRecalcStyleInAllFrames();
     99
    96100    clear();
    97101}
     
    103107    m_cachedMainFrame = 0;
    104108    m_needStyleRecalcForVisitedLinks = false;
     109    m_needsFullStyleRecalc = false;
    105110}
    106111
  • trunk/Source/WebCore/history/CachedPage.h

    r84091 r93669  
    5252
    5353    void markForVistedLinkStyleRecalc() { m_needStyleRecalcForVisitedLinks = true; }
     54    void markForFullStyleRecalc() { m_needsFullStyleRecalc = true; }
    5455
    5556private:
     
    5960    RefPtr<CachedFrame> m_cachedMainFrame;
    6061    bool m_needStyleRecalcForVisitedLinks;
     62    bool m_needsFullStyleRecalc;
    6163};
    6264
  • trunk/Source/WebCore/history/HistoryItem.cpp

    r93573 r93669  
    846846}
    847847
     848void HistoryItem::markForFullStyleRecalc()
     849{
     850    // Children are guaranteed not to have CachedPages.
     851    if (m_cachedPage)
     852        m_cachedPage->markForFullStyleRecalc();
     853}
     854
    848855#ifndef NDEBUG
    849856
  • trunk/Source/WebCore/history/HistoryItem.h

    r93573 r93669  
    208208    const Vector<int>& weeklyVisitCounts() const { return m_weeklyVisitCounts; }
    209209
     210    void markForFullStyleRecalc();
     211
    210212private:
    211213    HistoryItem();
  • trunk/Source/WebCore/page/Frame.cpp

    r93567 r93669  
    3131
    3232#include "ApplyStyleCommand.h"
     33#include "BackForwardController.h"
    3334#include "CSSComputedStyleDeclaration.h"
    3435#include "CSSMutableStyleDeclaration.h"
     
    10701071            view->layout();
    10711072    }
     1073
     1074    if (page->mainFrame() == this)
     1075        page->backForward()->markPagesForFullStyleRecalc();
    10721076}
    10731077
  • trunk/Source/WebCore/page/Page.cpp

    r93303 r93669  
    597597    m_mainFrame->deviceOrPageScaleFactorChanged();
    598598#endif
     599
     600    backForward()->markPagesForFullStyleRecalc();
    599601}
    600602
Note: See TracChangeset for help on using the changeset viewer.