Title: [201655] trunk/Source
Revision
201655
Author
cdu...@apple.com
Date
2016-06-03 13:59:49 -0700 (Fri, 03 Jun 2016)

Log Message

Unreviewed, roll out r196633 as it broke PageCache on iOS for WebKit.org
<rdar://problem/26521101>

Source/WebCore:

* dom/Document.cpp:
(WebCore::Document::setInPageCache): Deleted.
* history/CachedPage.cpp:
(WebCore::CachedPage::restore):
(WebCore::CachedPage::clear):
* history/CachedPage.h:
(WebCore::CachedPage::markForVisitedLinkStyleRecalc):
(WebCore::CachedPage::markForFullStyleRecalc):
* history/PageCache.cpp:
(WebCore::PageCache::markPagesForVisitedLinkStyleRecalc):
(WebCore::PageCache::markPagesForFullStyleRecalc):
* history/PageCache.h:
* page/Frame.cpp:
(WebCore::Frame::setPageAndTextZoomFactors):
* page/Page.cpp:
(WebCore::Page::setViewScaleFactor):
(WebCore::Page::setDeviceScaleFactor):
(WebCore::Page::setPagination):
(WebCore::Page::setPaginationLineGridEnabled):
(WebCore::Page::setVisitedLinkStore):

Source/WebKit/mac:

* WebCoreSupport/WebVisitedLinkStore.mm:
(WebVisitedLinkStore::removeAllVisitedLinks):
(WebVisitedLinkStore::removeVisitedLink):
(WebVisitedLinkStore::addVisitedLinkHash):

Source/WebKit/win:

* WebCoreSupport/WebVisitedLinkStore.cpp:
(WebVisitedLinkStore::removeAllVisitedLinks):
(WebVisitedLinkStore::addVisitedLinkHash):

Source/WebKit2:

* WebProcess/WebPage/VisitedLinkTableController.cpp:
(WebKit::VisitedLinkTableController::setVisitedLinkTable):
(WebKit::VisitedLinkTableController::visitedLinkStateChanged):
(WebKit::VisitedLinkTableController::allVisitedLinkStateChanged):
(WebKit::VisitedLinkTableController::removeAllVisitedLinks):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (201654 => 201655)


--- trunk/Source/WebCore/ChangeLog	2016-06-03 20:12:25 UTC (rev 201654)
+++ trunk/Source/WebCore/ChangeLog	2016-06-03 20:59:49 UTC (rev 201655)
@@ -1,3 +1,29 @@
+2016-06-03  Chris Dumez  <cdu...@apple.com>
+
+        Unreviewed, roll out r196633 as it broke PageCache on iOS for WebKit.org
+        <rdar://problem/26521101>
+
+        * dom/Document.cpp:
+        (WebCore::Document::setInPageCache): Deleted.
+        * history/CachedPage.cpp:
+        (WebCore::CachedPage::restore):
+        (WebCore::CachedPage::clear):
+        * history/CachedPage.h:
+        (WebCore::CachedPage::markForVisitedLinkStyleRecalc):
+        (WebCore::CachedPage::markForFullStyleRecalc):
+        * history/PageCache.cpp:
+        (WebCore::PageCache::markPagesForVisitedLinkStyleRecalc):
+        (WebCore::PageCache::markPagesForFullStyleRecalc):
+        * history/PageCache.h:
+        * page/Frame.cpp:
+        (WebCore::Frame::setPageAndTextZoomFactors):
+        * page/Page.cpp:
+        (WebCore::Page::setViewScaleFactor):
+        (WebCore::Page::setDeviceScaleFactor):
+        (WebCore::Page::setPagination):
+        (WebCore::Page::setPaginationLineGridEnabled):
+        (WebCore::Page::setVisitedLinkStore):
+
 2016-06-03  Antoine Quint  <grao...@apple.com>
 
         Reflection of element does not respect backdrop-filter property

Modified: trunk/Source/WebCore/dom/Document.cpp (201654 => 201655)


--- trunk/Source/WebCore/dom/Document.cpp	2016-06-03 20:12:25 UTC (rev 201654)
+++ trunk/Source/WebCore/dom/Document.cpp	2016-06-03 20:59:49 UTC (rev 201655)
@@ -4610,8 +4610,6 @@
         }
         m_styleRecalcTimer.stop();
 
