Diff
Modified: trunk/Source/WebCore/ChangeLog (196632 => 196633)
--- trunk/Source/WebCore/ChangeLog 2016-02-16 09:50:26 UTC (rev 196632)
+++ trunk/Source/WebCore/ChangeLog 2016-02-16 10:00:15 UTC (rev 196633)
@@ -1,3 +1,41 @@
+2016-02-16 Andreas Kling <[email protected]>
+
+ Drop StyleResolver and SelectorQueryCache when entering PageCache.
+ <https://webkit.org/b/154238>
+
+ Reviewed by Antti Koivisto.
+
+ Stop keeping these around for cached pages to save lots of memory.
+ We can easily rebuild them if a cached navigation occurs, and this
+ way we also don't need to worry about invalidating style for cached
+ pages in all the right places.
+
+ Restoring a cached page will now lead to a forced style recalc.
+ We don't try to defer this (beyond a zero-timer) since it's going
+ to happen anyway, and it's nicer to front-load the cost rather than
+ stuttering on the first user content interaction.
+
+ * dom/Document.cpp:
+ (WebCore::Document::setInPageCache):
+ * history/CachedPage.cpp:
+ (WebCore::CachedPage::restore):
+ (WebCore::CachedPage::clear): Deleted.
+ * history/CachedPage.h:
+ (WebCore::CachedPage::markForVisitedLinkStyleRecalc): Deleted.
+ (WebCore::CachedPage::markForFullStyleRecalc): Deleted.
+ * history/PageCache.cpp:
+ (WebCore::PageCache::markPagesForVisitedLinkStyleRecalc): Deleted.
+ (WebCore::PageCache::markPagesForFullStyleRecalc): Deleted.
+ * history/PageCache.h:
+ * page/Frame.cpp:
+ (WebCore::Frame::setPageAndTextZoomFactors): Deleted.
+ * page/Page.cpp:
+ (WebCore::Page::setViewScaleFactor): Deleted.
+ (WebCore::Page::setDeviceScaleFactor): Deleted.
+ (WebCore::Page::setPagination): Deleted.
+ (WebCore::Page::setPaginationLineGridEnabled): Deleted.
+ (WebCore::Page::setVisitedLinkStore): Deleted.
+
2016-02-16 Carlos Garcia Campos <[email protected]>
[GTK] clicking on the scrollbar trough steps rather than jumps to the clicked position
Modified: trunk/Source/WebCore/dom/Document.cpp (196632 => 196633)
--- trunk/Source/WebCore/dom/Document.cpp 2016-02-16 09:50:26 UTC (rev 196632)
+++ trunk/Source/WebCore/dom/Document.cpp 2016-02-16 10:00:15 UTC (rev 196633)
@@ -4599,6 +4599,9 @@
v->resetScrollbars();
}
m_styleRecalcTimer.stop();
+
+ clearStyleResolver();
+ clearSelectorQueryCache();
} else {
if (childNeedsStyleRecalc())
scheduleStyleRecalc();
Modified: trunk/Source/WebCore/history/CachedPage.cpp (196632 => 196633)
--- trunk/Source/WebCore/history/CachedPage.cpp 2016-02-16 09:50:26 UTC (rev 196632)
+++ trunk/Source/WebCore/history/CachedPage.cpp 2016-02-16 10:00:15 UTC (rev 196633)
@@ -74,6 +74,8 @@
ASSERT(m_cachedMainFrame->view()->frame().isMainFrame());
ASSERT(!page.subframeCount());
+ page.setNeedsRecalcStyleInAllFrames();
+
m_cachedMainFrame->open();
// Restore the focus appearance for the focused element.
@@ -100,17 +102,9 @@
#endif
}
- if (m_needStyleRecalcForVisitedLinks) {
- for (Frame* frame = &page.mainFrame(); frame; frame = frame->tree().traverseNext())
- frame->document()->visitedLinkState().invalidateStyleForAllLinks();
- }
-
if (m_needsDeviceOrPageScaleChanged)
page.mainFrame().deviceOrPageScaleFactorChanged();
- if (m_needsFullStyleRecalc)
- page.setNeedsRecalcStyleInAllFrames();
-
#if ENABLE(VIDEO_TRACK)
if (m_needsCaptionPreferencesChanged)
page.captionPreferencesChanged();
@@ -129,8 +123,6 @@
ASSERT(m_cachedMainFrame);
m_cachedMainFrame->clear();
m_cachedMainFrame = nullptr;
- m_needStyleRecalcForVisitedLinks = false;
- m_needsFullStyleRecalc = false;
#if ENABLE(VIDEO_TRACK)
m_needsCaptionPreferencesChanged = false;
#endif
Modified: trunk/Source/WebCore/history/CachedPage.h (196632 => 196633)
--- trunk/Source/WebCore/history/CachedPage.h 2016-02-16 09:50:26 UTC (rev 196632)
+++ trunk/Source/WebCore/history/CachedPage.h 2016-02-16 10:00:15 UTC (rev 196633)
@@ -50,8 +50,6 @@
CachedFrame* cachedMainFrame() { return m_cachedMainFrame.get(); }
- void markForVisitedLinkStyleRecalc() { m_needStyleRecalcForVisitedLinks = true; }
- void markForFullStyleRecalc() { m_needsFullStyleRecalc = true; }
#if ENABLE(VIDEO_TRACK)
void markForCaptionPreferencesChanged() { m_needsCaptionPreferencesChanged = true; }
#endif
@@ -63,8 +61,6 @@
private:
double m_expirationTime;
std::unique_ptr<CachedFrame> m_cachedMainFrame;
- bool m_needStyleRecalcForVisitedLinks { false };
- bool m_needsFullStyleRecalc { false };
#if ENABLE(VIDEO_TRACK)
bool m_needsCaptionPreferencesChanged { false };
#endif
Modified: trunk/Source/WebCore/history/PageCache.cpp (196632 => 196633)
--- trunk/Source/WebCore/history/PageCache.cpp 2016-02-16 09:50:26 UTC (rev 196632)
+++ trunk/Source/WebCore/history/PageCache.cpp 2016-02-16 10:00:15 UTC (rev 196633)
@@ -311,23 +311,6 @@
return frameCount;
}
-void PageCache::markPagesForVisitedLinkStyleRecalc()
-{
- for (auto& item : m_items) {
- ASSERT(item->m_cachedPage);
- item->m_cachedPage->markForVisitedLinkStyleRecalc();
- }
-}
-
-void PageCache::markPagesForFullStyleRecalc(Page& page)
-{
- for (auto& item : m_items) {
- CachedPage& cachedPage = *item->m_cachedPage;
- if (&page.mainFrame() == &cachedPage.cachedMainFrame()->view()->frame())
- cachedPage.markForFullStyleRecalc();
- }
-}
-
void PageCache::markPagesForDeviceOrPageScaleChanged(Page& page)
{
for (auto& item : m_items) {
Modified: trunk/Source/WebCore/history/PageCache.h (196632 => 196633)
--- trunk/Source/WebCore/history/PageCache.h 2016-02-16 09:50:26 UTC (rev 196632)
+++ trunk/Source/WebCore/history/PageCache.h 2016-02-16 10:00:15 UTC (rev 196633)
@@ -61,9 +61,6 @@
unsigned pageCount() const { return m_items.size(); }
WEBCORE_EXPORT unsigned frameCount() const;
- WEBCORE_EXPORT void markPagesForVisitedLinkStyleRecalc();
- // Will mark all cached pages associated with the given page as needing style recalc.
- void markPagesForFullStyleRecalc(Page&);
void markPagesForDeviceOrPageScaleChanged(Page&);
void markPagesForContentsSizeChanged(Page&);
#if ENABLE(VIDEO_TRACK)
Modified: trunk/Source/WebCore/page/Frame.cpp (196632 => 196633)
--- trunk/Source/WebCore/page/Frame.cpp 2016-02-16 09:50:26 UTC (rev 196632)
+++ trunk/Source/WebCore/page/Frame.cpp 2016-02-16 10:00:15 UTC (rev 196633)
@@ -977,9 +977,6 @@
if (document->renderView() && document->renderView()->needsLayout() && view->didFirstLayout())
view->layout();
}
-
- if (isMainFrame())
- PageCache::singleton().markPagesForFullStyleRecalc(*page);
}
float Frame::frameScaleFactor() const
Modified: trunk/Source/WebCore/page/Page.cpp (196632 => 196633)
--- trunk/Source/WebCore/page/Page.cpp 2016-02-16 09:50:26 UTC (rev 196632)
+++ trunk/Source/WebCore/page/Page.cpp 2016-02-16 10:00:15 UTC (rev 196633)
@@ -845,7 +845,6 @@
m_viewScaleFactor = scale;
PageCache::singleton().markPagesForDeviceOrPageScaleChanged(*this);
- PageCache::singleton().markPagesForFullStyleRecalc(*this);
}
void Page::setDeviceScaleFactor(float scaleFactor)
@@ -863,7 +862,6 @@
mainFrame().deviceOrPageScaleFactorChanged();
PageCache::singleton().markPagesForDeviceOrPageScaleChanged(*this);
- PageCache::singleton().markPagesForFullStyleRecalc(*this);
GraphicsContext::updateDocumentMarkerResources();
mainFrame().pageOverlayController().didChangeDeviceScaleFactor();
@@ -941,7 +939,6 @@
m_pagination = pagination;
setNeedsRecalcStyleInAllFrames();
- PageCache::singleton().markPagesForFullStyleRecalc(*this);
}
void Page::setPaginationLineGridEnabled(bool enabled)
@@ -952,7 +949,6 @@
m_paginationLineGridEnabled = enabled;
setNeedsRecalcStyleInAllFrames();
- PageCache::singleton().markPagesForFullStyleRecalc(*this);
}
unsigned Page::pageCount() const
@@ -1731,7 +1727,6 @@
m_visitedLinkStore->addPage(*this);
invalidateStylesForAllLinks();
- PageCache::singleton().markPagesForFullStyleRecalc(*this);
}
SessionID Page::sessionID() const
Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebVisitedLinkStore.mm (196632 => 196633)
--- trunk/Source/WebKit/mac/WebCoreSupport/WebVisitedLinkStore.mm 2016-02-16 09:50:26 UTC (rev 196632)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebVisitedLinkStore.mm 2016-02-16 10:00:15 UTC (rev 196633)
@@ -74,7 +74,6 @@
{
for (auto& visitedLinkStore : visitedLinkStores())
visitedLinkStore->removeVisitedLinkHashes();
- PageCache::singleton().markPagesForVisitedLinkStyleRecalc();
}
void WebVisitedLinkStore::addVisitedLink(NSString *urlString)
@@ -103,7 +102,6 @@
m_visitedLinkHashes.remove(linkHash);
invalidateStylesForLink(linkHash);
- PageCache::singleton().markPagesForVisitedLinkStyleRecalc();
}
bool WebVisitedLinkStore::isLinkVisited(Page& page, LinkHash linkHash, const URL& baseURL, const AtomicString& attributeURL)
@@ -152,7 +150,6 @@
m_visitedLinkHashes.add(linkHash);
invalidateStylesForLink(linkHash);
- PageCache::singleton().markPagesForVisitedLinkStyleRecalc();
}
void WebVisitedLinkStore::removeVisitedLinkHashes()
Modified: trunk/Source/WebKit/win/ChangeLog (196632 => 196633)
--- trunk/Source/WebKit/win/ChangeLog 2016-02-16 09:50:26 UTC (rev 196632)
+++ trunk/Source/WebKit/win/ChangeLog 2016-02-16 10:00:15 UTC (rev 196633)
@@ -1,3 +1,14 @@
+2016-02-16 Andreas Kling <[email protected]>
+
+ Drop StyleResolver and SelectorQueryCache when entering PageCache.
+ <https://webkit.org/b/154238>
+
+ Reviewed by Antti Koivisto.
+
+ * WebCoreSupport/WebVisitedLinkStore.cpp:
+ (WebVisitedLinkStore::removeAllVisitedLinks): Deleted.
+ (WebVisitedLinkStore::addVisitedLinkHash): Deleted.
+
2016-02-14 Chris Dumez <[email protected]>
Unreviewed Window build fix.
Modified: trunk/Source/WebKit/win/WebCoreSupport/WebVisitedLinkStore.cpp (196632 => 196633)
--- trunk/Source/WebKit/win/WebCoreSupport/WebVisitedLinkStore.cpp 2016-02-16 09:50:26 UTC (rev 196632)
+++ trunk/Source/WebKit/win/WebCoreSupport/WebVisitedLinkStore.cpp 2016-02-16 10:00:15 UTC (rev 196633)
@@ -71,7 +71,6 @@
{
for (auto& visitedLinkStore : visitedLinkStores())
visitedLinkStore->removeVisitedLinkHashes();
- PageCache::singleton().markPagesForVisitedLinkStyleRecalc();
}
void WebVisitedLinkStore::addVisitedLink(const String& urlString)
@@ -124,7 +123,6 @@
m_visitedLinkHashes.add(linkHash);
invalidateStylesForLink(linkHash);
- PageCache::singleton().markPagesForVisitedLinkStyleRecalc();
}
void WebVisitedLinkStore::removeVisitedLinkHashes()
Modified: trunk/Source/WebKit2/WebProcess/WebPage/VisitedLinkTableController.cpp (196632 => 196633)
--- trunk/Source/WebKit2/WebProcess/WebPage/VisitedLinkTableController.cpp 2016-02-16 09:50:26 UTC (rev 196632)
+++ trunk/Source/WebKit2/WebProcess/WebPage/VisitedLinkTableController.cpp 2016-02-16 10:00:15 UTC (rev 196633)
@@ -97,20 +97,17 @@
m_visitedLinkTable.setSharedMemory(sharedMemory.release());
invalidateStylesForAllLinks();
- PageCache::singleton().markPagesForVisitedLinkStyleRecalc();
}
void VisitedLinkTableController::visitedLinkStateChanged(const Vector<WebCore::LinkHash>& linkHashes)
{
for (auto linkHash : linkHashes)
invalidateStylesForLink(linkHash);
- PageCache::singleton().markPagesForVisitedLinkStyleRecalc();
}
void VisitedLinkTableController::allVisitedLinkStateChanged()
{
invalidateStylesForAllLinks();
- PageCache::singleton().markPagesForVisitedLinkStyleRecalc();
}
void VisitedLinkTableController::removeAllVisitedLinks()
@@ -118,7 +115,6 @@
m_visitedLinkTable.clear();
invalidateStylesForAllLinks();
- PageCache::singleton().markPagesForVisitedLinkStyleRecalc();
}
} // namespace WebKit