Title: [200565] trunk/Source/WebInspectorUI
Revision
200565
Author
[email protected]
Date
2016-05-08 16:55:53 -0700 (Sun, 08 May 2016)

Log Message

Web Inspector: SourceCodeTextEditor issue widgets/line styles should reset when log is cleared
https://bugs.webkit.org/show_bug.cgi?id=157460
<rdar://problem/26159633>

Reviewed by Timothy Hatcher.

* UserInterface/Views/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor):
(WebInspector.SourceCodeTextEditor.prototype._logCleared):
Clear issue widgets and CodeMirror line class names when log cleared.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (200564 => 200565)


--- trunk/Source/WebInspectorUI/ChangeLog	2016-05-08 23:03:48 UTC (rev 200564)
+++ trunk/Source/WebInspectorUI/ChangeLog	2016-05-08 23:55:53 UTC (rev 200565)
@@ -1,3 +1,16 @@
+2016-05-08  Matt Baker  <[email protected]>
+
+        Web Inspector: SourceCodeTextEditor issue widgets/line styles should reset when log is cleared
+        https://bugs.webkit.org/show_bug.cgi?id=157460
+        <rdar://problem/26159633>
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Views/SourceCodeTextEditor.js:
+        (WebInspector.SourceCodeTextEditor):
+        (WebInspector.SourceCodeTextEditor.prototype._logCleared):
+        Clear issue widgets and CodeMirror line class names when log cleared.
+
 2016-05-06  Joseph Pecoraro  <[email protected]>
 
         Web Inspector: Inspect Element and Element Selection searching should work with Shadow DOM Nodes

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js (200564 => 200565)


--- trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js	2016-05-08 23:03:48 UTC (rev 200564)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js	2016-05-08 23:55:53 UTC (rev 200565)
@@ -85,6 +85,8 @@
         // FIXME: Cmd+L shortcut doesn't actually work.
         new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Command, "L", this.showGoToLineDialog.bind(this), this.element);
         new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Control, "G", this.showGoToLineDialog.bind(this), this.element);
+
+        WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.Cleared, this._logCleared, this);
     }
 
     // Public
@@ -1798,6 +1800,17 @@
 
         return scrollHandler.bind(this);
     }
+
+    _logCleared(event)
+    {
+        for (let lineNumber of this._issuesLineNumberMap.keys()) {
+            this.removeStyleClassFromLine(lineNumber, WebInspector.SourceCodeTextEditor.LineErrorStyleClassName);
+            this.removeStyleClassFromLine(lineNumber, WebInspector.SourceCodeTextEditor.LineWarningStyleClassName);
+        }
+
+        this._issuesLineNumberMap.clear();
+        this._clearWidgets();
+    }
 };
 
 WebInspector.SourceCodeTextEditor.LineErrorStyleClassName = "error";
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to