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

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

Issue 2686653003: URL.search should return the set value via setSearch (Closed)
Patch Set: fix Created 3 years, 10 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 | « third_party/WebKit/LayoutTests/fast/domurl/url-search.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/DOMURLUtils.cpp
diff --git a/third_party/WebKit/Source/core/dom/DOMURLUtils.cpp b/third_party/WebKit/Source/core/dom/DOMURLUtils.cpp
index 853ff19442489a864f3fd279b750d70b992c88f0..2062b748807c42264c81b01d091af887a4eefcfb 100644
--- a/third_party/WebKit/Source/core/dom/DOMURLUtils.cpp
+++ b/third_party/WebKit/Source/core/dom/DOMURLUtils.cpp
@@ -123,10 +123,10 @@ void DOMURLUtils::setSearchInternal(const String& value) {
// FIXME: have KURL do this clearing of the query component
// instead, if practical. Will require addressing
// http://crbug.com/108690, for one.
- if (value[0] == '?')
- kurl.setQuery(value.length() == 1 ? String() : value.substring(1));
+ if ((value.length() == 1 && value[0] == '?') || value.isEmpty())
+ kurl.setQuery(String());
else
- kurl.setQuery(value.isEmpty() ? String() : value);
+ kurl.setQuery(value);
setURL(kurl);
}
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/domurl/url-search.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698