Diff
Modified: branches/safari-534.53-branch/Source/WebCore/ChangeLog (100530 => 100531)
--- branches/safari-534.53-branch/Source/WebCore/ChangeLog 2011-11-17 00:59:48 UTC (rev 100530)
+++ branches/safari-534.53-branch/Source/WebCore/ChangeLog 2011-11-17 01:02:30 UTC (rev 100531)
@@ -1,5 +1,55 @@
2011-11-16 Lucas Forschler <lforsch...@apple.com>
+ Merge 93669
+
+ 2011-08-23 Beth Dakin <bda...@apple.com>
+
+ https://bugs.webkit.org/show_bug.cgi?id=66244
+ Cached pages don't fully update when going back after changing the display scale
+ factor
+ -and corresponding-
+ <rdar://problem/9955656>
+
+ Reviewed by Darin Adler.
+
+ This patch adds a generalized concept of needing a full style recalc to the
+ BackForwardController. So when the display scale factor is changed, the
+ BackForwardController can be informed that all pages will need a full style recalc
+ when they come out of the cache. This same mechanism is also used to fix a long-
+ standing bug with full-page/text zoom.
+
+ Iterate through the HistoryItems and mark all CachedPages as needing a full style
+ recalc.
+ * history/BackForwardController.cpp:
+ (WebCore::BackForwardController::markPagesForFullStyleRecalc):
+ * history/BackForwardController.h:
+
+ ChachedPage has a new bool -- m_needsFullStyleRecalc -- to track whether a full
+ style recalc is needed when the CachedPage is restored.
+ * history/CachedPage.cpp:
+ (WebCore::CachedPage::CachedPage):
+ (WebCore::CachedPage::restore):
+ (WebCore::CachedPage::clear):
+ * history/CachedPage.h:
+ (WebCore::CachedPage::markForFullStyleRecalc):
+
+ HistoryItem actually takes care of calling into CachedPage.
+ * history/HistoryItem.cpp:
+ (WebCore::HistoryItem::markForFullStyleRecalc):
+ * history/HistoryItem.h:
+
+ Fix style recalc issues for full-page/text zoom by calling our new function on
+ PageCache.
+ * page/Frame.cpp:
+ (WebCore::Frame::setPageAndTextZoomFactors):
+
+ Fix style recalc issues for display scale factor changes by calling our new
+ function on PageCache.
+ * page/Page.cpp:
+ (WebCore::Page::setDeviceScaleFactor):
+
+2011-11-16 Lucas Forschler <lforsch...@apple.com>
+
Merge 93303
2011-08-17 Adam Roben <aro...@apple.com>
Modified: branches/safari-534.53-branch/Source/WebCore/history/BackForwardController.cpp (100530 => 100531)
--- branches/safari-534.53-branch/Source/WebCore/history/BackForwardController.cpp 2011-11-17 00:59:48 UTC (rev 100530)
+++ branches/safari-534.53-branch/Source/WebCore/history/BackForwardController.cpp 2011-11-17 01:02:30 UTC (rev 100531)
@@ -104,4 +104,15 @@
m_client->close();
}
+void BackForwardController::markPagesForFullStyleRecalc()
+{
+ int first = -backCount();
+ int last = forwardCount();
+ for (int i = first; i <= last; i++) {
+ if (!i)
+ continue;
+ itemAtIndex(i)->markForFullStyleRecalc();
+ }
+}
+
} // namespace WebCore
Modified: branches/safari-534.53-branch/Source/WebCore/history/BackForwardController.h (100530 => 100531)
--- branches/safari-534.53-branch/Source/WebCore/history/BackForwardController.h 2011-11-17 00:59:48 UTC (rev 100530)
+++ branches/safari-534.53-branch/Source/WebCore/history/BackForwardController.h 2011-11-17 01:02:30 UTC (rev 100531)
@@ -67,6 +67,8 @@
HistoryItem* currentItem() { return itemAtIndex(0); }
HistoryItem* forwardItem() { return itemAtIndex(1); }
+ void markPagesForFullStyleRecalc();
+
private:
Page* m_page;
RefPtr<BackForwardList> m_client;
Modified: branches/safari-534.53-branch/Source/WebCore/history/CachedPage.cpp (100530 => 100531)
--- branches/safari-534.53-branch/Source/WebCore/history/CachedPage.cpp 2011-11-17 00:59:48 UTC (rev 100530)
+++ branches/safari-534.53-branch/Source/WebCore/history/CachedPage.cpp 2011-11-17 01:02:30 UTC (rev 100531)
@@ -54,6 +54,7 @@
: m_timeStamp(currentTime())
, m_cachedMainFrame(CachedFrame::create(page->mainFrame()))
, m_needStyleRecalcForVisitedLinks(false)
+ , m_needsFullStyleRecalc(false)
{
#ifndef NDEBUG
cachedPageCounter.increment();
@@ -93,6 +94,9 @@
}
}
+ if (m_needsFullStyleRecalc)
+ page->setNeedsRecalcStyleInAllFrames();
+
clear();
}
@@ -102,6 +106,7 @@
m_cachedMainFrame->clear();
m_cachedMainFrame = 0;
m_needStyleRecalcForVisitedLinks = false;
+ m_needsFullStyleRecalc = false;
}
void CachedPage::destroy()
Modified: branches/safari-534.53-branch/Source/WebCore/history/CachedPage.h (100530 => 100531)
--- branches/safari-534.53-branch/Source/WebCore/history/CachedPage.h 2011-11-17 00:59:48 UTC (rev 100530)
+++ branches/safari-534.53-branch/Source/WebCore/history/CachedPage.h 2011-11-17 01:02:30 UTC (rev 100531)
@@ -51,6 +51,7 @@
CachedFrame* cachedMainFrame() { return m_cachedMainFrame.get(); }
void markForVistedLinkStyleRecalc() { m_needStyleRecalcForVisitedLinks = true; }
+ void markForFullStyleRecalc() { m_needsFullStyleRecalc = true; }
private:
CachedPage(Page*);
@@ -58,6 +59,7 @@
double m_timeStamp;
RefPtr<CachedFrame> m_cachedMainFrame;
bool m_needStyleRecalcForVisitedLinks;
+ bool m_needsFullStyleRecalc;
};
} // namespace WebCore
Modified: branches/safari-534.53-branch/Source/WebCore/history/HistoryItem.cpp (100530 => 100531)
--- branches/safari-534.53-branch/Source/WebCore/history/HistoryItem.cpp 2011-11-17 00:59:48 UTC (rev 100530)
+++ branches/safari-534.53-branch/Source/WebCore/history/HistoryItem.cpp 2011-11-17 01:02:30 UTC (rev 100531)
@@ -864,6 +864,13 @@
return node.release();
}
+void HistoryItem::markForFullStyleRecalc()
+{
+ // Children are guaranteed not to have CachedPages.
+ if (m_cachedPage)
+ m_cachedPage->markForFullStyleRecalc();
+}
+
#ifndef NDEBUG
int HistoryItem::showTree() const
Modified: branches/safari-534.53-branch/Source/WebCore/history/HistoryItem.h (100530 => 100531)
--- branches/safari-534.53-branch/Source/WebCore/history/HistoryItem.h 2011-11-17 00:59:48 UTC (rev 100530)
+++ branches/safari-534.53-branch/Source/WebCore/history/HistoryItem.h 2011-11-17 01:02:30 UTC (rev 100531)
@@ -216,6 +216,8 @@
const Vector<int>& dailyVisitCounts() const { return m_dailyVisitCounts; }
const Vector<int>& weeklyVisitCounts() const { return m_weeklyVisitCounts; }
+ void markForFullStyleRecalc();
+
private:
HistoryItem();
HistoryItem(const String& urlString, const String& title, double lastVisited);
Modified: branches/safari-534.53-branch/Source/WebCore/page/Frame.cpp (100530 => 100531)
--- branches/safari-534.53-branch/Source/WebCore/page/Frame.cpp 2011-11-17 00:59:48 UTC (rev 100530)
+++ branches/safari-534.53-branch/Source/WebCore/page/Frame.cpp 2011-11-17 01:02:30 UTC (rev 100531)
@@ -30,6 +30,7 @@
#include "Frame.h"
#include "ApplyStyleCommand.h"
+#include "BackForwardController.h"
#include "CSSComputedStyleDeclaration.h"
#include "CSSMutableStyleDeclaration.h"
#include "CSSProperty.h"
@@ -1040,6 +1041,9 @@
if (document->renderer() && document->renderer()->needsLayout() && view->didFirstLayout())
view->layout();
}
+
+ if (page->mainFrame() == this)
+ page->backForward()->markPagesForFullStyleRecalc();
}
#if USE(ACCELERATED_COMPOSITING)
Modified: branches/safari-534.53-branch/Source/WebCore/page/Page.cpp (100530 => 100531)
--- branches/safari-534.53-branch/Source/WebCore/page/Page.cpp 2011-11-17 00:59:48 UTC (rev 100530)
+++ branches/safari-534.53-branch/Source/WebCore/page/Page.cpp 2011-11-17 01:02:30 UTC (rev 100531)
@@ -606,6 +606,8 @@
#if USE(ACCELERATED_COMPOSITING)
m_mainFrame->deviceOrPageScaleFactorChanged();
#endif
+
+ backForward()->markPagesForFullStyleRecalc();
}
void Page::didMoveOnscreen()