Title: [143583] trunk
Revision
143583
Author
[email protected]
Date
2013-02-21 04:09:38 -0800 (Thu, 21 Feb 2013)

Log Message

Web Inspector: Get rid of parsedURL in uiSourceCode, use name and path for displayName instead.
https://bugs.webkit.org/show_bug.cgi?id=110335

Reviewed by Alexander Pavlov.

Source/WebCore:

Replaced UISourceCode.parsedURL with UISourceCode.displayName().

* inspector/front-end/NavigatorView.js:
(WebInspector.NavigatorView.prototype._updateScriptTitle):
(WebInspector.NavigatorView.prototype.getOrCreateFolderTreeElement):
(WebInspector.NavigatorFolderTreeElement):
* inspector/front-end/ResourceUtils.js:
(WebInspector.displayNameForURL):
* inspector/front-end/RevisionHistoryView.js:
(WebInspector.RevisionHistoryView.prototype._createUISourceCodeItem):
* inspector/front-end/UISourceCode.js:
(WebInspector.UISourceCode):
(WebInspector.UISourceCode.prototype.displayName):
(WebInspector.UISourceCode.prototype.urlChanged):

Source/WebKit/chromium:

* src/js/Tests.js:
(.TestSuite.prototype._scriptsAreParsed):

LayoutTests:

* http/tests/inspector-enabled/dynamic-scripts.html:
* http/tests/inspector/debugger-test.js:
(initialize_DebuggerTest):
* inspector/debugger/dynamic-scripts.html:
* inspector/debugger/scripts-file-selector-expected.txt:
* inspector/debugger/source-url-comment.html:
* inspector/styles/edit-inspector-stylesheet.html:
* inspector/styles/styles-add-new-rule.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (143582 => 143583)


--- trunk/LayoutTests/ChangeLog	2013-02-21 11:58:51 UTC (rev 143582)
+++ trunk/LayoutTests/ChangeLog	2013-02-21 12:09:38 UTC (rev 143583)
@@ -1,3 +1,19 @@
+2013-02-21  Vsevolod Vlasov  <[email protected]>
+
+        Web Inspector: Get rid of parsedURL in uiSourceCode, use name and path for displayName instead.
+        https://bugs.webkit.org/show_bug.cgi?id=110335
+
+        Reviewed by Alexander Pavlov.
+
+        * http/tests/inspector-enabled/dynamic-scripts.html:
+        * http/tests/inspector/debugger-test.js:
+        (initialize_DebuggerTest):
+        * inspector/debugger/dynamic-scripts.html:
+        * inspector/debugger/scripts-file-selector-expected.txt:
+        * inspector/debugger/source-url-comment.html:
+        * inspector/styles/edit-inspector-stylesheet.html:
+        * inspector/styles/styles-add-new-rule.html:
+
 2013-02-21  Alexander Pavlov  <[email protected]>
 
         Web Inspector: Local/session storage tree items in the Resources panel after page refresh are not shown

Modified: trunk/LayoutTests/http/tests/inspector/debugger-test.js (143582 => 143583)


