<rdar://problem/9251515> and https://bugs.webkit.org/show_bug.cgi?id=58072
[WebKit-https.git] / Source / WebCore / loader / HistoryController.cpp
index c1c541432aadd9f5bdbbad629b0f8a046b5aa8d6..407b6bedc1596679fe028f5f07cf41922ebc8e0b 100644 (file)
@@ -799,6 +799,10 @@ void HistoryController::pushState(PassRefPtr<SerializedScriptValue> stateObject,
     m_currentItem->setURLString(urlString);
 
     page->backForward()->addItem(topItem.release());
+
+    addVisitedLink(page, KURL(ParsedURLString, urlString));
+    m_frame->loader()->client()->updateGlobalHistory();
+
 }
 
 void HistoryController::replaceState(PassRefPtr<SerializedScriptValue> stateObject, const String& title, const String& urlString)
@@ -810,6 +814,10 @@ void HistoryController::replaceState(PassRefPtr<SerializedScriptValue> stateObje
         m_currentItem->setURLString(urlString);
     m_currentItem->setTitle(title);
     m_currentItem->setStateObject(stateObject);
+
+    ASSERT(m_frame->page());
+    addVisitedLink(m_frame->page(), KURL(ParsedURLString, urlString));
+    m_frame->loader()->client()->updateGlobalHistory();
 }
 
 } // namespace WebCore