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

Unified Diff: Source/WebCore/inspector/front-end/inspector.js

Issue 6327025: Merge 76788 - 2011-01-27 Alexander Pavlov <apavlov@chromium.org>... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/648/
Patch Set: Created 9 years, 11 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/inspector/styles-url-linkify-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/inspector/front-end/inspector.js
===================================================================
--- Source/WebCore/inspector/front-end/inspector.js (revision 76937)
+++ Source/WebCore/inspector/front-end/inspector.js (working copy)
@@ -1511,7 +1511,19 @@
var path = href;
if (path.charAt(0) !== "/") {
var basePath = parsedURL.path;
- path = basePath.substring(0, basePath.lastIndexOf("/")) + "/" + path;
+ // A href of "?foo=bar" implies "basePath?foo=bar".
+ // With "basePath?a=b" and "?foo=bar" we should get "basePath?foo=bar".
+ var prefix;
+ if (path.charAt(0) === "?") {
+ var basePathCutIndex = basePath.indexOf("?");
+ if (basePathCutIndex !== -1)
+ prefix = basePath.substring(0, basePathCutIndex);
+ else
+ prefix = basePath;
+ } else
+ prefix = basePath.substring(0, basePath.lastIndexOf("/")) + "/";
+
+ path = prefix + path;
} else if (path.length > 1 && path.charAt(1) === "/") {
// href starts with "//" which is a full URL with the protocol dropped (use the baseURL protocol).
return parsedURL.scheme + ":" + path;
« no previous file with comments | « LayoutTests/inspector/styles-url-linkify-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698