Created attachment 431905 [details] Screenshot of Issue See attached screenshot. Notice that on hover the `text` local variable has two spaces between `1px` and `red`, but in the Scope Chain sidebar panel, it is shown with a single space. In this case if I check the string's length in my source, it is 8 characters, which is what I would expect, but the sidebar panel is only showing seven characters.
Created attachment 432001 [details] Patch v1.0
Created attachment 432002 [details] Screenshot of Issue
Created attachment 432003 [details] Screenshot of Patch v1.0
<rdar://problem/79637908>
Comment on attachment 432001 [details] Patch v1.0 View in context: https://bugs.webkit.org/attachment.cgi?id=432001&action=review r=me > Source/WebInspectorUI/ChangeLog:11 > + which makes sure that the text does not wrap unless it contains a newline, and these previews have newlines > + replaced with a Unicode symbol to visually represent a newline without breaking to a new line. Perhaps worth adding an assertion inside `WI.FormattedValue.createLinkifiedElementString` that there are no `'\n'` then?
Comment on attachment 432001 [details] Patch v1.0 View in context: https://bugs.webkit.org/attachment.cgi?id=432001&action=review >> Source/WebInspectorUI/ChangeLog:11 >> + replaced with a Unicode symbol to visually represent a newline without breaking to a new line. > > Perhaps worth adding an assertion inside `WI.FormattedValue.createLinkifiedElementString` that there are no `'\n'` then? I don't think that would be the right place to assert this. `WI.FormattedValue.createLinkifiedElementString` is only called in `ConsoleMessageView.prototype._formatParameterAsString`, which wouldn't be affected by this CSS change anyways, as object trees handle creating the tree entries using `WI.FormattedValue.createElementForTypesAndValue` (via one of the functions in FormattedValue.js:269-324). The class name is added dynamically here, which makes it not entirely clear that `.formatted-string` is used anywhere other than where you found it in `WI.FormattedValue.createLinkifiedElementString`. I don't think adding an assertion to `WI.FormattedValue.createElementForTypesAndValue` helps us since if the type is `string` newlines are explicitly removed here instead of relying on the input to be pre-formatted.
Committed r279294 (239170@main): <https://commits.webkit.org/239170@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 432001 [details].