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

Unified Diff: Source/core/testing/Internals.cpp

Issue 28983004: Split the frame tree logic out of HistoryItem (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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: Source/core/testing/Internals.cpp
diff --git a/Source/core/testing/Internals.cpp b/Source/core/testing/Internals.cpp
index 6ee18f61e55afe37d3068e3a3602f06574072e3f..9fa52bd870e7c6bdb54a33ea9d2a3aa59382c2cd 100644
--- a/Source/core/testing/Internals.cpp
+++ b/Source/core/testing/Internals.cpp
@@ -727,12 +727,11 @@ Vector<String> Internals::formControlStateOfPreviousHistoryItem(ExceptionState&
es.throwUninformativeAndGenericDOMException(InvalidAccessError);
return Vector<String>();
}
- String uniqueName = frame()->tree()->uniqueName();
- if (mainItem->target() != uniqueName && !mainItem->childItemWithTarget(uniqueName)) {
+ if (!frame()->loader()->history()->currentItem(frame())) {
es.throwUninformativeAndGenericDOMException(InvalidAccessError);
return Vector<String>();
}
- return mainItem->target() == uniqueName ? mainItem->documentState() : mainItem->childItemWithTarget(uniqueName)->documentState();
+ return frame()->loader()->history()->currentItem(frame())->documentState();
}
void Internals::setFormControlStateOfPreviousHistoryItem(const Vector<String>& state, ExceptionState& es)
@@ -742,11 +741,8 @@ void Internals::setFormControlStateOfPreviousHistoryItem(const Vector<String>& s
es.throwUninformativeAndGenericDOMException(InvalidAccessError);
return;
}
- String uniqueName = frame()->tree()->uniqueName();
- if (mainItem->target() == uniqueName)
- mainItem->setDocumentState(state);
- else if (HistoryItem* subItem = mainItem->childItemWithTarget(uniqueName))
- subItem->setDocumentState(state);
+ if (HistoryItem* item = frame()->loader()->history()->currentItem(frame()))
+ item->setDocumentState(state);
else
es.throwUninformativeAndGenericDOMException(InvalidAccessError);
}
@@ -2065,8 +2061,8 @@ PassRefPtr<TypeConversions> Internals::typeConversions() const
Vector<String> Internals::getReferencedFilePaths() const
{
- frame()->loader()->history()->saveDocumentAndScrollState();
- return FormController::getReferencedFilePaths(frame()->loader()->history()->currentItem()->documentState());
+ frame()->loader()->history()->saveDocumentAndScrollState(frame());
+ return FormController::getReferencedFilePaths(frame()->loader()->history()->currentItem(frame())->documentState());
}
void Internals::startTrackingRepaints(Document* document, ExceptionState& es)

Powered by Google App Engine
This is Rietveld 408576698