REGRESSION(r?): Web Inspector: Clicking on text doesn't move text caret when editing...
authormattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Jan 2019 22:17:49 +0000 (22:17 +0000)
committermattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Jan 2019 22:17:49 +0000 (22:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=192652
<rdar://problem/46684612>

Reviewed by Devin Rousso.

* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype.canSelectOnMouseDown):
Call to Event.preventDefault() should be made here instead of at the
TreeOutline level.

* UserInterface/Views/TreeElement.js:
(WI.TreeElement.prototype.selectOnMouseDown): Deleted.
Remove dead code.

* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline._handleMouseDown):
Do not prevent default event handling when the item cannot be selected.
This matches TreeOutline behavior prior to introducing SelectionController.

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

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js
Source/WebInspectorUI/UserInterface/Views/TreeElement.js
Source/WebInspectorUI/UserInterface/Views/TreeOutline.js

index 964298f..b20eeef 100644 (file)
@@ -1,3 +1,25 @@
+2019-01-31  Matt Baker  <mattbaker@apple.com>
+
+        REGRESSION(r?): Web Inspector: Clicking on text doesn't move text caret when editing innerHTML/tagName/attribute
+        https://bugs.webkit.org/show_bug.cgi?id=192652
+        <rdar://problem/46684612>
+
+        Reviewed by Devin Rousso.
+
+        * UserInterface/Views/DOMTreeElement.js:
+        (WI.DOMTreeElement.prototype.canSelectOnMouseDown):
+        Call to Event.preventDefault() should be made here instead of at the
+        TreeOutline level.
+
+        * UserInterface/Views/TreeElement.js:
+        (WI.TreeElement.prototype.selectOnMouseDown): Deleted.
+        Remove dead code.
+
+        * UserInterface/Views/TreeOutline.js:
+        (WI.TreeOutline._handleMouseDown):
+        Do not prevent default event handling when the item cannot be selected.
+        This matches TreeOutline behavior prior to introducing SelectionController.
+
 2019-01-30  Devin Rousso  <drousso@apple.com>
 
         Web Inspector: Memory Timeline View should be responsive / resizable
index 27b0419..4d22f6b 100644 (file)
@@ -646,8 +646,10 @@ WI.DOMTreeElement = class DOMTreeElement extends WI.TreeElement
             return false;
 
         // Prevent selecting the nearest word on double click.
-        if (event.detail >= 2)
+        if (event.detail >= 2) {
+            event.preventDefault();
             return false;
+        }
 
         return true;
     }
index 7af8839..d3b8929 100644 (file)
@@ -490,14 +490,6 @@ WI.TreeElement = class TreeElement extends WI.Object
         return true;
     }
 
-    selectOnMouseDown(event)
-    {
-        if (!this.treeOutline.selectable)
-            return;
-
-        this.select(false, true);
-    }
-
     select(omitFocus, selectedByUser, suppressNotification)
     {
         if (!this.treeOutline || !this.selectable)
index 02cd7b4..3f78cd5 100644 (file)
@@ -1012,10 +1012,8 @@ WI.TreeOutline = class TreeOutline extends WI.Object
             return;
         }
 
-        if (!treeElement.canSelectOnMouseDown(event)) {
-            event.preventDefault();
+        if (!treeElement.canSelectOnMouseDown(event))
             return;
-        }
 
         let index = this._indexOfTreeElement(treeElement);
         if (isNaN(index))