Changeset 196633 in webkit
- Timestamp:
- Feb 16, 2016 2:00:15 AM (8 years ago)
- Location:
- trunk/Source
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r196632 r196633 1 2016-02-16 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::setInPageCache): 20 * history/CachedPage.cpp: 21 (WebCore::CachedPage::restore): 22 (WebCore::CachedPage::clear): Deleted. 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): Deleted. 32 * page/Page.cpp: 33 (WebCore::Page::setViewScaleFactor): Deleted. 34 (WebCore::Page::setDeviceScaleFactor): Deleted. 35 (WebCore::Page::setPagination): Deleted. 36 (WebCore::Page::setPaginationLineGridEnabled): Deleted. 37 (WebCore::Page::setVisitedLinkStore): Deleted. 38 1 39 2016-02-16 Carlos Garcia Campos <cgarcia@igalia.com> 2 40 -
trunk/Source/WebCore/dom/Document.cpp
r196622 r196633 4600 4600 } 4601 4601 m_styleRecalcTimer.stop(); 4602 4603 clearStyleResolver(); 4604 clearSelectorQueryCache(); 4602 4605 } else { 4603 4606 if (childNeedsStyleRecalc()) -
trunk/Source/WebCore/history/CachedPage.cpp
r191451 r196633 75 75 ASSERT(!page.subframeCount()); 76 76 77 page.setNeedsRecalcStyleInAllFrames(); 78 77 79 m_cachedMainFrame->open(); 78 80 … … 101 103 } 102 104 103 if (m_needStyleRecalcForVisitedLinks) {104 for (Frame* frame = &page.mainFrame(); frame; frame = frame->tree().traverseNext())105 frame->document()->visitedLinkState().invalidateStyleForAllLinks();106 }107 108 105 if (m_needsDeviceOrPageScaleChanged) 109 106 page.mainFrame().deviceOrPageScaleFactorChanged(); 110 111 if (m_needsFullStyleRecalc)112 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
r187587 r196633 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
r195605 r196633 312 312 } 313 313 314 void PageCache::markPagesForVisitedLinkStyleRecalc()315 {316 for (auto& item : m_items) {317 ASSERT(item->m_cachedPage);318 item->m_cachedPage->markForVisitedLinkStyleRecalc();319 }320 }321 322 void PageCache::markPagesForFullStyleRecalc(Page& page)323 {324 for (auto& item : m_items) {325 CachedPage& cachedPage = *item->m_cachedPage;326 if (&page.mainFrame() == &cachedPage.cachedMainFrame()->view()->frame())327 cachedPage.markForFullStyleRecalc();328 }329 }330 331 314 void PageCache::markPagesForDeviceOrPageScaleChanged(Page& page) 332 315 { -
trunk/Source/WebCore/history/PageCache.h
r195605 r196633 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
r194819 r196633 978 978 view->layout(); 979 979 } 980 981 if (isMainFrame())982 PageCache::singleton().markPagesForFullStyleRecalc(*page);983 980 } 984 981 -
trunk/Source/WebCore/page/Page.cpp
r196024 r196633 846 846 m_viewScaleFactor = scale; 847 847 PageCache::singleton().markPagesForDeviceOrPageScaleChanged(*this); 848 PageCache::singleton().markPagesForFullStyleRecalc(*this);849 848 } 850 849 … … 864 863 PageCache::singleton().markPagesForDeviceOrPageScaleChanged(*this); 865 864 866 PageCache::singleton().markPagesForFullStyleRecalc(*this);867 865 GraphicsContext::updateDocumentMarkerResources(); 868 866 … … 942 940 943 941 setNeedsRecalcStyleInAllFrames(); 944 PageCache::singleton().markPagesForFullStyleRecalc(*this);945 942 } 946 943 … … 953 950 954 951 setNeedsRecalcStyleInAllFrames(); 955 PageCache::singleton().markPagesForFullStyleRecalc(*this);956 952 } 957 953 … … 1732 1728 1733 1729 invalidateStylesForAllLinks(); 1734 PageCache::singleton().markPagesForFullStyleRecalc(*this);1735 1730 } 1736 1731 -
trunk/Source/WebKit/mac/WebCoreSupport/WebVisitedLinkStore.mm
r179409 r196633 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/ChangeLog
r196569 r196633 1 2016-02-16 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 * WebCoreSupport/WebVisitedLinkStore.cpp: 9 (WebVisitedLinkStore::removeAllVisitedLinks): Deleted. 10 (WebVisitedLinkStore::addVisitedLinkHash): Deleted. 11 1 12 2016-02-14 Chris Dumez <cdumez@apple.com> 2 13 -
trunk/Source/WebKit/win/WebCoreSupport/WebVisitedLinkStore.cpp
r185999 r196633 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
r188895 r196633 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.