Web Inspector: CSS Formatter: comments with an escape character aren't formatted
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 3 Aug 2019 08:52:53 +0000 (08:52 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 3 Aug 2019 08:52:53 +0000 (08:52 +0000)
commitb0095c8ccd5ad3373f594bd63be140a9c1b6e95f
tree925c89b02b56535e76fa0848edf75c961a94fff5
parent89f17523803fdd209125d7e76bddf6e56b574483
Web Inspector: CSS Formatter: comments with an escape character aren't formatted
https://bugs.webkit.org/show_bug.cgi?id=200168

Reviewed by Joseph Pecoraro.

Source/WebInspectorUI:

Don't allow escaping of the "*" in CSS comments (e.g. `\*/`).

Add additional pretty printing rules for comments so that there's always some space between
them and the surrounding text. This ensures that they don't interfere with readability.

* UserInterface/Workers/Formatter/CSSFormatter.js:
(CSSFormatter.prototype._format):

* UserInterface/Workers/Formatter/FormatterContentBuilder.js:
(FormatterContentBuilder.prototype.get indented): Added.

LayoutTests:

* inspector/formatting/formatting-css.html:
* inspector/formatting/formatting-css-expected.txt:
* inspector/formatting/resources/css-tests/comment.css: Added.
* inspector/formatting/resources/css-tests/comment-expected.css: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/inspector/formatting/formatting-css-expected.txt
LayoutTests/inspector/formatting/formatting-css.html
LayoutTests/inspector/formatting/resources/css-tests/comment-expected.css [new file with mode: 0644]
LayoutTests/inspector/formatting/resources/css-tests/comment.css [new file with mode: 0644]
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Workers/Formatter/CSSFormatter.js
Source/WebInspectorUI/UserInterface/Workers/Formatter/FormatterContentBuilder.js