Title: [241740] trunk/Source/WebInspectorUI
Revision
241740
Author
nvasil...@apple.com
Date
2019-02-18 14:45:55 -0800 (Mon, 18 Feb 2019)

Log Message

Web Inspector: Styles: typing ";" shouldn't focus on the next property when there's open parenthesis or comment
https://bugs.webkit.org/show_bug.cgi?id=194789

Reviewed by Matt Baker.

* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype._handleValueBeforeInput):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (241739 => 241740)


--- trunk/Source/WebInspectorUI/ChangeLog	2019-02-18 22:44:06 UTC (rev 241739)
+++ trunk/Source/WebInspectorUI/ChangeLog	2019-02-18 22:45:55 UTC (rev 241740)
@@ -1,3 +1,13 @@
+2019-02-18  Nikita Vasilyev  <nvasil...@apple.com>
+
+        Web Inspector: Styles: typing ";" shouldn't focus on the next property when there's open parenthesis or comment
+        https://bugs.webkit.org/show_bug.cgi?id=194789
+
+        Reviewed by Matt Baker.
+
+        * UserInterface/Views/SpreadsheetStyleProperty.js:
+        (WI.SpreadsheetStyleProperty.prototype._handleValueBeforeInput):
+
 2019-02-18  Joseph Pecoraro  <pecor...@apple.com>
 
         Web Inspector: Better categorize CPU usage per-thread / worker

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js (241739 => 241740)


--- trunk/Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js	2019-02-18 22:44:06 UTC (rev 241739)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js	2019-02-18 22:45:55 UTC (rev 241740)
@@ -727,20 +727,8 @@
         if (!selection.rangeCount || selection.getRangeAt(0).endOffset !== text.length)
             return;
 
-        // Find the first and last index (if any) of a quote character to ensure that the string
-        // doesn't contain unbalanced quotes. If so, then there's no way that the semicolon could be
-        // part of a string within the value, so we can assume that it's the property "terminator".
-        const quoteRegex = /["']/g;
-        let start = -1;
-        let end = text.length;
-        let match = null;
-        while (match = quoteRegex.exec(text)) {
-            if (start < 0)
-                start = match.index;
-            end = match.index + 1;
-        }
-
-        if (start !== -1 && !text.substring(start, end).hasMatchingEscapedQuotes())
+        let unbalancedCharacters = WI.CSSCompletions.completeUnbalancedValue(text);
+        if (unbalancedCharacters)
             return;
 
         event.preventDefault();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to