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

Unified Diff: Source/core/page/History.cpp

Issue 26216003: Fix History.{push,replace}State handling of null 'url' argument (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
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
« no previous file with comments | « LayoutTests/http/tests/navigation/resources/replacestate-base-no-url-argument.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/History.cpp
diff --git a/Source/core/page/History.cpp b/Source/core/page/History.cpp
index 3b6fd1e54fb045abf52ebcb424bf96c46eb36656..7e16ff4293fa0e720a56b6519124615430629fe9 100644
--- a/Source/core/page/History.cpp
+++ b/Source/core/page/History.cpp
@@ -132,11 +132,14 @@ void History::go(ScriptExecutionContext* context, int distance)
KURL History::urlForState(const String& urlString)
{
- KURL baseURL = m_frame->document()->baseURL();
+ Document* document = m_frame->document();
+
+ if (urlString.isNull())
+ return document->url();
if (urlString.isEmpty())
- return baseURL;
+ return document->baseURL();
- return KURL(baseURL, urlString);
+ return KURL(document->baseURL(), urlString);
}
void History::stateObjectAdded(PassRefPtr<SerializedScriptValue> data, const String& /* title */, const String& urlString, SameDocumentNavigationSource sameDocumentNavigationSource, ExceptionState& es)
« no previous file with comments | « LayoutTests/http/tests/navigation/resources/replacestate-base-no-url-argument.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698