Web Inspector: Styles: it shouldn't be possible to delete read-only properties
authornvasilyev@apple.com <nvasilyev@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Jan 2019 04:05:04 +0000 (04:05 +0000)
committernvasilyev@apple.com <nvasilyev@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Jan 2019 04:05:04 +0000 (04:05 +0000)
https://bugs.webkit.org/show_bug.cgi?id=193099
<rdar://problem/47016335>

Reviewed by Devin Rousso.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor):
Drive-by: Forward Delete should work the same way as Delete (Backspace).
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239585 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js

index 044b0d5..f204a10 100644 (file)
@@ -1,3 +1,15 @@
+2019-01-02  Nikita Vasilyev  <nvasilyev@apple.com>
+
+        Web Inspector: Styles: it shouldn't be possible to delete read-only properties
+        https://bugs.webkit.org/show_bug.cgi?id=193099
+        <rdar://problem/47016335>
+
+        Reviewed by Devin Rousso.
+
+        * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
+        (WI.SpreadsheetCSSStyleDeclarationEditor):
+        Drive-by: Forward Delete should work the same way as Delete (Backspace).
+
 2019-01-02  Devin Rousso  <webkit@devinrousso.com>
 
         Web Inspector: Implement `queryObjects` Command Line API
index e6cdb90..2411bfe 100644 (file)
@@ -533,7 +533,10 @@ WI.SpreadsheetCSSStyleDeclarationEditor = class SpreadsheetCSSStyleDeclarationEd
                 event.stop();
                 property.startEditingName();
             }
-        } else if (event.key === "Backspace") {
+        } else if (event.key === "Backspace" || event.key === "Delete") {
+            if (!this.style.editable)
+                return;
+
             let [startIndex, endIndex] = this.selectionRange;
 
             let propertyIndexToSelect = NaN;