[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198

podivilov at chromium.org podivilov at chromium.org
Sun Feb 20 22:47:05 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit 6d3919a1802c07cc98a0e5bf057dd5f8b8eaa3c1
Author: podivilov at chromium.org <podivilov at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jan 11 14:37:24 2011 +0000

    2011-01-11  Pavel Podivilov  <podivilov at chromium.org>
    
            Reviewed by Pavel Feldman.
    
            Web Inspector: recreate script view after live edit.
            https://bugs.webkit.org/show_bug.cgi?id=51751
    
            * inspector/front-end/Script.js:
            (WebInspector.Script.prototype.set source):
            * inspector/front-end/ScriptView.js:
            (WebInspector.ScriptView):
            * inspector/front-end/ScriptsPanel.js:
            (WebInspector.ScriptsPanel.prototype.editScriptSource.mycallback):
            (WebInspector.ScriptsPanel.prototype.editScriptSource):
            (WebInspector.ScriptsPanel.prototype.viewRecreated):
            * inspector/front-end/SourceFrame.js:
            (WebInspector.SourceFrame.prototype._doEditLine):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75500 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 1a07c65..0441eb8 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -2,6 +2,24 @@
 
         Reviewed by Pavel Feldman.
 
+        Web Inspector: recreate script view after live edit.
+        https://bugs.webkit.org/show_bug.cgi?id=51751
+
+        * inspector/front-end/Script.js:
+        (WebInspector.Script.prototype.set source):
+        * inspector/front-end/ScriptView.js:
+        (WebInspector.ScriptView):
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel.prototype.editScriptSource.mycallback):
+        (WebInspector.ScriptsPanel.prototype.editScriptSource):
+        (WebInspector.ScriptsPanel.prototype.viewRecreated):
+        * inspector/front-end/SourceFrame.js:
+        (WebInspector.SourceFrame.prototype._doEditLine):
+
+2011-01-11  Pavel Podivilov  <podivilov at chromium.org>
+
+        Reviewed by Pavel Feldman.
+
         Web Inspector: frameDetachedFromParent notification handler is missing in NetworkManager.
         https://bugs.webkit.org/show_bug.cgi?id=52205
 
diff --git a/Source/WebCore/inspector/front-end/Script.js b/Source/WebCore/inspector/front-end/Script.js
index 184fe97..527dd9d 100644
--- a/Source/WebCore/inspector/front-end/Script.js
+++ b/Source/WebCore/inspector/front-end/Script.js
@@ -57,10 +57,6 @@ WebInspector.Script.WorldType = {
     EXTENSIONS_WORLD: 1
 }
 
-WebInspector.Script.Events = {
-    SourceChanged: "source-changed"
-}
-
 WebInspector.Script.prototype = {
     get linesCount()
     {
@@ -85,8 +81,5 @@ WebInspector.Script.prototype = {
     set source(source)
     {
         this._source = source;
-        this.dispatchEventToListeners(WebInspector.Script.Events.SourceChanged);
     }
 }
-
-WebInspector.Script.prototype.__proto__ = WebInspector.Object.prototype;
diff --git a/Source/WebCore/inspector/front-end/ScriptView.js b/Source/WebCore/inspector/front-end/ScriptView.js
index 39dae55..f135475 100644
--- a/Source/WebCore/inspector/front-end/ScriptView.js
+++ b/Source/WebCore/inspector/front-end/ScriptView.js
@@ -30,7 +30,6 @@ WebInspector.ScriptView = function(script)
     this.element.addStyleClass("script-view");
 
     this.script = script;
-    this.script.addEventListener(WebInspector.Script.Events.SourceChanged, this._scriptSourceChanged, this);
 
     this._frameNeedsSetup = true;
     this._sourceFrameSetup = false;
@@ -85,11 +84,6 @@ WebInspector.ScriptView.prototype = {
             document.getElementById("script-resource-views").appendChild(this.element);
     },
 
-    _scriptSourceChanged: function(event)
-    {
-        this.sourceFrame.updateContent(this._prependWhitespace(this.script.source));
-    },
-
     // The following methods are pulled from SourceView, since they are
     // generic and work with ScriptView just fine.
 
diff --git a/Source/WebCore/inspector/front-end/ScriptsPanel.js b/Source/WebCore/inspector/front-end/ScriptsPanel.js
index 18c7cc8..a04970e 100644
--- a/Source/WebCore/inspector/front-end/ScriptsPanel.js
+++ b/Source/WebCore/inspector/front-end/ScriptsPanel.js
@@ -292,7 +292,7 @@ WebInspector.ScriptsPanel.prototype = {
         return Preferences.canEditScriptSource;
     },
 
-    editScriptSource: function(editData, commitEditingCallback, cancelEditingCallback)
+    editScriptSource: function(editData, revertEditingCallback, cancelEditingCallback)
     {
         if (!this.canEditScripts())
             return;
@@ -305,7 +305,16 @@ WebInspector.ScriptsPanel.prototype = {
         function mycallback(success, newBodyOrErrorMessage, callFrames)
         {
             if (success) {
-                commitEditingCallback(newBodyOrErrorMessage);
+                var script = WebInspector.debuggerModel.scriptForSourceID(editData.sourceID);
+                script.source = newBodyOrErrorMessage;
+                var oldView = script._scriptView
+                if (oldView) {
+                    script._scriptView = new WebInspector.ScriptView(script);
+                    this.viewRecreated(oldView, script._scriptView);
+                }
+                if (script.resource)
+                    script.resource.setContent(newBodyOrErrorMessage, revertEditingCallback);
+
                 if (callFrames && callFrames.length)
                     this._debuggerPaused({ data: { callFrames: callFrames } });
             } else {
@@ -460,8 +469,8 @@ WebInspector.ScriptsPanel.prototype = {
 
     viewRecreated: function(oldView, newView)
     {
-        if (this._visibleView === oldView)
-            this._visibleView = newView;
+        if (this.visibleView === oldView)
+            this.visibleView = newView;
     },
 
     canShowSourceLine: function(url, line)
diff --git a/Source/WebCore/inspector/front-end/SourceFrame.js b/Source/WebCore/inspector/front-end/SourceFrame.js
index f4df0f9..74cc85c 100644
--- a/Source/WebCore/inspector/front-end/SourceFrame.js
+++ b/Source/WebCore/inspector/front-end/SourceFrame.js
@@ -148,11 +148,6 @@ WebInspector.SourceFrame.prototype = {
         this._createViewerIfNeeded();
     },
 
-    updateContent: function(content)
-    {
-        this._textModel.setText(null, content);
-    },
-
     get textModel()
     {
         return this._textModel;
@@ -835,16 +830,7 @@ WebInspector.SourceFrame.prototype = {
     _doEditLine: function(editData, cancelEditingCallback)
     {
         var revertEditingCallback = this._revertEditLine.bind(this, editData);
-        var commitEditingCallback = this._commitEditLine.bind(this, editData, revertEditingCallback);
-        WebInspector.panels.scripts.editScriptSource(editData, commitEditingCallback, cancelEditingCallback);
-    },
-
-    _commitEditLine: function(editData, revertEditLineCallback, newContent)
-    {
-        var script = this._scripts[editData.sourceID];
-        script.source = newContent;
-        if (script.resource)
-            script.resource.setContent(newContent, revertEditLineCallback);
+        WebInspector.panels.scripts.editScriptSource(editData, revertEditingCallback, cancelEditingCallback);
     },
 
     _setBreakpoint: function(lineNumber, enabled, condition)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list