Reviewed by Mark Rowe.
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Nov 2007 01:39:28 +0000 (01:39 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Nov 2007 01:39:28 +0000 (01:39 +0000)
        Prevent selecting a word in the breadcrumb or the styles section when double
        clicking on a DOM node in the outline tree.

        * page/inspector/DocumentPanel.js: Call preventDefault() when a mousedown event
          with a detail of 2 or higher comes in. This prevents the selection.
        * page/inspector/inspector.css: Mark the breadcrumb as user-select: none.

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

WebCore/ChangeLog
WebCore/page/inspector/DocumentPanel.js
WebCore/page/inspector/inspector.css

index 3514c23fe44317593b3f0057d7635911a22279d6..cd2ee169a00e8de68c053b57ca4d5efec4609ead 100644 (file)
@@ -1,3 +1,14 @@
+2007-11-12  Timothy Hatcher  <timothy@apple.com>
+
+        Reviewed by Mark Rowe.
+
+        Prevent selecting a word in the breadcrumb or the styles section when double
+        clicking on a DOM node in the outline tree.
+
+        * page/inspector/DocumentPanel.js: Call preventDefault() when a mousedown event
+          with a detail of 2 or higher comes in. This prevents the selection.
+        * page/inspector/inspector.css: Mark the breadcrumb as user-select: none.
+
 2007-11-12  Oliver Hunt  <oliver@apple.com>
 
         Reviewed by Darin and Antti.
index 67ae286c149d019e4c5154f278571e4e9a9c23ba..45471191b084fcb5935e1d50d87d2e627c4e9b4a 100644 (file)
@@ -439,6 +439,12 @@ WebInspector.DOMNodeTreeElement.prototype = {
         this.selectionElement.style.height = listItemElement.offsetHeight + "px";
     },
 
+    onattach: function()
+    {
+        var element = this;
+        this.listItemElement.addEventListener("mousedown", function(event) { element.onmousedown(event) }, false);
+    },
+
     onpopulate: function()
     {
         if (this.children.length || this.whitespaceIgnored !== Preferences.ignoreWhitespace)
@@ -490,6 +496,13 @@ WebInspector.DOMNodeTreeElement.prototype = {
         setTimeout(function() { element.updateSelection() }, 0);
     },
 
+    onmousedown: function(event)
+    {
+        // Prevent selecting the nearest word on double click.
+        if (event.detail >= 2)
+            event.preventDefault();
+    },
+
     ondblclick: function()
     {
         var panel = this.treeOutline.panel;
index 838f7e81acd1584cad7adc42fa02b19dda2321c5..b73bce826387e5575e660baf2af53f3b6bda5a7e 100644 (file)
@@ -818,6 +818,7 @@ body.inactive #sidebar li.selected {
 }
 
 .crumbs {
+    -webkit-user-select: none;
     -webkit-box-sizing: border-box;
     position: absolute;
     left: 0;