Title: [239808] branches/safari-607-branch/Source/WebInspectorUI
Revision
239808
Author
[email protected]
Date
2019-01-09 17:38:36 -0800 (Wed, 09 Jan 2019)

Log Message

Cherry-pick r239766. rdar://problem/47158780

    Web Inspector: Styles: clicking on property that soon to be discarded shouldn't start selection
    https://bugs.webkit.org/show_bug.cgi?id=193218
    <rdar://problem/47098303>

    Reviewed by Devin Rousso.

    * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
    (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleMouseDown):
    A style property may get removed on blur event, so propertyElement may get removed from the DOM right when mousedown event happens.

    (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleWindowClick):
    (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleClick):
    (WI.SpreadsheetCSSStyleDeclarationSection.prototype._stopSelection):

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

Modified Paths

Diff

Modified: branches/safari-607-branch/Source/WebInspectorUI/ChangeLog (239807 => 239808)


--- branches/safari-607-branch/Source/WebInspectorUI/ChangeLog	2019-01-10 01:38:34 UTC (rev 239807)
+++ branches/safari-607-branch/Source/WebInspectorUI/ChangeLog	2019-01-10 01:38:36 UTC (rev 239808)
@@ -1,5 +1,42 @@
 2019-01-09  Kocsen Chung  <[email protected]>
 
+        Cherry-pick r239766. rdar://problem/47158780
+
+    Web Inspector: Styles: clicking on property that soon to be discarded shouldn't start selection
+    https://bugs.webkit.org/show_bug.cgi?id=193218
+    <rdar://problem/47098303>
+    
+    Reviewed by Devin Rousso.
+    
+    * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
+    (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleMouseDown):
+    A style property may get removed on blur event, so propertyElement may get removed from the DOM right when mousedown event happens.
+    
+    (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleWindowClick):
+    (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleClick):
+    (WI.SpreadsheetCSSStyleDeclarationSection.prototype._stopSelection):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239766 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-01-09  Nikita Vasilyev  <[email protected]>
+
+            Web Inspector: Styles: clicking on property that soon to be discarded shouldn't start selection
+            https://bugs.webkit.org/show_bug.cgi?id=193218
+            <rdar://problem/47098303>
+
+            Reviewed by Devin Rousso.
+
+            * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
+            (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleMouseDown):
+            A style property may get removed on blur event, so propertyElement may get removed from the DOM right when mousedown event happens.
+
+            (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleWindowClick):
+            (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleClick):
+            (WI.SpreadsheetCSSStyleDeclarationSection.prototype._stopSelection):
+
+2019-01-09  Kocsen Chung  <[email protected]>
+
         Cherry-pick r239762. rdar://problem/47158734
 
     Web Inspector: Styles: Undo reverts all changes at once

Modified: branches/safari-607-branch/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js (239807 => 239808)


--- branches/safari-607-branch/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js	2019-01-10 01:38:34 UTC (rev 239807)
+++ branches/safari-607-branch/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js	2019-01-10 01:38:36 UTC (rev 239808)
@@ -407,8 +407,11 @@
         else
             this._propertiesEditor.deselectProperties();
 
-        this._mouseDownIndex = propertyIndex;
-        this._element.classList.add("selecting");
+        if (propertyElement.parentNode) {
+            this._mouseDownIndex = propertyIndex;
+            this._element.classList.add("selecting");
+        } else
+            this._stopSelection();
     }
 
     _handleWindowClick(event)
@@ -417,15 +420,13 @@
             // Don't start editing name/value if there's selection.
             event.stop();
         }
-
-        this._isMousePressed = false;
-        this._mouseDownIndex = NaN;
-
-        this._element.classList.remove("selecting");
+        this._stopSelection();
     }
 
     _handleClick(event)
     {
+        this._stopSelection();
+
         if (this._wasEditing || this._propertiesEditor.hasSelectedProperties())
             return;
 
@@ -451,6 +452,13 @@
         }
     }
 
+    _stopSelection()
+    {
+        this._isMousePressed = false;
+        this._mouseDownIndex = NaN;
+        this._element.classList.remove("selecting");
+    }
+
     _highlightNodesWithSelector()
     {
         if (!this._style.ownerRule) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to