[webkit-reviews] review denied: [Bug 179587] Web Inspector: Styles Redesign: can't add new property after property without trailing semicolon : [Attachment 327689] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Nov 28 15:05:33 PST 2017


Timothy Hatcher <timothy at hatcher.name> has denied Nikita Vasilyev
<nvasilyev at apple.com>'s request for review:
Bug 179587: Web Inspector: Styles Redesign: can't add new property after
property without trailing semicolon
https://bugs.webkit.org/show_bug.cgi?id=179587

Attachment 327689: Patch

https://bugs.webkit.org/attachment.cgi?id=327689&action=review




--- Comment #5 from Timothy Hatcher <timothy at hatcher.name> ---
Comment on attachment 327689
  --> https://bugs.webkit.org/attachment.cgi?id=327689
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=327689&action=review

> Source/WebInspectorUI/UserInterface/Models/CSSProperty.js:382
> +	   let trimmedText = styleText.trimRight();
> +	   if (!trimmedText)
> +	       return styleText;
> +
> +	   if (trimmedText.slice(-1) === ";")

Trimming and slicing just to look for ";" seems expensive to me. Consider using
`lastIndexOf` instead.

> Source/WebInspectorUI/UserInterface/Models/CSSProperty.js:384
> +	   else

No need for this else after a return.

> Source/WebInspectorUI/UserInterface/Models/CSSProperty.js:385
> +	       return styleText + ";";

Add a space with the semicolon too?


More information about the webkit-reviews mailing list