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

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, 1 month 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
« no previous file with comments | « Source/core/page/Page.cpp ('k') | Source/web/ContextMenuClientImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/testing/Internals.cpp
diff --git a/Source/core/testing/Internals.cpp b/Source/core/testing/Internals.cpp
index 3014598affd92e45be78b85b621e1691e7d0c458..1d3972ff616d2a928c235821a1977402452812df 100644
--- a/Source/core/testing/Internals.cpp
+++ b/Source/core/testing/Internals.cpp
@@ -712,33 +712,22 @@ void Internals::selectColorInColorChooser(Element* element, const String& colorV
Vector<String> Internals::formControlStateOfPreviousHistoryItem(ExceptionState& es)
{
- HistoryItem* mainItem = frame()->loader().history()->previousItem();
+ HistoryItem* mainItem = frame()->page()->history()->previousItem(frame());
if (!mainItem) {
es.throwUninformativeAndGenericDOMException(InvalidAccessError);
return Vector<String>();
}
- String uniqueName = frame()->tree().uniqueName();
- if (mainItem->target() != uniqueName && !mainItem->childItemWithTarget(uniqueName)) {
- es.throwUninformativeAndGenericDOMException(InvalidAccessError);
- return Vector<String>();
- }
- return mainItem->target() == uniqueName ? mainItem->documentState() : mainItem->childItemWithTarget(uniqueName)->documentState();
+ return mainItem->documentState();
}
void Internals::setFormControlStateOfPreviousHistoryItem(const Vector<String>& state, ExceptionState& es)
{
- HistoryItem* mainItem = frame()->loader().history()->previousItem();
+ HistoryItem* mainItem = frame()->page()->history()->previousItem(frame());
if (!mainItem) {
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);
- else
- es.throwUninformativeAndGenericDOMException(InvalidAccessError);
+ mainItem->setDocumentState(state);
}
void Internals::setEnableMockPagePopup(bool enabled, ExceptionState& es)
@@ -2058,8 +2047,8 @@ PassRefPtr<TypeConversions> Internals::typeConversions() const
Vector<String> Internals::getReferencedFilePaths() const
{
- frame()->loader().history()->saveDocumentAndScrollState();
- return FormController::getReferencedFilePaths(frame()->loader().history()->currentItem()->documentState());
+ frame()->page()->history()->saveDocumentAndScrollState(frame());
+ return FormController::getReferencedFilePaths(frame()->page()->history()->currentItem(frame())->documentState());
}
void Internals::startTrackingRepaints(Document* document, ExceptionState& es)
« no previous file with comments | « Source/core/page/Page.cpp ('k') | Source/web/ContextMenuClientImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698