RESOLVED FIXED 198806
Web Inspector: REGRESSION(r246178): extra spaces added in at-rules when formatting CSS
https://bugs.webkit.org/show_bug.cgi?id=198806
Summary Web Inspector: REGRESSION(r246178): extra spaces added in at-rules when forma...
Devin Rousso
Reported 2019-06-12 14:31:12 PDT
.pagination .page-numbers:not(.current, .dots):hover { --- becomes --- .pagination .page-numbers:not(.current, .dots) :hover {
Attachments
Patch (20.30 KB, patch)
2019-06-13 00:06 PDT, Devin Rousso
no flags
Patch (22.88 KB, patch)
2019-06-13 18:38 PDT, Devin Rousso
no flags
Archive of layout-test-results from ews211 for win-future (13.97 MB, application/zip)
2019-06-13 22:21 PDT, EWS Watchlist
no flags
Devin Rousso
Comment 1 2019-06-13 00:00:09 PDT
*** Bug 198807 has been marked as a duplicate of this bug. ***
Devin Rousso
Comment 2 2019-06-13 00:06:47 PDT
Created attachment 372026 [details] Patch This could use a better explanation, but I'm too tired right now, so I'll do it later :(
Joseph Pecoraro
Comment 3 2019-06-13 12:29:47 PDT
Comment on attachment 372026 [details] 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.
Devin Rousso
Comment 4 2019-06-13 17:14:12 PDT
Comment on attachment 372026 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=372026&action=review >> Source/WebInspectorUI/UserInterface/Workers/Formatter/CSSFormatter.js:86 >> + return re.test(this._builder.currentLine); > > What if this isn't on the same line? > > @media > (...) > { ... } `currentLine` refers to the last line of the `FormatterContentBuilder`, so basically everything up to the character `c` after the last `appendNewline`.
Devin Rousso
Comment 5 2019-06-13 18:38:04 PDT
EWS Watchlist
Comment 6 2019-06-13 22:21:40 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 7 2019-06-13 22:21:42 PDT Comment hidden (obsolete)
WebKit Commit Bot
Comment 8 2019-06-13 23:52:13 PDT
Comment on attachment 372092 [details] Patch Clearing flags on attachment: 372092 Committed r246430: <https://trac.webkit.org/changeset/246430>
WebKit Commit Bot
Comment 9 2019-06-13 23:52:15 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 10 2019-06-13 23:53:21 PDT
Note You need to log in before you can comment on or make changes to this bug.