--- trunk/LayoutTests/http/tests/inspector/debugger-test.js	2013-02-21 11:58:51 UTC (rev 143582)
+++ trunk/LayoutTests/http/tests/inspector/debugger-test.js	2013-02-21 12:09:38 UTC (rev 143583)
@@ -174,7 +174,7 @@
     var panel = WebInspector.showPanel("scripts");
     var uiSourceCodes = panel._workspace.uiSourceCodes();
     for (var i = 0; i < uiSourceCodes.length; ++i) {
-        if (uiSourceCodes[i].parsedURL.lastPathComponent === scriptName) {
+        if (uiSourceCodes[i].name() === scriptName) {
             InspectorTest.showUISourceCode(uiSourceCodes[i], callback);
             return;
         }

Modified: trunk/LayoutTests/http/tests/inspector-enabled/dynamic-scripts.html (143582 => 143583)


--- trunk/LayoutTests/http/tests/inspector-enabled/dynamic-scripts.html	2013-02-21 11:58:51 UTC (rev 143582)
+++ trunk/LayoutTests/http/tests/inspector-enabled/dynamic-scripts.html	2013-02-21 12:09:38 UTC (rev 143583)
@@ -52,7 +52,7 @@
     {
         var panel = WebInspector.showPanel("scripts");
         var uiSourceCodes = WebInspector.workspace.uiSourceCodesForProjectType(WebInspector.projectTypes.Network);
-        var urls = uiSourceCodes.map(function(uiSourceCode) { return uiSourceCode.parsedURL.lastPathComponent; });
+        var urls = uiSourceCodes.map(function(uiSourceCode) { return uiSourceCode.name(); });
         urls.sort();
         
         var whiteList = ["debugger-test.js", "dynamic-script.js", "dynamic-scripts.html", "evalSourceURL.js", "inspector-test.js", "scriptElementContentSourceURL.js"];

Modified: trunk/LayoutTests/inspector/debugger/dynamic-scripts.html (143582 => 143583)


--- trunk/LayoutTests/inspector/debugger/dynamic-scripts.html	2013-02-21 11:58:51 UTC (rev 143582)
+++ trunk/LayoutTests/inspector/debugger/dynamic-scripts.html	2013-02-21 12:09:38 UTC (rev 143583)
@@ -49,7 +49,7 @@
     {
         var panel = WebInspector.showPanel("scripts");
         var uiSourceCodes = WebInspector.workspace.uiSourceCodesForProjectType(WebInspector.projectTypes.Network);
-        var urls = uiSourceCodes.map(function(uiSourceCode) { return uiSourceCode.parsedURL.lastPathComponent; });
+        var urls = uiSourceCodes.map(function(uiSourceCode) { return uiSourceCode.name(); });
         urls.sort();
 
         var whiteList = ["debugger-test.js", "dynamic-script.js", "dynamic-scripts.html", "evalSourceURL.js", "inspector-test.js", "scriptElementContentSourceURL.js"];

Modified: trunk/LayoutTests/inspector/debugger/scripts-file-selector-expected.txt (143582 => 143583)


--- trunk/LayoutTests/inspector/debugger/scripts-file-selector-expected.txt	2013-02-21 11:58:51 UTC (rev 143582)
+++ trunk/LayoutTests/inspector/debugger/scripts-file-selector-expected.txt	2013-02-21 12:09:38 UTC (rev 143583)
@@ -2,18 +2,18 @@
 
 Dumping ScriptsNavigator 'Scripts' tab:
   example.com
-  localhost
+  localhost:8080
     LayoutTests/inspector/debugger/foo/bar
     LayoutTests/inspector/debugger/foo/baz
   ?a=b
-  very_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_url
+  very_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo…
 Dumping ScriptsNavigator 'Content scripts' tab:
-  localhost
+  localhost:8080
     LayoutTests/inspector/debugger/foo/bar
 Dumping ScriptsNavigator 'Scripts' tab:
   example.com
     ?a=b
-  localhost
+  localhost:8080
     LayoutTests/inspector/debugger/foo/bar
       script.js
       script.js?a=1
@@ -21,9 +21,9 @@
     LayoutTests/inspector/debugger/foo/baz
       script.js
   ?a=b
-  very_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_url
+  very_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo…
 Dumping ScriptsNavigator 'Content scripts' tab:
-  localhost
+  localhost:8080
     LayoutTests/inspector/debugger/foo/bar
       contentScript.js?a=1
       contentScript.js?a=2

Modified: trunk/LayoutTests/inspector/debugger/source-url-comment.html (143582 => 143583)


--- trunk/LayoutTests/inspector/debugger/source-url-comment.html	2013-02-21 11:58:51 UTC (rev 143582)
+++ trunk/LayoutTests/inspector/debugger/source-url-comment.html	2013-02-21 12:09:38 UTC (rev 143583)
@@ -96,7 +96,7 @@
 
         function testNonRelativeURL(next)
         {
-            InspectorTest.showScriptSource("nonRelativeURL.js", didShowScriptSource);
+            InspectorTest.showScriptSource("/js/nonRelativeURL.js", didShowScriptSource);
             InspectorTest.evaluateInPage("setTimeout(doEvalWithNonRelativeURL, 0)");
 
             function didShowScriptSource(sourceFrame)

Modified: trunk/LayoutTests/inspector/styles/edit-inspector-stylesheet.html (143582 => 143583)


--- trunk/LayoutTests/inspector/styles/edit-inspector-stylesheet.html	2013-02-21 11:58:51 UTC (rev 143582)
+++ trunk/LayoutTests/inspector/styles/edit-inspector-stylesheet.html	2013-02-21 12:09:38 UTC (rev 143583)
@@ -32,7 +32,7 @@
     function step2(sourceFrame)
     {
         var uiSourceCode = sourceFrame._uiSourceCode;
-        InspectorTest.addResult("Inspector stylesheet URL: " + uiSourceCode.parsedURL.displayName);
+        InspectorTest.addResult("Inspector stylesheet URL: " + uiSourceCode.displayName());
         uiSourceCode.requestContent(printContent());
 
         InspectorTest.addResult("\nSetting new content");

Modified: trunk/LayoutTests/inspector/styles/styles-add-new-rule.html (143582 => 143583)


--- trunk/LayoutTests/inspector/styles/styles-add-new-rule.html	2013-02-21 11:58:51 UTC (rev 143582)
+++ trunk/LayoutTests/inspector/styles/styles-add-new-rule.html	2013-02-21 12:09:38 UTC (rev 143583)
@@ -58,7 +58,7 @@
 
     function revisionAdded(revision)
     {
-        InspectorTest.addResult("Revision added: " + this.parsedURL.displayName);
+        InspectorTest.addResult("Revision added: " + this.displayName());
     }
 }
 

Modified: trunk/Source/WebCore/ChangeLog (143582 => 143583)


--- trunk/Source/WebCore/ChangeLog	2013-02-21 11:58:51 UTC (rev 143582)
+++ trunk/Source/WebCore/ChangeLog	2013-02-21 12:09:38 UTC (rev 143583)
@@ -1,3 +1,25 @@
+2013-02-21  Vsevolod Vlasov  <[email protected]>
+
+        Web Inspector: Get rid of parsedURL in uiSourceCode, use name and path for displayName instead.
+        https://bugs.webkit.org/show_bug.cgi?id=110335
+
+        Reviewed by Alexander Pavlov.
+
+        Replaced UISourceCode.parsedURL with UISourceCode.displayName().
+
+        * inspector/front-end/NavigatorView.js:
+        (WebInspector.NavigatorView.prototype._updateScriptTitle):
+        (WebInspector.NavigatorView.prototype.getOrCreateFolderTreeElement):
+        (WebInspector.NavigatorFolderTreeElement):
+        * inspector/front-end/ResourceUtils.js:
+        (WebInspector.displayNameForURL):
+        * inspector/front-end/RevisionHistoryView.js:
+        (WebInspector.RevisionHistoryView.prototype._createUISourceCodeItem):
+        * inspector/front-end/UISourceCode.js:
+        (WebInspector.UISourceCode):
+        (WebInspector.UISourceCode.prototype.displayName):
+        (WebInspector.UISourceCode.prototype.urlChanged):
+
 2013-02-21  Alexander Pavlov  <[email protected]>
 
         Web Inspector: Local/session storage tree items in the Resources panel after page refresh are not shown

Modified: trunk/Source/WebCore/inspector/front-end/NavigatorView.js (143582 => 143583)


--- trunk/Source/WebCore/inspector/front-end/NavigatorView.js	2013-02-21 11:58:51 UTC (rev 143582)
+++ trunk/Source/WebCore/inspector/front-end/NavigatorView.js	2013-02-21 12:09:38 UTC (rev 143583)
@@ -145,13 +145,7 @@
         if (!scriptTreeElement)
             return;
 
-        var titleText;
-        if (uiSourceCode.parsedURL.isValid) {
-            titleText = uiSourceCode.parsedURL.lastPathComponent;
-            if (uiSourceCode.parsedURL.queryParams)
-                titleText += "?" + uiSourceCode.parsedURL.queryParams;
-        } else if (uiSourceCode.parsedURL)
-            titleText = uiSourceCode.parsedURL.url;
+        var titleText = uiSourceCode.name().trimEnd(100);
         if (!titleText)
             titleText = WebInspector.UIString("(program)");
         if (!ignoreIsDirty && uiSourceCode.isDirty())
@@ -326,7 +320,9 @@
      */
     getOrCreateFolderTreeElement: function(uiSourceCode)
     {
-        return this._getOrCreateFolderTreeElement(uiSourceCode.parsedURL.host, uiSourceCode.parsedURL.folderPathComponents);
+        var folders = uiSourceCode.path().slice();
+        folders.pop();
+        return this._getOrCreateFolderTreeElement(uiSourceCode.project().displayName(), folders.join("/"));
     },
 
     /**
@@ -551,7 +547,7 @@
     this._folderName = folderName;
     
     var iconClass = this.isDomain ? "navigator-domain-tree-item" : "navigator-folder-tree-item";
-    var title = this.isDomain ? domain : folderName.substring(1);
+    var title = this.isDomain ? domain : folderName;
 
     WebInspector.BaseNavigatorTreeElement.call(this, title, [iconClass], true);
     this.tooltip = folderName;

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


--- trunk/Source/WebCore/inspector/front-end/ResourceUtils.js	2013-02-21 11:58:51 UTC (rev 143582)
+++ trunk/Source/WebCore/inspector/front-end/ResourceUtils.js	2013-02-21 12:09:38 UTC (rev 143583)
@@ -60,7 +60,7 @@
 
     var uiSourceCode = WebInspector.workspace.uiSourceCodeForURL(url);
     if (uiSourceCode)
-        return uiSourceCode.parsedURL.displayName;
+        return uiSourceCode.displayName();
 
     if (!WebInspector.inspectedPageURL)
         return url.trimURL("");

Modified: trunk/Source/WebCore/inspector/front-end/RevisionHistoryView.js (143582 => 143583)


--- trunk/Source/WebCore/inspector/front-end/RevisionHistoryView.js	2013-02-21 11:58:51 UTC (rev 143582)
+++ trunk/Source/WebCore/inspector/front-end/RevisionHistoryView.js	2013-02-21 12:09:38 UTC (rev 143583)
@@ -81,12 +81,12 @@
      */
     _createUISourceCodeItem: function(uiSourceCode)
     {
-        var uiSourceCodeItem = new TreeElement(uiSourceCode.parsedURL.displayName, null, true);
+        var uiSourceCodeItem = new TreeElement(uiSourceCode.displayName(), null, true);
         uiSourceCodeItem.selectable = false;
 
         // Insert in sorted order
         for (var i = 0; i < this._treeOutline.children.length; ++i) {
-            if (this._treeOutline.children[i].title.localeCompare(uiSourceCode.parsedURL.displayName) > 0) {
+            if (this._treeOutline.children[i].title.localeCompare(uiSourceCode.displayName()) > 0) {
                 this._treeOutline.insertChild(uiSourceCodeItem, i);
                 break;
             }

Modified: trunk/Source/WebCore/inspector/front-end/UISourceCode.js (143582 => 143583)


--- trunk/Source/WebCore/inspector/front-end/UISourceCode.js	2013-02-21 11:58:51 UTC (rev 143582)
+++ trunk/Source/WebCore/inspector/front-end/UISourceCode.js	2013-02-21 12:09:38 UTC (rev 143583)
@@ -45,7 +45,6 @@
     this._path = path;
     this._originURL = originURL;
     this._url = url;
-    this._parsedURL = new WebInspector.ParsedURL(originURL);
     this._contentType = contentType;
     this._isEditable = isEditable;
     /**
@@ -109,6 +108,15 @@
     /**
      * @return {string}
      */
+    displayName: function()
+    {
+        var displayName = this.name() || (this._project.displayName() + "/" + this._path.join("/"));
+        return displayName.trimEnd(100);
+    },
+
+    /**
+     * @return {string}
+     */
     uri: function()
     {
         if (!this._project.id())
@@ -133,19 +141,10 @@
     {
         this._url = url;
         this._originURL = url;
-        this._parsedURL = new WebInspector.ParsedURL(url);
         this.dispatchEventToListeners(WebInspector.UISourceCode.Events.TitleChanged, null);
     },
 
     /**
-     * @return {WebInspector.ParsedURL}
-     */
-    get parsedURL()
-    {
-        return this._parsedURL;
-    },
-
-    /**
      * @return {string}
      */
     contentURL: function()

Modified: trunk/Source/WebKit/chromium/ChangeLog (143582 => 143583)


--- trunk/Source/WebKit/chromium/ChangeLog	2013-02-21 11:58:51 UTC (rev 143582)
+++ trunk/Source/WebKit/chromium/ChangeLog	2013-02-21 12:09:38 UTC (rev 143583)
@@ -1,3 +1,13 @@
+2013-02-21  Vsevolod Vlasov  <[email protected]>
+
+        Web Inspector: Get rid of parsedURL in uiSourceCode, use name and path for displayName instead.
+        https://bugs.webkit.org/show_bug.cgi?id=110335
+
+        Reviewed by Alexander Pavlov.
+
+        * src/js/Tests.js:
+        (.TestSuite.prototype._scriptsAreParsed):
+
 2013-02-21  Ken Kania  <[email protected]>
 
         Web Inspector: Add command for selecting files for file input element

Modified: trunk/Source/WebKit/chromium/src/js/Tests.js (143582 => 143583)


--- trunk/Source/WebKit/chromium/src/js/Tests.js	2013-02-21 11:58:51 UTC (rev 143582)
+++ trunk/Source/WebKit/chromium/src/js/Tests.js	2013-02-21 12:09:38 UTC (rev 143583)
@@ -778,7 +778,7 @@
     var missing = expected.slice(0);
     for (var i = 0; i < uiSourceCodes.length; ++i) {
         for (var j = 0; j < missing.length; ++j) {
-            if (uiSourceCodes[i].parsedURL.lastPathComponent.search(missing[j]) !== -1) {
+            if (uiSourceCodes[i].name().search(missing[j]) !== -1) {
                 missing.splice(j, 1);
                 break;
             }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to