Title: [92688] trunk
Revision
92688
Author
[email protected]
Date
2011-08-09 09:09:00 -0700 (Tue, 09 Aug 2011)

Log Message

Web Inspector: files from different domains are mixed in the file selector in Scripts panel
https://bugs.webkit.org/show_bug.cgi?id=65601

Reviewed by Yury Semikhatsky.

Source/WebCore:

* inspector/front-end/ScriptsPanel.js:
(WebInspector.ScriptsPanel.prototype._addOptionToFilesSelect):
(WebInspector.ScriptsPanel.prototype._folderAndDisplayNameForScriptURL):
(WebInspector.ScriptsPanel.prototype.reset):
* inspector/front-end/inspector.css:
(select.status-bar-item):

LayoutTests:

* inspector/debugger/scripts-panel-expected.txt:
* platform/chromium/inspector/debugger/scripts-sorting-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (92687 => 92688)


--- trunk/LayoutTests/ChangeLog	2011-08-09 15:22:16 UTC (rev 92687)
+++ trunk/LayoutTests/ChangeLog	2011-08-09 16:09:00 UTC (rev 92688)
@@ -1,5 +1,15 @@
 2011-08-09  Pavel Feldman  <[email protected]>
 
+        Web Inspector: files from different domains are mixed in the file selector in Scripts panel
+        https://bugs.webkit.org/show_bug.cgi?id=65601
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/debugger/scripts-panel-expected.txt:
+        * platform/chromium/inspector/debugger/scripts-sorting-expected.txt:
+
+2011-08-09  Pavel Feldman  <[email protected]>
+
         Not reviewed: fix inspector tests
 
         * inspector/styles/show-user-agent-styles.html:

Modified: trunk/LayoutTests/inspector/debugger/scripts-panel-expected.txt (92687 => 92688)


--- trunk/LayoutTests/inspector/debugger/scripts-panel-expected.txt	2011-08-09 15:22:16 UTC (rev 92687)
+++ trunk/LayoutTests/inspector/debugger/scripts-panel-expected.txt	2011-08-09 16:09:00 UTC (rev 92688)
@@ -10,18 +10,19 @@
 Page reloaded.
 
 Running: testFilesSelect
-text:     ?a=b, tooltip: ?a=b
-text:     ?a=b, tooltip: http://example.com/?a=b
-text:     …oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_url, tooltip: very_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_url
+text:         ?a=b, tooltip: ?a=b
+text:         …oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_url, tooltip: very_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_url
+text: example.com, tooltip: 
+text:         ?a=b, tooltip: http://example.com/?a=b
 text: LayoutTests/inspector/debugger/foo/bar, tooltip: 
-text:     script.js, tooltip: <root>/foo/bar/script.js
-text:     script.js?a=1, tooltip: <root>/foo/bar/script.js?a=1
-text:     script.js?a=2, tooltip: <root>/foo/bar/script.js?a=2
+text:         script.js, tooltip: <root>/foo/bar/script.js
+text:         script.js?a=1, tooltip: <root>/foo/bar/script.js?a=1
+text:         script.js?a=2, tooltip: <root>/foo/bar/script.js?a=2
 text: LayoutTests/inspector/debugger/foo/baz, tooltip: 
-text:     script.js, tooltip: <root>/foo/baz/script.js
+text:         script.js, tooltip: <root>/foo/baz/script.js
 text: Content scripts, tooltip: 
-text:     contentScript.js?a=1, tooltip: <root>/foo/bar/contentScript.js?a=1
-text:     contentScript.js?a=2, tooltip: <root>/foo/bar/contentScript.js?a=2
-text:     contentScript2.js?a=1, tooltip: <root>/foo/bar/contentScript2.js?a=1
+text:         contentScript.js?a=1, tooltip: <root>/foo/bar/contentScript.js?a=1
+text:         contentScript.js?a=2, tooltip: <root>/foo/bar/contentScript.js?a=2
+text:         contentScript2.js?a=1, tooltip: <root>/foo/bar/contentScript2.js?a=1
 Debugger was disabled.
 

Modified: trunk/LayoutTests/platform/chromium/inspector/debugger/scripts-sorting-expected.txt (92687 => 92688)


--- trunk/LayoutTests/platform/chromium/inspector/debugger/scripts-sorting-expected.txt	2011-08-09 15:22:16 UTC (rev 92687)
+++ trunk/LayoutTests/platform/chromium/inspector/debugger/scripts-sorting-expected.txt	2011-08-09 16:09:00 UTC (rev 92688)
@@ -1,18 +1,19 @@
 Tests scripts sorting in the scripts panel.
 
 Debugger was enabled.
-    *Non*URL*path
-    block.js?block=foo
-    ga.js
-    lenta.ban?pg=4883&ifr=1
-    lenta.ban?pg=5309&ifr=1
-    top100.jcn?80674
-/_js/production
-    motor.js?1308927432
-/i
-    xgemius.js
-/i/js
-    jquery-1.5.1.min.js
-    jquery.cookie.js
+        *Non*URL*path
+foo.com
+        block.js?block=foo
+        ga.js
+        lenta.ban?pg=4883&ifr=1
+        lenta.ban?pg=5309&ifr=1
+        top100.jcn?80674
+    /_js/production
+        motor.js?1308927432
+    /i
+        xgemius.js
+    /i/js
+        jquery-1.5.1.min.js
+        jquery.cookie.js
 Debugger was disabled.
 

