Title: [152194] trunk/Source/WebCore
- Revision
- 152194
- Author
- bda...@apple.com
- Date
- 2013-06-28 16:11:39 -0700 (Fri, 28 Jun 2013)
Log Message
Cached pages don't update their backing scale factor when it changes
https://bugs.webkit.org/show_bug.cgi?id=118206
-and-
<rdar://problem/14261627>
Reviewed by Tim Horton.
It is not sufficient to mark pages in the PageCache as needing a full style
recalc. We also need to ensure that the RenderLayerCompositors for the CachesPages
get updated.
Keep track of whether device scale has been updated with
m_needsDeviceScaleChanged. If that has been marked true, then restore() will call
Frame::deviceOrPageScaleFactorChanged().
* history/CachedPage.cpp:
(WebCore::CachedPage::CachedPage):
(WebCore::CachedPage::restore):
* history/CachedPage.h:
(WebCore::CachedPage::markForDeviceScaleChanged):
Propagate markForDeviceScaleChanged() to all of the CachedPages.
* history/PageCache.cpp:
(WebCore::PageCache::markPagesForDeviceScaleChanged):
* history/PageCache.h:
Call PageCache::markPagesForDeviceScaleChanged()
* page/Page.cpp:
(WebCore::Page::setDeviceScaleFactor):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (152193 => 152194)
--- trunk/Source/WebCore/ChangeLog 2013-06-28 22:48:13 UTC (rev 152193)
+++ trunk/Source/WebCore/ChangeLog 2013-06-28 23:11:39 UTC (rev 152194)
@@ -1,3 +1,34 @@
+2013-06-28 Beth Dakin <bda...@apple.com>
+
+ Cached pages don't update their backing scale factor when it changes
+ https://bugs.webkit.org/show_bug.cgi?id=118206
+ -and-
+ <rdar://problem/14261627>
+
+ Reviewed by Tim Horton.
+
+ It is not sufficient to mark pages in the PageCache as needing a full style
+ recalc. We also need to ensure that the RenderLayerCompositors for the CachesPages
+ get updated.
+
+ Keep track of whether device scale has been updated with
+ m_needsDeviceScaleChanged. If that has been marked true, then restore() will call
+ Frame::deviceOrPageScaleFactorChanged().
+ * history/CachedPage.cpp:
+ (WebCore::CachedPage::CachedPage):
+ (WebCore::CachedPage::restore):
+ * history/CachedPage.h:
+ (WebCore::CachedPage::markForDeviceScaleChanged):
+
+ Propagate markForDeviceScaleChanged() to all of the CachedPages.
+ * history/PageCache.cpp:
+ (WebCore::PageCache::markPagesForDeviceScaleChanged):
+ * history/PageCache.h:
+
+ Call PageCache::markPagesForDeviceScaleChanged()
+ * page/Page.cpp:
+ (WebCore::Page::setDeviceScaleFactor):
+
2013-06-28 Alex Christensen <achristen...@apple.com>
Added template parameters to std::min to fix compile errors in Visual Studio x64.
Modified: trunk/Source/WebCore/history/CachedPage.cpp (152193 => 152194)
--- trunk/Source/WebCore/history/CachedPage.cpp 2013-06-28 22:48:13 UTC (rev 152193)
+++ trunk/Source/WebCore/history/CachedPage.cpp 2013-06-28 23:11:39 UTC (rev 152194)
@@ -57,6 +57,7 @@
, m_needStyleRecalcForVisitedLinks(false)
, m_needsFullStyleRecalc(false)
, m_needsCaptionPreferencesChanged(false)
+ , m_needsDeviceScaleChanged(false)
{
#ifndef NDEBUG
cachedPageCounter.increment();
@@ -92,6 +93,13 @@
frame->document()->visitedLinkState()->invalidateStyleForAllLinks();
}
+#if USE(ACCELERATED_COMPOSITING)
+ if (m_needsDeviceScaleChanged) {
+ if (Frame* frame = page->mainFrame())
+ frame->deviceOrPageScaleFactorChanged();
+ }
+#endif
+
if (m_needsFullStyleRecalc)
page->setNeedsRecalcStyleInAllFrames();
Modified: trunk/Source/WebCore/history/CachedPage.h (152193 => 152194)
--- trunk/Source/WebCore/history/CachedPage.h 2013-06-28 22:48:13 UTC (rev 152193)
+++ trunk/Source/WebCore/history/CachedPage.h 2013-06-28 23:11:39 UTC (rev 152194)
@@ -58,6 +58,10 @@
void markForCaptionPreferencesChanged() { m_needsCaptionPreferencesChanged = true; }
#endif
+#if USE(ACCELERATED_COMPOSITING)
+ void markForDeviceScaleChanged() { m_needsDeviceScaleChanged = true; }
+#endif
+
private:
CachedPage(Page*);
@@ -67,6 +71,7 @@
bool m_needStyleRecalcForVisitedLinks;
bool m_needsFullStyleRecalc;
bool m_needsCaptionPreferencesChanged;
+ bool m_needsDeviceScaleChanged;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/history/PageCache.cpp (152193 => 152194)
--- trunk/Source/WebCore/history/PageCache.cpp 2013-06-28 22:48:13 UTC (rev 152193)
+++ trunk/Source/WebCore/history/PageCache.cpp 2013-06-28 23:11:39 UTC (rev 152194)
@@ -406,6 +406,20 @@
}
}
+
+#if USE(ACCELERATED_COMPOSITING)
+void PageCache::markPagesForDeviceScaleChanged(Page* page)
+{
+ Frame* mainFrame = page->mainFrame();
+
+ for (HistoryItem* current = m_head; current; current = current->m_next) {
+ CachedPage* cachedPage = current->m_cachedPage.get();
+ if (cachedPage->cachedMainFrame()->view()->frame() == mainFrame)
+ cachedPage->markForDeviceScaleChanged();
+ }
+}
+#endif
+
#if ENABLE(VIDEO_TRACK)
void PageCache::markPagesForCaptionPreferencesChanged()
{
Modified: trunk/Source/WebCore/history/PageCache.h (152193 => 152194)
--- trunk/Source/WebCore/history/PageCache.h 2013-06-28 22:48:13 UTC (rev 152193)
+++ trunk/Source/WebCore/history/PageCache.h 2013-06-28 23:11:39 UTC (rev 152194)
@@ -67,6 +67,7 @@
#if USE(ACCELERATED_COMPOSITING)
bool shouldClearBackingStores() const { return m_shouldClearBackingStores; }
void setShouldClearBackingStores(bool flag) { m_shouldClearBackingStores = flag; }
+ void markPagesForDeviceScaleChanged(Page*);
#endif
private:
Modified: trunk/Source/WebCore/page/Page.cpp (152193 => 152194)
--- trunk/Source/WebCore/page/Page.cpp 2013-06-28 22:48:13 UTC (rev 152193)
+++ trunk/Source/WebCore/page/Page.cpp 2013-06-28 23:11:39 UTC (rev 152194)
@@ -804,6 +804,8 @@
#if USE(ACCELERATED_COMPOSITING)
if (mainFrame())
mainFrame()->deviceOrPageScaleFactorChanged();
+
+ pageCache()->markPagesForDeviceScaleChanged(this);
#endif
for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext())
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes