Changeset 207620 in webkit
- Timestamp:
- Oct 20, 2016 9:38:50 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r207588 r207620 1 2016-10-20 Andreas Kling <akling@apple.com> 2 3 Drop StyleResolver and SelectorQueryCache when entering PageCache. 4 <https://webkit.org/b/154238> 5 6 Reviewed by Antti Koivisto. 7 8 Progression in compositing/iframes/page-cache-layer-tree.html, when navigating back, 9 the two iframes' dimensions correctly exclude the horizontal scrollbar's height since 10 it's not present after a style recalc. 11 12 * compositing/iframes/page-cache-layer-tree-expected.txt: 13 1 14 2016-10-20 Nael Ouedraogo <nael.ouedraogo@crf.canon.fr> 2 15 -
trunk/LayoutTests/compositing/iframes/page-cache-layer-tree-expected.txt
r192270 r207620 24 24 (GraphicsLayer 25 25 (anchor 0.00 0.00) 26 (bounds 285.00 1 35.00)26 (bounds 285.00 150.00) 27 27 (children 1 28 28 (GraphicsLayer … … 74 74 (GraphicsLayer 75 75 (anchor 0.00 0.00) 76 (bounds 285.00 1 35.00)76 (bounds 285.00 150.00) 77 77 (children 1 78 78 (GraphicsLayer -
trunk/Source/WebCore/ChangeLog
r207619 r207620 1 2016-10-20 Andreas Kling <akling@apple.com> 2 3 Drop StyleResolver and SelectorQueryCache when entering PageCache. 4 <https://webkit.org/b/154238> 5 6 Reviewed by Antti Koivisto. 7 8 Stop keeping these around for cached pages to save lots of memory. 9 We can easily rebuild them if a cached navigation occurs, and this 10 way we also don't need to worry about invalidating style for cached 11 pages in all the right places. 12 13 Restoring a cached page will now lead to a forced style recalc. 14 We don't try to defer this (beyond a zero-timer) since it's going 15 to happen anyway, and it's nicer to front-load the cost rather than 16 stuttering on the first user content interaction. 17 18 * dom/Document.cpp: 19 (WebCore::Document::setPageCacheState): 20 * history/CachedPage.cpp: 21 (WebCore::CachedPage::restore): 22 (WebCore::CachedPage::clear): 23 * history/CachedPage.h: 24 (WebCore::CachedPage::markForVisitedLinkStyleRecalc): Deleted. 25 (WebCore::CachedPage::markForFullStyleRecalc): Deleted. 26 * history/PageCache.cpp: 27 (WebCore::PageCache::markPagesForVisitedLinkStyleRecalc): Deleted. 28 (WebCore::PageCache::markPagesForFullStyleRecalc): Deleted. 29 * history/PageCache.h: 30 * page/Frame.cpp: 31 (WebCore::Frame::setPageAndTextZoomFactors): 32 * page/Page.cpp: 33 (WebCore::Page::setViewScaleFactor): 34 (WebCore::Page::setDeviceScaleFactor): 35 (WebCore::Page::setPagination): 36 (WebCore::Page::setPaginationLineGridEnabled): 37 (WebCore::Page::setVisitedLinkStore): 38 1 39 2016-10-20 Carlos Alberto Lopez Perez <clopez@igalia.com> 2 40 -
trunk/Source/WebCore/dom/Document.cpp
r207541 r207620 4600 4600 v->resetScrollbars(); 4601 4601 } 4602 4603 styleScope().clearResolver(); 4604 clearSelectorQueryCache(); 4602 4605 m_styleRecalcTimer.stop(); 4603 4606 -
trunk/Source/WebCore/history/CachedPage.cpp
r202160 r207620 101 101 } 102 102 103 if (m_needStyleRecalcForVisitedLinks) {104 for (Frame* frame = &page.mainFrame(); frame; frame = frame->tree().traverseNext())105 frame->document()->visitedLinkState().invalidateStyleForAllLinks();106 }107 108 103 if (m_needsDeviceOrPageScaleChanged) 109 104 page.mainFrame().deviceOrPageScaleFactorChanged(); 110 105 111 if (m_needsFullStyleRecalc) 112 page.setNeedsRecalcStyleInAllFrames(); 106 page.setNeedsRecalcStyleInAllFrames(); 113 107 114 108 #if ENABLE(VIDEO_TRACK) … … 130 124 m_cachedMainFrame->clear(); 131 125 m_cachedMainFrame = nullptr; 132 m_needStyleRecalcForVisitedLinks = false;133 m_needsFullStyleRecalc = false;134 126 #if ENABLE(VIDEO_TRACK) 135 127 m_needsCaptionPreferencesChanged = false; -
trunk/Source/WebCore/history/CachedPage.h
r201655 r207620 51 51 CachedFrame* cachedMainFrame() { return m_cachedMainFrame.get(); } 52 52 53 void markForVisitedLinkStyleRecalc() { m_needStyleRecalcForVisitedLinks = true; }54 void markForFullStyleRecalc() { m_needsFullStyleRecalc = true; }55 53 #if ENABLE(VIDEO_TRACK) 56 54 void markForCaptionPreferencesChanged() { m_needsCaptionPreferencesChanged = true; } … … 64 62 double m_expirationTime; 65 63 std::unique_ptr<CachedFrame> m_cachedMainFrame; 66 bool m_needStyleRecalcForVisitedLinks { false };67 bool m_needsFullStyleRecalc { false };68 64 #if ENABLE(VIDEO_TRACK) 69 65 bool m_needsCaptionPreferencesChanged { false }; -
trunk/Source/WebCore/history/PageCache.cpp
r205786 r207620 313 313 } 314 314 315 void PageCache::markPagesForVisitedLinkStyleRecalc()316 {317 for (auto& item : m_items) {318 ASSERT(item->m_cachedPage);319 item->m_cachedPage->markForVisitedLinkStyleRecalc();320 }321 }322 323 void PageCache::markPagesForFullStyleRecalc(Page& page)324 {325 for (auto& item : m_items) {326 CachedPage& cachedPage = *item->m_cachedPage;327 if (&page.mainFrame() == &cachedPage.cachedMainFrame()->view()->frame())328 cachedPage.markForFullStyleRecalc();329 }330 }331 332 315 void PageCache::markPagesForDeviceOrPageScaleChanged(Page& page) 333 316 { -
trunk/Source/WebCore/history/PageCache.h
r201655 r207620 62 62 WEBCORE_EXPORT unsigned frameCount() const; 63 63 64 WEBCORE_EXPORT void markPagesForVisitedLinkStyleRecalc();65 // Will mark all cached pages associated with the given page as needing style recalc.66 void markPagesForFullStyleRecalc(Page&);67 64 void markPagesForDeviceOrPageScaleChanged(Page&); 68 65 void markPagesForContentsSizeChanged(Page&); -
trunk/Source/WebCore/page/Frame.cpp
r206917 r207620 964 964 view->layout(); 965 965 } 966 967 if (isMainFrame())968 PageCache::singleton().markPagesForFullStyleRecalc(*page);969 966 } 970 967 -
trunk/Source/WebCore/page/Page.cpp
r207345 r207620 879 879 m_viewScaleFactor = scale; 880 880 PageCache::singleton().markPagesForDeviceOrPageScaleChanged(*this); 881 PageCache::singleton().markPagesForFullStyleRecalc(*this);882 881 } 883 882 … … 897 896 PageCache::singleton().markPagesForDeviceOrPageScaleChanged(*this); 898 897 899 PageCache::singleton().markPagesForFullStyleRecalc(*this);900 898 GraphicsContext::updateDocumentMarkerResources(); 901 899 … … 990 988 991 989 setNeedsRecalcStyleInAllFrames(); 992 PageCache::singleton().markPagesForFullStyleRecalc(*this);993 990 } 994 991 … … 1001 998 1002 999 setNeedsRecalcStyleInAllFrames(); 1003 PageCache::singleton().markPagesForFullStyleRecalc(*this);1004 1000 } 1005 1001 … … 1900 1896 1901 1897 invalidateStylesForAllLinks(); 1902 PageCache::singleton().markPagesForFullStyleRecalc(*this);1903 1898 } 1904 1899 -
trunk/Source/WebKit/mac/WebCoreSupport/WebVisitedLinkStore.mm
r201655 r207620 75 75 for (auto& visitedLinkStore : visitedLinkStores()) 76 76 visitedLinkStore->removeVisitedLinkHashes(); 77 PageCache::singleton().markPagesForVisitedLinkStyleRecalc();78 77 } 79 78 … … 104 103 105 104 invalidateStylesForLink(linkHash); 106 PageCache::singleton().markPagesForVisitedLinkStyleRecalc();107 105 } 108 106 … … 153 151 154 152 invalidateStylesForLink(linkHash); 155 PageCache::singleton().markPagesForVisitedLinkStyleRecalc();156 153 } 157 154 -
trunk/Source/WebKit/win/WebCoreSupport/WebVisitedLinkStore.cpp
r201655 r207620 72 72 for (auto& visitedLinkStore : visitedLinkStores()) 73 73 visitedLinkStore->removeVisitedLinkHashes(); 74 PageCache::singleton().markPagesForVisitedLinkStyleRecalc();75 74 } 76 75 … … 125 124 126 125 invalidateStylesForLink(linkHash); 127 PageCache::singleton().markPagesForVisitedLinkStyleRecalc();128 126 } 129 127 -
trunk/Source/WebKit2/WebProcess/WebPage/VisitedLinkTableController.cpp
r202242 r207620 98 98 99 99 invalidateStylesForAllLinks(); 100 PageCache::singleton().markPagesForVisitedLinkStyleRecalc();101 100 } 102 101 … … 105 104 for (auto linkHash : linkHashes) 106 105 invalidateStylesForLink(linkHash); 107 PageCache::singleton().markPagesForVisitedLinkStyleRecalc();108 106 } 109 107 … … 111 109 { 112 110 invalidateStylesForAllLinks(); 113 PageCache::singleton().markPagesForVisitedLinkStyleRecalc();114 111 } 115 112 … … 119 116 120 117 invalidateStylesForAllLinks(); 121 PageCache::singleton().markPagesForVisitedLinkStyleRecalc();122 118 } 123 119
Note: See TracChangeset
for help on using the changeset viewer.