Title: [109212] trunk
Revision
109212
Author
[email protected]
Date
2012-02-29 07:28:23 -0800 (Wed, 29 Feb 2012)

Log Message

Web Inspector: Clicking relative links fails when query string contains a slash
https://bugs.webkit.org/show_bug.cgi?id=79905

Reviewed by Vsevolod Vlasov.

Source/WebCore:

* inspector/front-end/ResourceUtils.js:
(WebInspector.completeURL):

LayoutTests:

* inspector/styles/styles-url-linkify-expected.txt:
* inspector/styles/styles-url-linkify.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (109211 => 109212)


--- trunk/LayoutTests/ChangeLog	2012-02-29 15:26:10 UTC (rev 109211)
+++ trunk/LayoutTests/ChangeLog	2012-02-29 15:28:23 UTC (rev 109212)
@@ -1,3 +1,13 @@
+2012-02-29  Alexander Pavlov  <[email protected]>
+
+        Web Inspector: Clicking relative links fails when query string contains a slash
+        https://bugs.webkit.org/show_bug.cgi?id=79905
+
+        Reviewed by Vsevolod Vlasov.
+
+        * inspector/styles/styles-url-linkify-expected.txt:
+        * inspector/styles/styles-url-linkify.html:
+
 2012-02-29  Nikolas Zimmermann  <[email protected]>
 
         Not reviewed. Next chunk of SL pixel test updates.

Modified: trunk/LayoutTests/inspector/styles/styles-url-linkify-expected.txt (109211 => 109212)


--- trunk/LayoutTests/inspector/styles/styles-url-linkify-expected.txt	2012-02-29 15:26:10 UTC (rev 109211)
+++ trunk/LayoutTests/inspector/styles/styles-url-linkify-expected.txt	2012-02-29 15:28:23 UTC (rev 109212)
@@ -1,4 +1,4 @@
-Tests that URLs are linked to and completed correctly. Bugs 51663, 53171, 62643, 72373
+Tests that URLs are linked to and completed correctly. Bugs 51663, 53171, 62643, 72373, 79905
 
 
 URLs completed:
@@ -11,7 +11,13 @@
 http://example.com/foo/boo/moo
 http://example.com/moo
 http://example.com/foo?a=b
+http://example.com/foo?a=/b
+http://example.com/?a=/b
 http://example.com/foo?a=b
+http://example.com/foo?a=/b
+http://example.com/foo?a=b
+http://example.com/cat.jpeg
+http://example.com/cat.jpeg
 data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAABCAgMAAACeOuh7AAAABGdBTUEAAK/INwWK6QAAAAlQTFRF////AAAA////fu+PTwAAAAF0Uk5TAEDm2GYAAACHSURBVDjLxdLbDYAgDAVQGELn0R3oEHYf2KGdUqtE46OFRCP3oyTng1xCnWsaD5JRRtCkQ2YmkBkHRXqWJBn0j0TICbrsWVoWhRShCdcGyZCtHxMaUnVPRZ9KSbmBJdsX2vJVnwqRD0Rb4rpzgIbE/AI5NTnWAMvy5l0dXrfuLh5OCe5BmmYGXhTUxlQ5xJ8AAAAASUVORK5CYII=
 _javascript_:alert('foo');
 null

Modified: trunk/LayoutTests/inspector/styles/styles-url-linkify.html (109211 => 109212)


--- trunk/LayoutTests/inspector/styles/styles-url-linkify.html	2012-02-29 15:26:10 UTC (rev 109211)
+++ trunk/LayoutTests/inspector/styles/styles-url-linkify.html	2012-02-29 15:28:23 UTC (rev 109212)
@@ -23,7 +23,13 @@
     completeURL("http://example.com/foo/zoo", "boo/moo");
     completeURL("http://example.com/foo", "moo");
     completeURL("http://example.com/foo", "?a=b");
+    completeURL("http://example.com/foo", "?a=/b");
+    completeURL("http://example.com/?c=/d#anchor", "?a=/b");
     completeURL("http://example.com/foo?c=d", "?a=b");
+    completeURL("http://example.com/foo?c=d#anchor", "?a=/b");
+    completeURL("http://example.com/foo?c=/d/e", "?a=b");
+    completeURL("http://example.com/foo?c=/d/e", "cat.jpeg");
+    completeURL("http://example.com/foo#anchor", "cat.jpeg");
 
     const dataURL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAABCAgMAAACeOuh7AAAABGdBTUEAAK/INwWK6QAAAAlQTFRF////AAAA////fu+PTwAAAAF0Uk5TAEDm2GYAAACHSURBVDjLxdLbDYAgDAVQGELn0R3oEHYf2KGdUqtE46OFRCP3oyTng1xCnWsaD5JRRtCkQ2YmkBkHRXqWJBn0j0TICbrsWVoWhRShCdcGyZCtHxMaUnVPRZ9KSbmBJdsX2vJVnwqRD0Rb4rpzgIbE/AI5NTnWAMvy5l0dXrfuLh5OCe5BmmYGXhTUxlQ5xJ8AAAAASUVORK5CYII=";
     completeURL("https://example.com/foo", dataURL);
@@ -83,7 +89,7 @@
 </head>
 <body _onload_="runAfterIframeIsLoaded()">
 <p>
-Tests that URLs are linked to and completed correctly. Bugs <a href="" <a href="" <a href="" <a href=""
+Tests that URLs are linked to and completed correctly. Bugs <a href="" <a href="" <a href="" <a href="" <a href=""
 </p>
 <div id="local"></div>
 <iframe src=""

Modified: trunk/Source/WebCore/ChangeLog (109211 => 109212)


--- trunk/Source/WebCore/ChangeLog	2012-02-29 15:26:10 UTC (rev 109211)
+++ trunk/Source/WebCore/ChangeLog	2012-02-29 15:28:23 UTC (rev 109212)
@@ -1,3 +1,13 @@
+2012-02-29  Alexander Pavlov  <[email protected]>
+
+        Web Inspector: Clicking relative links fails when query string contains a slash
+        https://bugs.webkit.org/show_bug.cgi?id=79905
+
+        Reviewed by Vsevolod Vlasov.
+
+        * inspector/front-end/ResourceUtils.js:
+        (WebInspector.completeURL):
+
 2012-02-29  Pavel Feldman  <[email protected]>
 
         Web Inspector: Ctrl R should reload page from the console panel as well.

Modified: trunk/Source/WebCore/inspector/front-end/ResourceUtils.js (109211 => 109212)


--- trunk/Source/WebCore/inspector/front-end/ResourceUtils.js	2012-02-29 15:26:10 UTC (rev 109211)
+++ trunk/Source/WebCore/inspector/front-end/ResourceUtils.js	2012-02-29 15:28:23 UTC (rev 109212)
@@ -274,6 +274,11 @@
         var path = href;
         if (path.charAt(0) !== "/") {
             var basePath = parsedURL.path;
+
+            // Trim off the query part of the basePath.
+            var questionMarkIndex = basePath.indexOf("?");
+            if (questionMarkIndex > 0)
+                basePath = basePath.substring(0, questionMarkIndex);
             // A href of "?foo=bar" implies "basePath?foo=bar".
             // With "basePath?a=b" and "?foo=bar" we should get "basePath?foo=bar".
             var prefix;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to