Title: [89049] trunk
Revision
89049
Author
[email protected]
Date
2011-06-16 11:14:32 -0700 (Thu, 16 Jun 2011)

Log Message

2011-06-16  Vsevolod Vlasov  <[email protected]>

        Reviewed by Pavel Feldman.

        Web Inspector: Network panel shows incorrect query parameters when url has fragment.
        https://bugs.webkit.org/show_bug.cgi?id=62723

        * http/tests/inspector/resource-parameters-expected.txt:
        * http/tests/inspector/resource-parameters.html:
2011-06-16  Vsevolod Vlasov  <[email protected]>

        Reviewed by Pavel Feldman.

        Web Inspector: Network panel shows incorrect query parameters when url has fragment.
        https://bugs.webkit.org/show_bug.cgi?id=62723

        * English.lproj/localizedStrings.js:
        * inspector/front-end/HAREntry.js:
        (WebInspector.HAREntry.prototype._buildRequest):
        (WebInspector.HAREntry.prototype._buildRequestURL):
        * inspector/front-end/Resource.js:
        (WebInspector.Resource.prototype.set url):
        (WebInspector.Resource.prototype.get queryParameters):
        * inspector/front-end/ResourceHeadersView.js:
        (WebInspector.ResourceHeadersView):
        (WebInspector.ResourceHeadersView.prototype._refreshUrlFragment):

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (89048 => 89049)


--- trunk/LayoutTests/ChangeLog	2011-06-16 18:12:24 UTC (rev 89048)
+++ trunk/LayoutTests/ChangeLog	2011-06-16 18:14:32 UTC (rev 89049)
@@ -1,3 +1,13 @@
+2011-06-16  Vsevolod Vlasov  <[email protected]>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: Network panel shows incorrect query parameters when url has fragment.
+        https://bugs.webkit.org/show_bug.cgi?id=62723
+
+        * http/tests/inspector/resource-parameters-expected.txt:
+        * http/tests/inspector/resource-parameters.html:
+
 2011-06-16  Stephen White  <[email protected]>
 
         Unreviewed.

Modified: trunk/LayoutTests/http/tests/inspector/resource-parameters-expected.txt (89048 => 89049)


