Web Inspector: Reduce work during resizing
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 24 Sep 2017 18:55:03 +0000 (18:55 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 24 Sep 2017 18:55:03 +0000 (18:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=177402

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-09-24
Reviewed by Matt Baker.

* UserInterface/Views/ConsolePrompt.js:
(WI.ConsolePrompt.prototype.layout):
In the most common case there is no text so avoid doing work in CodeMirror.

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

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/ConsolePrompt.js

index e8a340a..25f4c28 100644 (file)
@@ -1,3 +1,14 @@
+2017-09-24  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: Reduce work during resizing
+        https://bugs.webkit.org/show_bug.cgi?id=177402
+
+        Reviewed by Matt Baker.
+
+        * UserInterface/Views/ConsolePrompt.js:
+        (WI.ConsolePrompt.prototype.layout):
+        In the most common case there is no text so avoid doing work in CodeMirror.
+
 2017-09-22  Matt Baker  <mattbaker@apple.com>
 
         Web Inspector: Remove SidebarPanel show/hide and added/removed
index bfbd74a..6503bf3 100644 (file)
@@ -144,7 +144,8 @@ WI.ConsolePrompt = class ConsolePrompt extends WI.View
 
     layout()
     {
-        this._codeMirror.refresh();
+        if (this.layoutReason === WI.View.LayoutReason.Resize && this.text)
+            this._codeMirror.refresh();
     }
 
     // Private