-        clearStyleResolver();
-        clearSelectorQueryCache();
         clearSharedObjectPool();
     } else {
         if (childNeedsStyleRecalc())

Modified: trunk/Source/WebCore/history/CachedPage.cpp (201654 => 201655)


--- trunk/Source/WebCore/history/CachedPage.cpp	2016-06-03 20:12:25 UTC (rev 201654)
+++ trunk/Source/WebCore/history/CachedPage.cpp	2016-06-03 20:59:49 UTC (rev 201655)
@@ -74,8 +74,6 @@
     ASSERT(m_cachedMainFrame->view()->frame().isMainFrame());
     ASSERT(!page.subframeCount());
 
-    page.setNeedsRecalcStyleInAllFrames();
-
     m_cachedMainFrame->open();
     
     // Restore the focus appearance for the focused element.
@@ -102,9 +100,17 @@
 #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();
@@ -123,6 +129,8 @@
     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 (201654 => 201655)


--- trunk/Source/WebCore/history/CachedPage.h	2016-06-03 20:12:25 UTC (rev 201654)
+++ trunk/Source/WebCore/history/CachedPage.h	2016-06-03 20:59:49 UTC (rev 201655)
@@ -50,6 +50,8 @@
     
     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
@@ -61,6 +63,8 @@
 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 (201654 => 201655)


--- trunk/Source/WebCore/history/PageCache.cpp	2016-06-03 20:12:25 UTC (rev 201654)
+++ trunk/Source/WebCore/history/PageCache.cpp	2016-06-03 20:59:49 UTC (rev 201655)
@@ -312,6 +312,23 @@
     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 (201654 => 201655)


--- trunk/Source/WebCore/history/PageCache.h	2016-06-03 20:12:25 UTC (rev 201654)
+++ trunk/Source/WebCore/history/PageCache.h	2016-06-03 20:59:49 UTC (rev 201655)
@@ -61,6 +61,9 @@
     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 (201654 => 201655)


--- trunk/Source/WebCore/page/Frame.cpp	2016-06-03 20:12:25 UTC (rev 201654)
+++ trunk/Source/WebCore/page/Frame.cpp	2016-06-03 20:59:49 UTC (rev 201655)
@@ -961,6 +961,9 @@
         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 (201654 => 201655)


--- trunk/Source/WebCore/page/Page.cpp	2016-06-03 20:12:25 UTC (rev 201654)
+++ trunk/Source/WebCore/page/Page.cpp	2016-06-03 20:59:49 UTC (rev 201655)
@@ -875,6 +875,7 @@
 
     m_viewScaleFactor = scale;
     PageCache::singleton().markPagesForDeviceOrPageScaleChanged(*this);
+    PageCache::singleton().markPagesForFullStyleRecalc(*this);
 }
 
 void Page::setDeviceScaleFactor(float scaleFactor)
@@ -892,6 +893,7 @@
     mainFrame().deviceOrPageScaleFactorChanged();
     PageCache::singleton().markPagesForDeviceOrPageScaleChanged(*this);
 
+    PageCache::singleton().markPagesForFullStyleRecalc(*this);
     GraphicsContext::updateDocumentMarkerResources();
 
     mainFrame().pageOverlayController().didChangeDeviceScaleFactor();
@@ -969,6 +971,7 @@
     m_pagination = pagination;
 
     setNeedsRecalcStyleInAllFrames();
+    PageCache::singleton().markPagesForFullStyleRecalc(*this);
 }
 
 void Page::setPaginationLineGridEnabled(bool enabled)
@@ -979,6 +982,7 @@
     m_paginationLineGridEnabled = enabled;
     
     setNeedsRecalcStyleInAllFrames();
+    PageCache::singleton().markPagesForFullStyleRecalc(*this);
 }
 
 unsigned Page::pageCount() const
@@ -1862,6 +1866,7 @@
     m_visitedLinkStore->addPage(*this);
 
     invalidateStylesForAllLinks();
+    PageCache::singleton().markPagesForFullStyleRecalc(*this);
 }
 
 SessionID Page::sessionID() const

Modified: trunk/Source/WebKit/mac/ChangeLog (201654 => 201655)


--- trunk/Source/WebKit/mac/ChangeLog	2016-06-03 20:12:25 UTC (rev 201654)
+++ trunk/Source/WebKit/mac/ChangeLog	2016-06-03 20:59:49 UTC (rev 201655)
@@ -1,3 +1,13 @@
+2016-06-03  Chris Dumez  <cdu...@apple.com>
+
+        Unreviewed, roll out r196633 as it broke PageCache on iOS for WebKit.org
+        <rdar://problem/26521101>
+
+        * WebCoreSupport/WebVisitedLinkStore.mm:
+        (WebVisitedLinkStore::removeAllVisitedLinks):
+        (WebVisitedLinkStore::removeVisitedLink):
+        (WebVisitedLinkStore::addVisitedLinkHash):
+
 2016-06-02  Youenn Fablet  <youenn.fab...@crf.canon.fr>
 
         Add WebIDL special operation support: serializer

Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebVisitedLinkStore.mm (201654 => 201655)


--- trunk/Source/WebKit/mac/WebCoreSupport/WebVisitedLinkStore.mm	2016-06-03 20:12:25 UTC (rev 201654)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebVisitedLinkStore.mm	2016-06-03 20:59:49 UTC (rev 201655)
@@ -74,6 +74,7 @@
 {
     for (auto& visitedLinkStore : visitedLinkStores())
         visitedLinkStore->removeVisitedLinkHashes();
+    PageCache::singleton().markPagesForVisitedLinkStyleRecalc();
 }
 
 void WebVisitedLinkStore::addVisitedLink(NSString *urlString)
