Changeset 92688 in webkit


Ignore:
Timestamp:
Aug 9, 2011 9:09:00 AM (13 years ago)
Author:
pfeldman@chromium.org
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:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r92687 r92688  
     12011-08-09  Pavel Feldman  <pfeldman@google.com>
     2
     3        Web Inspector: files from different domains are mixed in the file selector in Scripts panel
     4        https://bugs.webkit.org/show_bug.cgi?id=65601
     5
     6        Reviewed by Yury Semikhatsky.
     7
     8        * inspector/debugger/scripts-panel-expected.txt:
     9        * platform/chromium/inspector/debugger/scripts-sorting-expected.txt:
     10
    1112011-08-09  Pavel Feldman  <pfeldman@google.com>
    212
  • trunk/LayoutTests/inspector/debugger/scripts-panel-expected.txt

    r92185 r92688  
    1111
    1212Running: testFilesSelect
    13 text:     ?a=b, tooltip: ?a=b
    14 text:     ?a=b, tooltip: http://example.com/?a=b
    15 text:     …oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_url, tooltip: very_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_url
     13text:         ?a=b, tooltip: ?a=b
     14text:         …oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_url, tooltip: very_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_url
     15text: example.com, tooltip:
     16text:         ?a=b, tooltip: http://example.com/?a=b
    1617text: LayoutTests/inspector/debugger/foo/bar, tooltip:
    17 text:     script.js, tooltip: <root>/foo/bar/script.js
    18 text:     script.js?a=1, tooltip: <root>/foo/bar/script.js?a=1
    19 text:     script.js?a=2, tooltip: <root>/foo/bar/script.js?a=2
     18text:         script.js, tooltip: <root>/foo/bar/script.js
     19text:         script.js?a=1, tooltip: <root>/foo/bar/script.js?a=1
     20text:         script.js?a=2, tooltip: <root>/foo/bar/script.js?a=2
    2021text: LayoutTests/inspector/debugger/foo/baz, tooltip:
    21 text:     script.js, tooltip: <root>/foo/baz/script.js
     22text:         script.js, tooltip: <root>/foo/baz/script.js
    2223text: Content scripts, tooltip:
    23 text:     contentScript.js?a=1, tooltip: <root>/foo/bar/contentScript.js?a=1
    24 text:     contentScript.js?a=2, tooltip: <root>/foo/bar/contentScript.js?a=2
    25 text:     contentScript2.js?a=1, tooltip: <root>/foo/bar/contentScript2.js?a=1
     24text:         contentScript.js?a=1, tooltip: <root>/foo/bar/contentScript.js?a=1
     25text:         contentScript.js?a=2, tooltip: <root>/foo/bar/contentScript.js?a=2
     26text:         contentScript2.js?a=1, tooltip: <root>/foo/bar/contentScript2.js?a=1
    2627Debugger was disabled.
    2728
  • trunk/LayoutTests/platform/chromium/inspector/debugger/scripts-sorting-expected.txt

    r92185 r92688  
    22
    33Debugger was enabled.
    4     *Non*URL*path
    5     block.js?block=foo
    6     ga.js
    7     lenta.ban?pg=4883&ifr=1
    8     lenta.ban?pg=5309&ifr=1
    9     top100.jcn?80674
    10 /_js/production
    11     motor.js?1308927432
    12 /i
    13     xgemius.js
    14 /i/js
    15     jquery-1.5.1.min.js
    16     jquery.cookie.js
     4        *Non*URL*path
     5foo.com
     6        block.js?block=foo
     7        ga.js
     8        lenta.ban?pg=4883&ifr=1
     9        lenta.ban?pg=5309&ifr=1
     10        top100.jcn?80674
     11    /_js/production
     12        motor.js?1308927432
     13    /i
     14        xgemius.js
     15    /i/js
     16        jquery-1.5.1.min.js
     17        jquery.cookie.js
    1718Debugger was disabled.
    1819
  • trunk/Source/WebCore/ChangeLog

    r92682 r92688  
     12011-08-09  Pavel Feldman  <pfeldman@google.com>
     2
     3        Web Inspector: files from different domains are mixed in the file selector in Scripts panel
     4        https://bugs.webkit.org/show_bug.cgi?id=65601
     5
     6        Reviewed by Yury Semikhatsky.
     7
     8        * inspector/front-end/ScriptsPanel.js:
     9        (WebInspector.ScriptsPanel.prototype._addOptionToFilesSelect):
     10        (WebInspector.ScriptsPanel.prototype._folderAndDisplayNameForScriptURL):
     11        (WebInspector.ScriptsPanel.prototype.reset):
     12        * inspector/front-end/inspector.css:
     13        (select.status-bar-item):
     14
    1152011-08-09  Pavel Feldman  <pfeldman@google.com>
    216
  • trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js

    r92598 r92688  
    256256    {
    257257        var select = this._filesSelectElement;
     258        if (!select.domainOptions)
     259            select.domainOptions = {};
    258260        if (!select.folderOptions)
    259261            select.folderOptions = {};
     
    263265
    264266        var names = this._folderAndDisplayNameForScriptURL(sourceFile.url);
    265         option.text = names.displayName ? "\u00a0\u00a0\u00a0\u00a0" + names.displayName : WebInspector.UIString("(program)");
     267        const indent = "\u00a0\u00a0\u00a0\u00a0";
     268        option.text = names.displayName ? indent + indent + names.displayName : WebInspector.UIString("(program)");
    266269        option.scriptNameForTest = names.displayName;
    267         var folderNameForSorting = (sourceFile.isContentScript ? "2" : "0") + names.folderName;
     270
     271        var folderNameForSorting;
     272        if (sourceFile.isContentScript)
     273            folderNameForSorting = "2:" + names.folderName;
     274        else
     275            folderNameForSorting = "0:" + (names.domain ? names.domain + "\t\t" : "") + names.folderName;
     276
    268277        option.nameForSorting = folderNameForSorting + "\t/\t" + names.displayName; // Use '\t' to make files stick to their folder.
    269278        option.title = sourceFile.url;
     
    292301        }
    293302
     303        if (!sourceFile.isContentScript && names.domain && !select.domainOptions[names.domain]) {
     304            var domainOption = document.createElement("option");
     305            domainOption.text = names.domain;
     306            domainOption.nameForSorting = "0:" + names.domain;
     307            domainOption.disabled = true;
     308            select.domainOptions[names.domain] = domainOption;
     309            insertOrdered(domainOption);
     310        }
     311
    294312        if (names.folderName && !select.folderOptions[names.folderName]) {
    295313            var folderOption = document.createElement("option");
    296             folderOption.text = names.folderName;
     314            folderOption.text = indent + names.folderName;
    297315            folderOption.nameForSorting = folderNameForSorting;
    298316            folderOption.disabled = true;
     
    326344            folderName = "\u2026" + folderName.substring(folderName.length - 80);
    327345
    328         return { folderName: folderName, displayName: displayName};
     346        return { domain: (parsedURL ? parsedURL.host : ""), folderName: folderName, displayName: displayName };
    329347    },
    330348
     
    514532        this._filesSelectElement.removeChildren();
    515533        this._filesSelectElement.removeChildren();
     534        this._filesSelectElement.domainOptions = {};
    516535        this._filesSelectElement.folderOptions = {};
    517536        delete this._filesSelectElement.initialSelectionProcessed;
  • trunk/Source/WebCore/inspector/front-end/inspector.css

    r92671 r92688  
    492492    min-width: 48px;
    493493    border-width: 0 17px 0 2px;
    494     padding: 0 2px 0 6px;
     494    padding: 0 2px 0 0;
    495495    font-weight: bold;
    496496    color: rgb(48, 48, 48);
Note: See TracChangeset for help on using the changeset viewer.