[webkit-reviews] review granted: [Bug 198806] Web Inspector: REGRESSION(r246178): extra space inserted before pseudo-selector after a closing parenthesis : [Attachment 372026] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jun 13 12:29:47 PDT 2019


Joseph Pecoraro <joepeck at webkit.org> has granted Devin Rousso
<drousso at apple.com>'s request for review:
Bug 198806: Web Inspector: REGRESSION(r246178): extra space inserted before
pseudo-selector after a closing parenthesis
https://bugs.webkit.org/show_bug.cgi?id=198806

Attachment 372026: Patch

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




--- Comment #3 from Joseph Pecoraro <joepeck at webkit.org> ---
Comment on attachment 372026
  --> https://bugs.webkit.org/attachment.cgi?id=372026
Patch

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

rs=me

> Source/WebInspectorUI/UserInterface/Workers/Formatter/CSSFormatter.js:85
> +		   let re = new RegExp(`^\\s*@[a-zA-Z][-a-zA-Z]+${suffix}`);

Seems like we may be building these regexes over and over again, which could be
bad for performance.

> Source/WebInspectorUI/UserInterface/Workers/Formatter/CSSFormatter.js:86
> +		   return re.test(this._builder.currentLine);

What if this isn't on the same line?

    @media
    (...)
    { ... }

> Source/WebInspectorUI/UserInterface/Workers/Formatter/CSSFormatter.js:89
> +	       let inSelector = (suffix = "") => {

`suffix` is unused.


More information about the webkit-reviews mailing list