Changeset 93669 in webkit
- Timestamp:
- Aug 23, 2011 5:29:27 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r93657 r93669 1 2011-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 1 47 2011-08-23 Anders Carlsson <andersca@apple.com> 2 48 -
trunk/Source/WebCore/history/BackForwardController.cpp
r70960 r93669 105 105 } 106 106 107 void 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 107 118 } // namespace WebCore -
trunk/Source/WebCore/history/BackForwardController.h
r76248 r93669 68 68 HistoryItem* forwardItem() { return itemAtIndex(1); } 69 69 70 void markPagesForFullStyleRecalc(); 71 70 72 private: 71 73 Page* m_page; -
trunk/Source/WebCore/history/CachedPage.cpp
r86325 r93669 55 55 , m_cachedMainFrame(CachedFrame::create(page->mainFrame())) 56 56 , m_needStyleRecalcForVisitedLinks(false) 57 , m_needsFullStyleRecalc(false) 57 58 { 58 59 #ifndef NDEBUG … … 94 95 } 95 96 97 if (m_needsFullStyleRecalc) 98 page->setNeedsRecalcStyleInAllFrames(); 99 96 100 clear(); 97 101 } … … 103 107 m_cachedMainFrame = 0; 104 108 m_needStyleRecalcForVisitedLinks = false; 109 m_needsFullStyleRecalc = false; 105 110 } 106 111 -
trunk/Source/WebCore/history/CachedPage.h
r84091 r93669 52 52 53 53 void markForVistedLinkStyleRecalc() { m_needStyleRecalcForVisitedLinks = true; } 54 void markForFullStyleRecalc() { m_needsFullStyleRecalc = true; } 54 55 55 56 private: … … 59 60 RefPtr<CachedFrame> m_cachedMainFrame; 60 61 bool m_needStyleRecalcForVisitedLinks; 62 bool m_needsFullStyleRecalc; 61 63 }; 62 64 -
trunk/Source/WebCore/history/HistoryItem.cpp
r93573 r93669 846 846 } 847 847 848 void HistoryItem::markForFullStyleRecalc() 849 { 850 // Children are guaranteed not to have CachedPages. 851 if (m_cachedPage) 852 m_cachedPage->markForFullStyleRecalc(); 853 } 854 848 855 #ifndef NDEBUG 849 856 -
trunk/Source/WebCore/history/HistoryItem.h
r93573 r93669 208 208 const Vector<int>& weeklyVisitCounts() const { return m_weeklyVisitCounts; } 209 209 210 void markForFullStyleRecalc(); 211 210 212 private: 211 213 HistoryItem(); -
trunk/Source/WebCore/page/Frame.cpp
r93567 r93669 31 31 32 32 #include "ApplyStyleCommand.h" 33 #include "BackForwardController.h" 33 34 #include "CSSComputedStyleDeclaration.h" 34 35 #include "CSSMutableStyleDeclaration.h" … … 1070 1071 view->layout(); 1071 1072 } 1073 1074 if (page->mainFrame() == this) 1075 page->backForward()->markPagesForFullStyleRecalc(); 1072 1076 } 1073 1077 -
trunk/Source/WebCore/page/Page.cpp
r93303 r93669 597 597 m_mainFrame->deviceOrPageScaleFactorChanged(); 598 598 #endif 599 600 backForward()->markPagesForFullStyleRecalc(); 599 601 } 600 602
Note: See TracChangeset
for help on using the changeset viewer.