summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/history
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-06-02 12:07:03 +0100
committerBen Murdoch <benm@google.com>2011-06-10 10:47:21 +0100
commit2daae5fd11344eaa88a0d92b0f6d65f8d2255c00 (patch)
treee4964fbd1cb70599f7718ff03e50ea1dab33890b /Source/WebCore/history
parent87bdf0060a247bfbe668342b87e0874182e0ffa9 (diff)
downloadexternal_webkit-2daae5fd11344eaa88a0d92b0f6d65f8d2255c00.zip
external_webkit-2daae5fd11344eaa88a0d92b0f6d65f8d2255c00.tar.gz
external_webkit-2daae5fd11344eaa88a0d92b0f6d65f8d2255c00.tar.bz2
Merge WebKit at r84325: Initial merge by git.
Change-Id: Ic1a909300ecc0a13ddc6b4e784371d2ac6e3d59b
Diffstat (limited to 'Source/WebCore/history')
-rw-r--r--Source/WebCore/history/CachedPage.cpp12
-rw-r--r--Source/WebCore/history/CachedPage.h3
-rw-r--r--Source/WebCore/history/HistoryItem.h1
-rw-r--r--Source/WebCore/history/PageCache.cpp6
-rw-r--r--Source/WebCore/history/PageCache.h2
5 files changed, 23 insertions, 1 deletions
diff --git a/Source/WebCore/history/CachedPage.cpp b/Source/WebCore/history/CachedPage.cpp
index acbfd31..1eb7af6 100644
--- a/Source/WebCore/history/CachedPage.cpp
+++ b/Source/WebCore/history/CachedPage.cpp
@@ -26,6 +26,7 @@
#include "config.h"
#include "CachedPage.h"
+#include "CSSStyleSelector.h"
#include "FocusController.h"
#include "Frame.h"
#include "FrameView.h"
@@ -49,6 +50,7 @@ PassRefPtr<CachedPage> CachedPage::create(Page* page)
CachedPage::CachedPage(Page* page)
: m_timeStamp(currentTime())
, m_cachedMainFrame(CachedFrame::create(page->mainFrame()))
+ , m_needStyleRecalcForVisitedLinks(false)
{
#ifndef NDEBUG
cachedPageCounter.increment();
@@ -80,7 +82,14 @@ void CachedPage::restore(Page* page)
if (node->isElementNode())
static_cast<Element*>(node)->updateFocusAppearance(true);
}
-
+
+ if (m_needStyleRecalcForVisitedLinks) {
+ for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+ if (CSSStyleSelector* styleSelector = frame->document()->styleSelector())
+ styleSelector->allVisitedStateChanged();
+ }
+ }
+
clear();
}
@@ -89,6 +98,7 @@ void CachedPage::clear()
ASSERT(m_cachedMainFrame);
m_cachedMainFrame->clear();
m_cachedMainFrame = 0;
+ m_needStyleRecalcForVisitedLinks = false;
}
void CachedPage::destroy()
diff --git a/Source/WebCore/history/CachedPage.h b/Source/WebCore/history/CachedPage.h
index 4741c79..8a226be 100644
--- a/Source/WebCore/history/CachedPage.h
+++ b/Source/WebCore/history/CachedPage.h
@@ -50,11 +50,14 @@ public:
CachedFrame* cachedMainFrame() { return m_cachedMainFrame.get(); }
+ void markForVistedLinkStyleRecalc() { m_needStyleRecalcForVisitedLinks = true; }
+
private:
CachedPage(Page*);
double m_timeStamp;
RefPtr<CachedFrame> m_cachedMainFrame;
+ bool m_needStyleRecalcForVisitedLinks;
};
} // namespace WebCore
diff --git a/Source/WebCore/history/HistoryItem.h b/Source/WebCore/history/HistoryItem.h
index b9c9983..f96469f 100644
--- a/Source/WebCore/history/HistoryItem.h
+++ b/Source/WebCore/history/HistoryItem.h
@@ -29,6 +29,7 @@
#include "IntPoint.h"
#include "PlatformString.h"
#include "SerializedScriptValue.h"
+#include <wtf/HashMap.h>
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
diff --git a/Source/WebCore/history/PageCache.cpp b/Source/WebCore/history/PageCache.cpp
index d57df65..204ab36 100644
--- a/Source/WebCore/history/PageCache.cpp
+++ b/Source/WebCore/history/PageCache.cpp
@@ -341,6 +341,12 @@ int PageCache::autoreleasedPageCount() const
return m_autoreleaseSet.size();
}
+void PageCache::markPagesForVistedLinkStyleRecalc()
+{
+ for (HistoryItem* current = m_head; current; current = current->m_next)
+ current->m_cachedPage->markForVistedLinkStyleRecalc();
+}
+
void PageCache::add(PassRefPtr<HistoryItem> prpItem, Page* page)
{
ASSERT(prpItem);
diff --git a/Source/WebCore/history/PageCache.h b/Source/WebCore/history/PageCache.h
index 912bd65..1bd2e13 100644
--- a/Source/WebCore/history/PageCache.h
+++ b/Source/WebCore/history/PageCache.h
@@ -59,6 +59,8 @@ namespace WebCore {
int frameCount() const;
int autoreleasedPageCount() const;
+ void markPagesForVistedLinkStyleRecalc();
+
private:
typedef HashSet<RefPtr<CachedPage> > CachedPageSet;