Bug 296753

Summary: Web Inspector: DOM element previews in Object Tree outlines show newlines and indentation
Product: WebKit Reporter: Razvan Caliman <rcaliman>
Component: Web InspectorAssignee: Razvan Caliman <rcaliman>
Status: RESOLVED FIXED    
Severity: Normal CC: inspector-bugzilla-changes, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
test case
none
Screenshot of issue - Console none

Razvan Caliman
Reported 2025-07-31 10:23:23 PDT
Created attachment 476237 [details] test case Elements in HTML that have newlines or indentation in their values show up verbatim in previews in ObjectTree outlines. This looks bad when showing a NodeList (return of `document.querySelectorAll()`) or an Array of elements in the Console. Steps to reproduce: - open the attached test case - in the Console, run `document.querySelectorAll('body')` Result: The messy newlines and indentation from the markup shows up in the element preview of the NodeList. After expanding the preview, formatted node is shown. This occurs in the Console because `white-space: pre-wrap` is inherited by descendants of the console message. ``` .console-message-body { white-space: pre-wrap; } ```
Attachments
test case (370 bytes, text/html)
2025-07-31 10:23 PDT, Razvan Caliman
no flags
Screenshot of issue - Console (299.29 KB, image/png)
2025-07-31 10:24 PDT, Razvan Caliman
no flags
Radar WebKit Bug Importer
Comment 1 2025-07-31 10:23:42 PDT
Razvan Caliman
Comment 2 2025-07-31 10:24:07 PDT
Created attachment 476238 [details] Screenshot of issue - Console
Razvan Caliman
Comment 3 2025-08-04 10:32:20 PDT
EWS
Comment 4 2025-08-13 08:48:58 PDT
Committed 298626@main (406af9d4a917): <https://commits.webkit.org/298626@main> Reviewed commits have been landed. Closing PR #48909 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.