Title: [130391] trunk/Source/WebCore
Revision
130391
Author
[email protected]
Date
2012-10-04 07:56:22 -0700 (Thu, 04 Oct 2012)

Log Message

Web Inspector: Scripts panel should not automatically switch to snippet evaluation when previously evaluated snippet is edited.
https://bugs.webkit.org/show_bug.cgi?id=98402

Reviewed by Pavel Feldman.

Scripts panel does not automatically switch to snippet evaluation when
one edits previously evaluated snippet.

* inspector/front-end/ScriptSnippetModel.js:
(WebInspector.ScriptSnippetModel.prototype._createUISourceCodeForScript):
* inspector/front-end/ScriptsPanel.js:
(WebInspector.ScriptsPanel.prototype._revealExecutionLine):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (130390 => 130391)


--- trunk/Source/WebCore/ChangeLog	2012-10-04 14:45:36 UTC (rev 130390)
+++ trunk/Source/WebCore/ChangeLog	2012-10-04 14:56:22 UTC (rev 130391)
@@ -1,3 +1,18 @@
+2012-10-04  Vsevolod Vlasov  <[email protected]>
+
+        Web Inspector: Scripts panel should not automatically switch to snippet evaluation when previously evaluated snippet is edited.
+        https://bugs.webkit.org/show_bug.cgi?id=98402
+
+        Reviewed by Pavel Feldman.
+
+        Scripts panel does not automatically switch to snippet evaluation when
+        one edits previously evaluated snippet.
+
+        * inspector/front-end/ScriptSnippetModel.js:
+        (WebInspector.ScriptSnippetModel.prototype._createUISourceCodeForScript):
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel.prototype._revealExecutionLine):
+
 2012-10-04  Balazs Kelemen  <[email protected]>
 
         Don't allow to disable compositing in forced compositing mode

Modified: trunk/Source/WebCore/inspector/front-end/ScriptSnippetModel.js (130390 => 130391)


--- trunk/Source/WebCore/inspector/front-end/ScriptSnippetModel.js	2012-10-04 14:45:36 UTC (rev 130390)
+++ trunk/Source/WebCore/inspector/front-end/ScriptSnippetModel.js	2012-10-04 14:56:22 UTC (rev 130391)
@@ -317,7 +317,9 @@
     _createUISourceCodeForScript: function(script)
     {
         var uiSourceCode = new WebInspector._javascript_Source(script.sourceURL, script, false);
-        uiSourceCode.setSourceMapping(this._snippetScriptMapping); 
+        uiSourceCode.setSourceMapping(this._snippetScriptMapping);
+        // FIXME: Should be added to workspace as temporary.
+        uiSourceCode.isTemporary = true;
         uiSourceCode.isSnippetEvaluation = true;
         this._uiSourceCodeForScriptId[script.scriptId] = uiSourceCode;
         this._scriptForUISourceCode.put(uiSourceCode, script);
@@ -358,11 +360,13 @@
         if (!script)
             return;
 
+        snippetJavaScriptSource.isDivergingFromVM = true;
         snippetJavaScriptSource.hasDivergedFromVM = true;
         delete this._uiSourceCodeForScriptId[script.scriptId];
         this._scriptForUISourceCode.remove(snippetJavaScriptSource);
         delete snippetJavaScriptSource._evaluationIndex;
         this._createUISourceCodeForScript(script);
+        delete snippetJavaScriptSource.isDivergingFromVM;
     },
 
     /**

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


--- trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js	2012-10-04 14:45:36 UTC (rev 130390)
+++ trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js	2012-10-04 14:56:22 UTC (rev 130391)
@@ -503,9 +503,14 @@
 
     _revealExecutionLine: function(uiLocation)
     {
+        var uiSourceCode = uiLocation.uiSourceCode;
         // Some scripts (anonymous and snippets evaluations) are not added to files select by default.
-        this._editorContainer.addUISourceCode(uiLocation.uiSourceCode);
-        var sourceFrame = this._showFile(uiLocation.uiSourceCode);
+        if (uiSourceCode.isTemporary) {
+            if (this._currentUISourceCode && this._currentUISourceCode.isDivergingFromVM)
+                return;
+            this._editorContainer.addUISourceCode(uiSourceCode);
+        }
+        var sourceFrame = this._showFile(uiSourceCode);
         sourceFrame.revealLine(uiLocation.lineNumber);
         sourceFrame.focus();
     },
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to