--- trunk/LayoutTests/http/tests/inspector/resource-parameters-expected.txt	2011-06-16 18:12:24 UTC (rev 89048)
+++ trunk/LayoutTests/http/tests/inspector/resource-parameters-expected.txt	2011-06-16 18:14:32 UTC (rev 89049)
@@ -3,7 +3,7 @@
   
 
 {
-    pageref : "http://localhost:8000/inspector/resources/post-target.cgi?queryParam1=queryValue1&queryParam2="
+    pageref : "http://localhost:8000/inspector/resources/post-target.cgi?queryParam1=queryValue1&queryParam2=#fragmentParam1=fragmentValue1&fragmentParam2="
     startedDateTime : <object>
     time : <number>
     request : {

Modified: trunk/LayoutTests/http/tests/inspector/resource-parameters.html (89048 => 89049)


--- trunk/LayoutTests/http/tests/inspector/resource-parameters.html	2011-06-16 18:12:24 UTC (rev 89048)
+++ trunk/LayoutTests/http/tests/inspector/resource-parameters.html	2011-06-16 18:14:32 UTC (rev 89049)
@@ -17,7 +17,7 @@
     function onResourceFinished(event)
     {
         var resource = event.data;
-        if (resource.url !== "http://localhost:8000/inspector/resources/post-target.cgi?queryParam1=queryValue1&queryParam2=")
+        if (resource.url !== "http://localhost:8000/inspector/resources/post-target.cgi?queryParam1=queryValue1&queryParam2=#fragmentParam1=fragmentValue1&fragmentParam2=")
             return;
         InspectorTest.addObject(new WebInspector.HAREntry(resource).build(), InspectorTest.HARNondeterministicProperties);
         InspectorTest.completeTest();
@@ -30,7 +30,7 @@
 <p>
 Tests that resources panel shows form data parameters.
 </p>
-<form target="target-iframe" method="POST" action=""
+<form target="target-iframe" method="POST" action=""
 <input name="formParam1" value="formValue1">
 <input name="formParam2">
 <input id="submit" type="submit">

Modified: trunk/Source/WebCore/ChangeLog (89048 => 89049)


--- trunk/Source/WebCore/ChangeLog	2011-06-16 18:12:24 UTC (rev 89048)
+++ trunk/Source/WebCore/ChangeLog	2011-06-16 18:14:32 UTC (rev 89049)
@@ -1,3 +1,21 @@
+2011-06-16  Vsevolod Vlasov  <[email protected]>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: Network panel shows incorrect query parameters when url has fragment.
+        https://bugs.webkit.org/show_bug.cgi?id=62723
+
+        * English.lproj/localizedStrings.js:
+        * inspector/front-end/HAREntry.js:
+        (WebInspector.HAREntry.prototype._buildRequest):
+        (WebInspector.HAREntry.prototype._buildRequestURL):
+        * inspector/front-end/Resource.js:
+        (WebInspector.Resource.prototype.set url):
+        (WebInspector.Resource.prototype.get queryParameters):
+        * inspector/front-end/ResourceHeadersView.js:
+        (WebInspector.ResourceHeadersView):
+        (WebInspector.ResourceHeadersView.prototype._refreshUrlFragment):
+
 2011-06-16  Dimitri Glazkov  <[email protected]>
 
         Clang fix after r89039.

Modified: trunk/Source/WebCore/English.lproj/localizedStrings.js


(Binary files differ)

Modified: trunk/Source/WebCore/inspector/front-end/HAREntry.js (89048 => 89049)


--- trunk/Source/WebCore/inspector/front-end/HAREntry.js	2011-06-16 18:12:24 UTC (rev 89048)
+++ trunk/Source/WebCore/inspector/front-end/HAREntry.js	2011-06-16 18:14:32 UTC (rev 89049)
@@ -57,7 +57,7 @@
     {
         var res = {
             method: this._resource.requestMethod,
-            url: this._resource.url,
+            url: this._buildRequestURL(this._resource.url),
             // httpVersion: "HTTP/1.1" -- Not available.
             headers: this._buildHeaders(this._resource.requestHeaders),
             queryString: this._buildParameters(this._resource.queryParameters || []),
@@ -152,6 +152,11 @@
         return parameters.slice();
     },
 
+    _buildRequestURL: function(url)
+    {
+        return url.split("#", 2)[0];
+    },
+
     _buildCookies: function(cookies)
     {
         return cookies.map(this._buildCookie.bind(this));

Modified: trunk/Source/WebCore/inspector/front-end/Resource.js (89048 => 89049)


--- trunk/Source/WebCore/inspector/front-end/Resource.js	2011-06-16 18:12:24 UTC (rev 89048)
+++ trunk/Source/WebCore/inspector/front-end/Resource.js	2011-06-16 18:14:32 UTC (rev 89049)
@@ -206,6 +206,7 @@
         var parsedURL = x.asParsedURL();
         this.domain = parsedURL ? parsedURL.host : "";
         this.path = parsedURL ? parsedURL.path : "";
+        this.urlFragment = parsedURL ? parsedURL.fragment : "";
         this.lastPathComponent = "";
         if (parsedURL && parsedURL.path) {
             // First cut the query params.
@@ -640,6 +641,7 @@
         var queryString = this.url.split("?", 2)[1];
         if (!queryString)
             return;
+        queryString = queryString.split("#", 2)[0];
         this._parsedQueryParameters = this._parseParameters(queryString);
         return this._parsedQueryParameters;
     },

Modified: trunk/Source/WebCore/inspector/front-end/ResourceHeadersView.js (89048 => 89049)


--- trunk/Source/WebCore/inspector/front-end/ResourceHeadersView.js	2011-06-16 18:12:24 UTC (rev 89048)
+++ trunk/Source/WebCore/inspector/front-end/ResourceHeadersView.js	2011-06-16 18:14:32 UTC (rev 89049)
@@ -70,6 +70,12 @@
     this._queryStringTreeElement.hidden = true;
     this._headersTreeOutline.appendChild(this._queryStringTreeElement);
 
+    this._urlFragmentTreeElement = new TreeElement("", null, true);
+    this._urlFragmentTreeElement.expanded = true;
+    this._urlFragmentTreeElement.selectable = false;
+    this._urlFragmentTreeElement.hidden = true;
+    this._headersTreeOutline.appendChild(this._urlFragmentTreeElement);
+
     this._formDataTreeElement = new TreeElement("", null, true);
     this._formDataTreeElement.expanded = true;
     this._formDataTreeElement.selectable = false;
@@ -93,6 +99,7 @@
 
     this._refreshURL();
     this._refreshQueryString();
+    this._refreshUrlFragment();
     this._refreshRequestHeaders();
     this._refreshResponseHeaders();
     this._refreshHTTPInformation();
@@ -114,6 +121,29 @@
             this._refreshParms(WebInspector.UIString("Query String Parameters"), queryParameters, this._queryStringTreeElement);
     },
 
+    _refreshUrlFragment: function()
+    {
+        var urlFragment = this._resource.urlFragment;
+        this._urlFragmentTreeElement.hidden = !urlFragment;
+
+        if (!urlFragment)
+            return;
+
+        var sectionTitle = WebInspector.UIString("URL fragment"); 
+
+        this._urlFragmentTreeElement.removeChildren();
+        this._urlFragmentTreeElement.listItemElement.removeChildren();
+        this._urlFragmentTreeElement.listItemElement.appendChild(document.createTextNode(sectionTitle));
+        
+        var title = "<div class=\"header-name\">#:</div>";
+        title += "<div class=\"header-value source-code\">" + urlFragment.escapeHTML() + "</div>";
+
+        var fragmentTreeElement = new TreeElement(null, null, false);
+        fragmentTreeElement.titleHTML = title;
+        fragmentTreeElement.selectable = false;
+        this._urlFragmentTreeElement.appendChild(fragmentTreeElement);
+    },
+    
     _refreshFormData: function()
     {
         this._formDataTreeElement.hidden = true;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to