Title: [188378] trunk/Source/WebInspectorUI
Revision
188378
Author
[email protected]
Date
2015-08-12 22:51:38 -0700 (Wed, 12 Aug 2015)

Log Message

Web Inspector: Sometimes CSS resources don't update after editing via Styles panel
https://bugs.webkit.org/show_bug.cgi?id=143244

Reviewed by Timothy Hatcher.

* UserInterface/Models/SourceCode.js:
(WebInspector.SourceCode.prototype._processContent):
This code is brittle and we should move off of putting the
possibly stale content in the Promise result.

* UserInterface/Views/ResourceContentView.js:
(WebInspector.ResourceContentView.prototype._contentAvailable):
* UserInterface/Views/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor.prototype._contentAvailable):
* UserInterface/Models/Script.js:
(WebInspector.Script.prototype.requestScriptSyntaxTree):
Use the current source code's content.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (188377 => 188378)


--- trunk/Source/WebInspectorUI/ChangeLog	2015-08-13 05:36:21 UTC (rev 188377)
+++ trunk/Source/WebInspectorUI/ChangeLog	2015-08-13 05:51:38 UTC (rev 188378)
@@ -1,5 +1,25 @@
 2015-08-12  Joseph Pecoraro  <[email protected]>
 
+        Web Inspector: Sometimes CSS resources don't update after editing via Styles panel
+        https://bugs.webkit.org/show_bug.cgi?id=143244
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Models/SourceCode.js:
+        (WebInspector.SourceCode.prototype._processContent):
+        This code is brittle and we should move off of putting the
+        possibly stale content in the Promise result.
+
+        * UserInterface/Views/ResourceContentView.js:
+        (WebInspector.ResourceContentView.prototype._contentAvailable):
+        * UserInterface/Views/SourceCodeTextEditor.js:
+        (WebInspector.SourceCodeTextEditor.prototype._contentAvailable):
+        * UserInterface/Models/Script.js:
+        (WebInspector.Script.prototype.requestScriptSyntaxTree):
+        Use the current source code's content.
+
+2015-08-12  Joseph Pecoraro  <[email protected]>
+
         Web Inspector: Fix Poor Class Names
         https://bugs.webkit.org/show_bug.cgi?id=147958
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Models/Script.js (188377 => 188378)


--- trunk/Source/WebInspectorUI/UserInterface/Models/Script.js	2015-08-13 05:36:21 UTC (rev 188377)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/Script.js	2015-08-13 05:51:38 UTC (rev 188378)
@@ -149,7 +149,7 @@
         }
 
         this.requestContent().then(function(parameters) {
-            makeSyntaxTreeAndCallCallback(parameters.content);
+            makeSyntaxTreeAndCallCallback(parameters.sourceCode.content);
         }).catch(function(error) {
             makeSyntaxTreeAndCallCallback(null);
         });

Modified: trunk/Source/WebInspectorUI/UserInterface/Models/SourceCode.js (188377 => 188378)


--- trunk/Source/WebInspectorUI/UserInterface/Models/SourceCode.js	2015-08-13 05:36:21 UTC (rev 188377)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/SourceCode.js	2015-08-13 05:51:38 UTC (rev 188378)
@@ -189,8 +189,12 @@
 
         this._ignoreRevisionContentDidChangeEvent = true;
         revision.content = content || null;
-        delete this._ignoreRevisionContentDidChangeEvent;
+        this._ignoreRevisionContentDidChangeEvent = false;
 
+        // FIXME: Returning the content in this promise is misleading. It may not be current content
+        // now, and it may become out-dated later on. We should drop content from this promise
+        // and require clients to ask for the current contents from the sourceCode in the result.
+
         return Promise.resolve({
             error,
             sourceCode: this,

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ResourceContentView.js (188377 => 188378)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ResourceContentView.js	2015-08-13 05:36:21 UTC (rev 188377)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ResourceContentView.js	2015-08-13 05:51:38 UTC (rev 188378)
@@ -91,7 +91,8 @@
 
         // Content is ready to show, call the public method now.
         console.assert(!this._hasContent());
-        this.contentAvailable(parameters.content, parameters.base64Encoded);
+        console.assert(parameters.sourceCode === this._resource);
+        this.contentAvailable(parameters.sourceCode.content, parameters.base64Encoded);
     }
 
     _contentError(error)

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js (188377 => 188378)


--- trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js	2015-08-13 05:36:21 UTC (rev 188377)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js	2015-08-13 05:51:38 UTC (rev 188378)
@@ -451,7 +451,7 @@
             return;
 
         var sourceCode = parameters.sourceCode;
-        var content = parameters.content;
+        var content = sourceCode.content;
         var base64Encoded = parameters.base64Encoded;
 
         console.assert(sourceCode === this._sourceCode);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to