Changeset 86745 in webkit


Ignore:
Timestamp:
May 18, 2011 2:45:17 AM (13 years ago)
Author:
pfeldman@chromium.org
Message:

2011-05-18 Pavel Feldman <pfeldman@google.com>

Reviewed by Yury Semikhatsky.

Web Inspector: do not reveal line -1 when navigating to anchor without line specified.
https://bugs.webkit.org/show_bug.cgi?id=60971

  • inspector/front-end/ResourcesPanel.js: (WebInspector.ResourcesPanel.prototype.showAnchorLocation):
  • inspector/front-end/ScriptsPanel.js: (WebInspector.ScriptsPanel.prototype.showAnchorLocation.): (WebInspector.ScriptsPanel.prototype.showAnchorLocation):
  • inspector/front-end/inspector.js: (WebInspector._showAnchorLocation):
Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r86744 r86745  
     12011-05-18  Pavel Feldman  <pfeldman@google.com>
     2
     3        Reviewed by Yury Semikhatsky.
     4
     5        Web Inspector: do not reveal line -1 when navigating to anchor without line specified.
     6        https://bugs.webkit.org/show_bug.cgi?id=60971
     7
     8        * inspector/front-end/ResourcesPanel.js:
     9        (WebInspector.ResourcesPanel.prototype.showAnchorLocation):
     10        * inspector/front-end/ScriptsPanel.js:
     11        (WebInspector.ScriptsPanel.prototype.showAnchorLocation.):
     12        (WebInspector.ScriptsPanel.prototype.showAnchorLocation):
     13        * inspector/front-end/inspector.js:
     14        (WebInspector._showAnchorLocation):
     15
    1162011-05-18  Kent Tamura  <tkent@chromium.org>
    217
  • trunk/Source/WebCore/inspector/front-end/ResourcesPanel.js

    r86562 r86745  
    351351            return;
    352352        }
    353         this.showResource(resource, anchor.getAttribute("line_number") - 1);
     353        var lineNumber = parseInt(anchor.getAttribute("line_number"));
     354        this.showResource(resource, lineNumber !== NaN ? lineNumber - 1 : undefined);
    354355    },
    355356
  • trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js

    r86539 r86745  
    517517    showAnchorLocation: function(anchor)
    518518    {
    519         function didRequestSourceMapping(mapping)
    520         {
    521             var lineNumber = mapping.scriptLocationToSourceLine({lineNumber:anchor.getAttribute("line_number") - 1, columnNumber:0});
    522             this._showSourceLine(sourceFile.id, lineNumber);
    523         }
    524519        var sourceFile = this._presentationModel.sourceFileForScriptURL(anchor.href);
    525         sourceFile.requestSourceMapping(didRequestSourceMapping.bind(this));
     520        var anchorLineNumber = parseInt(anchor.getAttribute("line_number"));
     521        if (anchorLineNumber !== NaN) {
     522            function didRequestSourceMapping(mapping)
     523            {
     524                var lineNumber = mapping.scriptLocationToSourceLine({ lineNumber: anchorLineNumber - 1, columnNumber: 0 });
     525                this._showSourceLine(sourceFile.id, lineNumber);
     526            }
     527            sourceFile.requestSourceMapping(didRequestSourceMapping.bind(this));
     528            return;
     529        }
     530        this._showSourceFrameAndAddToHistory(sourceFile.id);
    526531    },
    527532
  • trunk/Source/WebCore/inspector/front-end/inspector.js

    r86672 r86745  
    11711171WebInspector._showAnchorLocation = function(anchor)
    11721172{
    1173     var preferedPanel = this.panels[anchor.getAttribute("preferred_panel") || "resources"];
     1173    var preferedPanel = this.panels[anchor.getAttribute("preferred_panel") || "scripts"];
    11741174    if (WebInspector._showAnchorLocationInPanel(anchor, preferedPanel))
    11751175        return true;
Note: See TracChangeset for help on using the changeset viewer.