Web Inspector: TextEditor scroll position not correctly restored when switching tabs
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Jun 2015 00:27:29 +0000 (00:27 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Jun 2015 00:27:29 +0000 (00:27 +0000)
https://bugs.webkit.org/show_bug.cgi?id=146254

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-06-23
Reviewed by Timothy Hatcher.

* UserInterface/Views/TextEditor.js:
(WebInspector.TextEditor.prototype.updateLayout):
Workaround a larger issue with ContentView restoration so that
TextEditors restore their scroll position as expected.

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

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

index b5c8d02..786bfec 100644 (file)
@@ -1,5 +1,17 @@
 2015-06-23  Joseph Pecoraro  <pecoraro@apple.com>
 
+        Web Inspector: TextEditor scroll position not correctly restored when switching tabs
+        https://bugs.webkit.org/show_bug.cgi?id=146254
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Views/TextEditor.js:
+        (WebInspector.TextEditor.prototype.updateLayout):
+        Workaround a larger issue with ContentView restoration so that
+        TextEditors restore their scroll position as expected.
+
+2015-06-23  Joseph Pecoraro  <pecoraro@apple.com>
+
         Web Inspector: Some brief previews are incorrectly treated as lossless
         https://bugs.webkit.org/show_bug.cgi?id=146247
 
index d335743..38f38f7 100644 (file)
@@ -506,7 +506,11 @@ WebInspector.TextEditor = class TextEditor extends WebInspector.Object
 
     updateLayout(force)
     {
-        this._codeMirror.refresh();
+        // FIXME: <https://webkit.org/b/146256> Web Inspector: Nested ContentBrowsers / ContentViewContainers cause too many ContentView updates
+        // Ideally we would not get an updateLayout call if we are not visible. We should restructure ContentView
+        // show/hide restoration to reduce duplicated work and solve this in the process.
+        if (this._visible)
+            this._codeMirror.refresh();
     }
 
     shown()