Fixes a bug where the line highlight and the execution line were conflicting.
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Jun 2008 16:40:07 +0000 (16:40 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Jun 2008 16:40:07 +0000 (16:40 +0000)
        The line highlight no longer shows up when the execution line changes, only
        when showResource or showScript is called with a line number.

        Reviewed by Darin Adler.

        * page/inspector/ScriptsPanel.js:
        (WebInspector.ScriptsPanel.prototype.showScript): Pass true for shouldHighlightLine.
        (WebInspector.ScriptsPanel.prototype.showResource): Ditto.
        (WebInspector.ScriptsPanel.prototype._showScriptOrResource): Added a shouldHighlightLine
        argument that triggers the highlightLine() call on the SourceFrame.
        (WebInspector.ScriptsPanel.prototype._goBack): Pass false for shouldHighlightLine since
        we need to pass true for fromBackForwardAction.
        (WebInspector.ScriptsPanel.prototype._goForward): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@34307 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/page/inspector/ScriptsPanel.js

index 4b3ff45..1258719 100644 (file)
@@ -1,5 +1,22 @@
 2008-06-02  Timothy Hatcher  <timothy@apple.com>
 
+        Fixes a bug where the line highlight and the execution line were conflicting.
+        The line highlight no longer shows up when the execution line changes, only
+        when showResource or showScript is called with a line number.
+
+        Reviewed by Darin Adler.
+
+        * page/inspector/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel.prototype.showScript): Pass true for shouldHighlightLine.
+        (WebInspector.ScriptsPanel.prototype.showResource): Ditto.
+        (WebInspector.ScriptsPanel.prototype._showScriptOrResource): Added a shouldHighlightLine
+        argument that triggers the highlightLine() call on the SourceFrame.
+        (WebInspector.ScriptsPanel.prototype._goBack): Pass false for shouldHighlightLine since
+        we need to pass true for fromBackForwardAction.
+        (WebInspector.ScriptsPanel.prototype._goForward): Ditto.
+
+2008-06-02  Timothy Hatcher  <timothy@apple.com>
+
         Bring the Web Inspector forward when the debugger pauses.
 
         https://bugs.webkit.org/show_bug.cgi?id=19095
index d24e6f7..018c3f4 100644 (file)
@@ -377,12 +377,12 @@ WebInspector.ScriptsPanel.prototype = {
 
     showScript: function(script, line)
     {
-        this._showScriptOrResource(script, line);
+        this._showScriptOrResource(script, line, true);
     },
 
     showResource: function(resource, line)
     {
-        this._showScriptOrResource(resource, line);
+        this._showScriptOrResource(resource, line, true);
     },
 
     scriptViewForScript: function(script)
@@ -416,7 +416,7 @@ WebInspector.ScriptsPanel.prototype = {
             return this.sourceFrameForScript(scriptOrResource);
     },
 
-    _showScriptOrResource: function(scriptOrResource, line, fromBackForwardAction)
+    _showScriptOrResource: function(scriptOrResource, line, shouldHighlightLine, fromBackForwardAction)
     {
         if (!scriptOrResource)
             return;
@@ -465,7 +465,7 @@ WebInspector.ScriptsPanel.prototype = {
         if (line) {
             if (view.revealLine)
                 view.revealLine(line);
-            if (view.highlightLine)
+            if (view.highlightLine && shouldHighlightLine)
                 view.highlightLine(line);
         }
 
@@ -648,7 +648,7 @@ WebInspector.ScriptsPanel.prototype = {
             return;
         }
 
-        this._showScriptOrResource(this._backForwardList[--this._currentBackForwardIndex], null, true);
+        this._showScriptOrResource(this._backForwardList[--this._currentBackForwardIndex], null, false, true);
         this._updateBackAndForwardButtons();
     },
 
@@ -659,7 +659,7 @@ WebInspector.ScriptsPanel.prototype = {
             return;
         }
 
-        this._showScriptOrResource(this._backForwardList[++this._currentBackForwardIndex], null, true);
+        this._showScriptOrResource(this._backForwardList[++this._currentBackForwardIndex], null, false, true);
         this._updateBackAndForwardButtons();
     },