Title: [269201] trunk/Source/WebInspectorUI
Revision
269201
Author
nvasil...@apple.com
Date
2020-10-30 11:06:27 -0700 (Fri, 30 Oct 2020)

Log Message

Web Inspector: Extra closing parenthesis added after var in styles panel
https://bugs.webkit.org/show_bug.cgi?id=218295
<rdar://problem/70771314>

Reviewed by Devin Rousso.

* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype._addVariableTokens):
Remove `contents.push(token)` which was adding `)`. The closing parenthesis that was already
included in rawTokens above.
Drive-by: rawTokens.slice() should never include `i` as the 2nd argument. `i` is an index of an item
in the `tokens` - a different array.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (269200 => 269201)


--- trunk/Source/WebInspectorUI/ChangeLog	2020-10-30 17:42:47 UTC (rev 269200)
+++ trunk/Source/WebInspectorUI/ChangeLog	2020-10-30 18:06:27 UTC (rev 269201)
@@ -1,3 +1,18 @@
+2020-10-30  Nikita Vasilyev  <nvasil...@apple.com>
+
+        Web Inspector: Extra closing parenthesis added after var in styles panel
+        https://bugs.webkit.org/show_bug.cgi?id=218295
+        <rdar://problem/70771314>
+
+        Reviewed by Devin Rousso.
+
+        * UserInterface/Views/SpreadsheetStyleProperty.js:
+        (WI.SpreadsheetStyleProperty.prototype._addVariableTokens):
+        Remove `contents.push(token)` which was adding `)`. The closing parenthesis that was already
+        included in rawTokens above.
+        Drive-by: rawTokens.slice() should never include `i` as the 2nd argument. `i` is an index of an item
+        in the `tokens` - a different array.
+
 2020-10-29  Federico Bucchi  <fbuc...@apple.com>
 
         Web Inspector: Uncaught Exception: undefined is not an object (evaluating 'value.truncate')

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js (269200 => 269201)


--- trunk/Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js	2020-10-30 17:42:47 UTC (rev 269200)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js	2020-10-30 18:06:27 UTC (rev 269201)
@@ -814,7 +814,7 @@
                     if (fallbackStartIndex !== -1) {
                         contents.pushAll(rawTokens.slice(variableNameIndex + 1, fallbackStartIndex));
 
-                        let fallbackTokens = rawTokens.slice(fallbackStartIndex, i);
+                        let fallbackTokens = rawTokens.slice(fallbackStartIndex);
                         fallbackTokens = this._addBoxShadowTokens(fallbackTokens);
                         fallbackTokens = this._addGradientTokens(fallbackTokens);
                         fallbackTokens = this._addColorTokens(fallbackTokens);
@@ -823,8 +823,7 @@
                         fallbackTokens = this._addVariableTokens(fallbackTokens);
                         contents.pushAll(fallbackTokens);
                     } else
-                        contents.pushAll(rawTokens.slice(variableNameIndex + 1, i));
-                    contents.push(token);
+                        contents.pushAll(rawTokens.slice(variableNameIndex + 1));
 
                     let text = rawTokens.reduce((accumulator, token) => accumulator + token.value, "");
                     if (this._property.ownerStyle.nodeStyles.computedStyle.resolveVariableValue(text))
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to