Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Unified Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2710983003: Move HistoryItem handling to DocumentLoader (Closed)
Patch Set: Address yhirano's comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index c518dcc62546412e7d180c0de22139abe78270f6..bea732d6d29973ed98af1ea188f9d3f4beeaea1a 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -1632,10 +1632,9 @@ Node::NodeType Document::getNodeType() const {
FormController& Document::formController() {
if (!m_formController) {
m_formController = FormController::create();
- if (m_frame && m_frame->loader().currentItem() &&
- m_frame->loader().currentItem()->isCurrentDocument(this))
- m_frame->loader().currentItem()->setDocumentState(
- m_formController->formElementsState());
+ HistoryItem* historyItem = loader() ? loader()->historyItem() : nullptr;
+ if (historyItem)
+ historyItem->setDocumentState(m_formController->formElementsState());
}
return *m_formController;
}

Powered by Google App Engine
This is Rietveld 408576698