Title: [153091] trunk/Source/WebInspectorUI
Revision
153091
Author
grao...@apple.com
Date
2013-07-24 11:28:40 -0700 (Wed, 24 Jul 2013)

Log Message

Web Inspector: control+clicking on a numeric token should not show the context menu
https://bugs.webkit.org/show_bug.cgi?id=119048

Reviewed by Timothy Hatcher.

Track "contextmenu" events when we're hovering a token containing a numeric value
and call preventDefault() in the event handler to ensure that the context menu does
not appear.

* UserInterface/CodeMirrorDragToAlterNumberController.js:
(WebInspector.CodeMirrorDragToAlterNumberController.prototype.handleEvent):
(WebInspector.CodeMirrorDragToAlterNumberController.prototype._setTracksMouseClickAndDrag):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (153090 => 153091)


--- trunk/Source/WebInspectorUI/ChangeLog	2013-07-24 18:11:19 UTC (rev 153090)
+++ trunk/Source/WebInspectorUI/ChangeLog	2013-07-24 18:28:40 UTC (rev 153091)
@@ -1,5 +1,20 @@
 2013-07-24  Antoine Quint  <grao...@apple.com>
 
+        Web Inspector: control+clicking on a numeric token should not show the context menu
+        https://bugs.webkit.org/show_bug.cgi?id=119048
+
+        Reviewed by Timothy Hatcher.
+
+        Track "contextmenu" events when we're hovering a token containing a numeric value
+        and call preventDefault() in the event handler to ensure that the context menu does
+        not appear.
+
+        * UserInterface/CodeMirrorDragToAlterNumberController.js:
+        (WebInspector.CodeMirrorDragToAlterNumberController.prototype.handleEvent):
+        (WebInspector.CodeMirrorDragToAlterNumberController.prototype._setTracksMouseClickAndDrag):
+
+2013-07-24  Antoine Quint  <grao...@apple.com>
+
         Web Inspector: support click-and-drag editing of CSS numeric values
         https://bugs.webkit.org/show_bug.cgi?id=118896
 

Modified: trunk/Source/WebInspectorUI/UserInterface/CodeMirrorDragToAlterNumberController.js (153090 => 153091)


--- trunk/Source/WebInspectorUI/UserInterface/CodeMirrorDragToAlterNumberController.js	2013-07-24 18:11:19 UTC (rev 153090)
+++ trunk/Source/WebInspectorUI/UserInterface/CodeMirrorDragToAlterNumberController.js	2013-07-24 18:28:40 UTC (rev 153091)
@@ -80,6 +80,9 @@
         case "mouseup":
             this._mouseWasReleased(event);
             break;
+        case "contextmenu":
+            event.preventDefault();
+            break;
         }
     },
 
@@ -125,9 +128,11 @@
         if (tracksMouseClickAndDrag) {
             this._element.classList.add(WebInspector.CodeMirrorDragToAlterNumberController.StyleClassName);
             window.addEventListener("mousedown", this, true);
+            window.addEventListener("contextmenu", this, true);
         } else {
             this._element.classList.remove(WebInspector.CodeMirrorDragToAlterNumberController.StyleClassName);
             window.removeEventListener("mousedown", this, true);
+            window.removeEventListener("contextmenu", this, true);
             this._setDragging(false);
         }
         
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to