@@ -102,6 +103,7 @@
     m_visitedLinkHashes.remove(linkHash);
 
     invalidateStylesForLink(linkHash);
+    PageCache::singleton().markPagesForVisitedLinkStyleRecalc();
 }
 
 bool WebVisitedLinkStore::isLinkVisited(Page& page, LinkHash linkHash, const URL& baseURL, const AtomicString& attributeURL)
@@ -150,6 +152,7 @@
     m_visitedLinkHashes.add(linkHash);
 
     invalidateStylesForLink(linkHash);
+    PageCache::singleton().markPagesForVisitedLinkStyleRecalc();
 }
 
 void WebVisitedLinkStore::removeVisitedLinkHashes()

Modified: trunk/Source/WebKit/win/ChangeLog (201654 => 201655)


--- trunk/Source/WebKit/win/ChangeLog	2016-06-03 20:12:25 UTC (rev 201654)
+++ trunk/Source/WebKit/win/ChangeLog	2016-06-03 20:59:49 UTC (rev 201655)
@@ -1,3 +1,12 @@
+2016-06-03  Chris Dumez  <cdu...@apple.com>
+
+        Unreviewed, roll out r196633 as it broke PageCache on iOS for WebKit.org
+        <rdar://problem/26521101>
+
+        * WebCoreSupport/WebVisitedLinkStore.cpp:
+        (WebVisitedLinkStore::removeAllVisitedLinks):
+        (WebVisitedLinkStore::addVisitedLinkHash):
+
 2016-06-03  Per Arne Vollan  <pvol...@apple.com>
 
         [Win] Implement WebView::removeAllUserContentFromGroup

Modified: trunk/Source/WebKit/win/WebCoreSupport/WebVisitedLinkStore.cpp (201654 => 201655)


--- trunk/Source/WebKit/win/WebCoreSupport/WebVisitedLinkStore.cpp	2016-06-03 20:12:25 UTC (rev 201654)
+++ trunk/Source/WebKit/win/WebCoreSupport/WebVisitedLinkStore.cpp	2016-06-03 20:59:49 UTC (rev 201655)
@@ -71,6 +71,7 @@
 {
     for (auto& visitedLinkStore : visitedLinkStores())
         visitedLinkStore->removeVisitedLinkHashes();
+    PageCache::singleton().markPagesForVisitedLinkStyleRecalc();
 }
 
 void WebVisitedLinkStore::addVisitedLink(const String& urlString)
@@ -123,6 +124,7 @@
     m_visitedLinkHashes.add(linkHash);
 
     invalidateStylesForLink(linkHash);
+    PageCache::singleton().markPagesForVisitedLinkStyleRecalc();
 }
 
 void WebVisitedLinkStore::removeVisitedLinkHashes()

Modified: trunk/Source/WebKit2/ChangeLog (201654 => 201655)


--- trunk/Source/WebKit2/ChangeLog	2016-06-03 20:12:25 UTC (rev 201654)
+++ trunk/Source/WebKit2/ChangeLog	2016-06-03 20:59:49 UTC (rev 201655)
@@ -1,3 +1,14 @@
+2016-06-03  Chris Dumez  <cdu...@apple.com>
+
+        Unreviewed, roll out r196633 as it broke PageCache on iOS for WebKit.org
+        <rdar://problem/26521101>
+
+        * WebProcess/WebPage/VisitedLinkTableController.cpp:
+        (WebKit::VisitedLinkTableController::setVisitedLinkTable):
+        (WebKit::VisitedLinkTableController::visitedLinkStateChanged):
+        (WebKit::VisitedLinkTableController::allVisitedLinkStateChanged):
+        (WebKit::VisitedLinkTableController::removeAllVisitedLinks):
+
 2016-06-03  Csaba Osztrogonác  <o...@webkit.org>
 
         Fix the !ENABLE(INDEXED_DATABASE) build after r201575

Modified: trunk/Source/WebKit2/WebProcess/WebPage/VisitedLinkTableController.cpp (201654 => 201655)


--- trunk/Source/WebKit2/WebProcess/WebPage/VisitedLinkTableController.cpp	2016-06-03 20:12:25 UTC (rev 201654)
+++ trunk/Source/WebKit2/WebProcess/WebPage/VisitedLinkTableController.cpp	2016-06-03 20:59:49 UTC (rev 201655)
@@ -97,17 +97,20 @@
     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()
@@ -115,6 +118,7 @@
     m_visitedLinkTable.clear();
 
     invalidateStylesForAllLinks();
+    PageCache::singleton().markPagesForVisitedLinkStyleRecalc();
 }
 
 } // namespace WebKit
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to