Title: [197245] trunk/Source/WebInspectorUI
Revision
197245
Author
[email protected]
Date
2016-02-26 23:44:29 -0800 (Fri, 26 Feb 2016)

Log Message

Web Inspector: Increase clickable area of the console prompt
https://bugs.webkit.org/show_bug.cgi?id=154719
<rdar://problem/24854538>

Reviewed by Timothy Hatcher.

Clicking on the area around CodeMirror element now moves
focus to the console prompt.

* UserInterface/Views/QuickConsole.js:
(WebInspector.QuickConsole.prototype._handleMouseDown):
Only capture mousedown events on .quick-console.
Don't capture clicks on CodeMirror.

* UserInterface/Views/QuickConsole.css:
(.quick-console > .console-prompt):
(.quick-console > .console-prompt > .CodeMirror):
Make sure .console-prompt is never an event.target for _handleMouseDown.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (197244 => 197245)


--- trunk/Source/WebInspectorUI/ChangeLog	2016-02-27 07:44:07 UTC (rev 197244)
+++ trunk/Source/WebInspectorUI/ChangeLog	2016-02-27 07:44:29 UTC (rev 197245)
@@ -1,3 +1,24 @@
+2016-02-26  Nikita Vasilyev  <[email protected]>
+
+        Web Inspector: Increase clickable area of the console prompt
+        https://bugs.webkit.org/show_bug.cgi?id=154719
+        <rdar://problem/24854538>
+
+        Reviewed by Timothy Hatcher.
+
+        Clicking on the area around CodeMirror element now moves
+        focus to the console prompt.
+
+        * UserInterface/Views/QuickConsole.js:
+        (WebInspector.QuickConsole.prototype._handleMouseDown):
+        Only capture mousedown events on .quick-console.
+        Don't capture clicks on CodeMirror.
+
+        * UserInterface/Views/QuickConsole.css:
+        (.quick-console > .console-prompt):
+        (.quick-console > .console-prompt > .CodeMirror):
+        Make sure .console-prompt is never an event.target for _handleMouseDown.
+
 2016-02-26  Joseph Pecoraro  <[email protected]>
 
         Web Inspector: Remove unused member variables from overview graphs

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.css (197244 => 197245)


--- trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.css	2016-02-27 07:44:07 UTC (rev 197244)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.css	2016-02-27 07:44:29 UTC (rev 197245)
@@ -54,6 +54,7 @@
 
     overflow-y: auto;
     overflow-x: hidden;
+    pointer-events: none;
 }
 
 .quick-console > .console-prompt::before {
@@ -72,7 +73,8 @@
 }
 
 .quick-console > .console-prompt > .CodeMirror {
-    margin: 4px 0 1px;
+    pointer-events: all;
+    margin: 4px 0 2px;
 }
 
 .quick-console > .navigation-bar {

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.js (197244 => 197245)


--- trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.js	2016-02-27 07:44:07 UTC (rev 197244)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.js	2016-02-27 07:44:29 UTC (rev 197245)
@@ -39,6 +39,7 @@
         this._frameIdentifierToExecutionContextPathComponentMap = {};
 
         this.element.classList.add("quick-console");
+        this.element.addEventListener("mousedown", this._handleMouseDown.bind(this));
 
         this.prompt = new WebInspector.ConsolePrompt(null, "text/_javascript_");
         this.prompt.element.classList.add("text-prompt");
@@ -104,6 +105,15 @@
 
     // Private
 
+    _handleMouseDown(event)
+    {
+        if (event.target !== this.element)
+            return;
+
+        event.preventDefault();
+        this.prompt.focus();
+    }
+
     _executionContextPathComponentsToDisplay()
     {
         // If we are in the debugger the console will use the active call frame, don't show the selector.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to