Modified: trunk/Source/WebCore/ChangeLog (92687 => 92688)


--- trunk/Source/WebCore/ChangeLog	2011-08-09 15:22:16 UTC (rev 92687)
+++ trunk/Source/WebCore/ChangeLog	2011-08-09 16:09:00 UTC (rev 92688)
@@ -1,5 +1,19 @@
 2011-08-09  Pavel Feldman  <[email protected]>
 
+        Web Inspector: files from different domains are mixed in the file selector in Scripts panel
+        https://bugs.webkit.org/show_bug.cgi?id=65601
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel.prototype._addOptionToFilesSelect):
+        (WebInspector.ScriptsPanel.prototype._folderAndDisplayNameForScriptURL):
+        (WebInspector.ScriptsPanel.prototype.reset):
+        * inspector/front-end/inspector.css:
+        (select.status-bar-item):
+
+2011-08-09  Pavel Feldman  <[email protected]>
+
         Web Inspector: provide a way to hide user agent styles
         https://bugs.webkit.org/show_bug.cgi?id=37766
 

Modified: trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js (92687 => 92688)


--- trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js	2011-08-09 15:22:16 UTC (rev 92687)
+++ trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js	2011-08-09 16:09:00 UTC (rev 92688)
@@ -255,6 +255,8 @@
     _addOptionToFilesSelect: function(sourceFile)
     {
         var select = this._filesSelectElement;
+        if (!select.domainOptions)
+            select.domainOptions = {};
         if (!select.folderOptions)
             select.folderOptions = {};
 
@@ -262,9 +264,16 @@
         var parsedURL = sourceFile.url.asParsedURL();
 
         var names = this._folderAndDisplayNameForScriptURL(sourceFile.url);
-        option.text = names.displayName ? "\u00a0\u00a0\u00a0\u00a0" + names.displayName : WebInspector.UIString("(program)");
+        const indent = "\u00a0\u00a0\u00a0\u00a0";
+        option.text = names.displayName ? indent + indent + names.displayName : WebInspector.UIString("(program)");
         option.scriptNameForTest = names.displayName;
-        var folderNameForSorting = (sourceFile.isContentScript ? "2" : "0") + names.folderName;
+
+        var folderNameForSorting;
+        if (sourceFile.isContentScript)
+            folderNameForSorting = "2:" + names.folderName;
+        else
+            folderNameForSorting = "0:" + (names.domain ? names.domain + "\t\t" : "") + names.folderName;
+
         option.nameForSorting = folderNameForSorting + "\t/\t" + names.displayName; // Use '\t' to make files stick to their folder.
         option.title = sourceFile.url;
         if (sourceFile.isContentScript)
@@ -291,9 +300,18 @@
             insertOrdered(contentScriptSection);
         }
 
+        if (!sourceFile.isContentScript && names.domain && !select.domainOptions[names.domain]) {
+            var domainOption = document.createElement("option");
+            domainOption.text = names.domain;
+            domainOption.nameForSorting = "0:" + names.domain;
+            domainOption.disabled = true;
+            select.domainOptions[names.domain] = domainOption;
+            insertOrdered(domainOption);
+        }
+
         if (names.folderName && !select.folderOptions[names.folderName]) {
             var folderOption = document.createElement("option");
-            folderOption.text = names.folderName;
+            folderOption.text = indent + names.folderName;
             folderOption.nameForSorting = folderNameForSorting;
             folderOption.disabled = true;
             select.folderOptions[names.folderName] = folderOption;
@@ -325,7 +343,7 @@
         if (folderName.length > 80)
             folderName = "\u2026" + folderName.substring(folderName.length - 80);
 
-        return { folderName: folderName, displayName: displayName};
+        return { domain: (parsedURL ? parsedURL.host : ""), folderName: folderName, displayName: displayName };
     },
 
     setScriptSourceIsBeingEdited: function(sourceFileId, inEditMode)
@@ -513,6 +531,7 @@
         this._sourceFileIdToFilesSelectOption = {};
         this._filesSelectElement.removeChildren();
         this._filesSelectElement.removeChildren();
+        this._filesSelectElement.domainOptions = {};
         this._filesSelectElement.folderOptions = {};
         delete this._filesSelectElement.initialSelectionProcessed;
         delete this._filesSelectElement.contentScriptSection;

Modified: trunk/Source/WebCore/inspector/front-end/inspector.css (92687 => 92688)


--- trunk/Source/WebCore/inspector/front-end/inspector.css	2011-08-09 15:22:16 UTC (rev 92687)
+++ trunk/Source/WebCore/inspector/front-end/inspector.css	2011-08-09 16:09:00 UTC (rev 92688)
@@ -491,7 +491,7 @@
 select.status-bar-item {
     min-width: 48px;
     border-width: 0 17px 0 2px;
-    padding: 0 2px 0 6px;
+    padding: 0 2px 0 0;
     font-weight: bold;
     color: rgb(48, 48, 48);
     text-shadow: rgba(255, 255, 255, 0.75) 0 1px 0;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to