Fix pre-line text normalization in box_tree.rs: newlines were being stripped during box tree construction because pre-line routed through the normal whitespace collapse branch. Add a preserves_newlines() branch that splits on \n, collapses spaces within each line, and rejoins with \n so the inline engine can produce correct line breaks. Guard is_whitespace_only_run in normalize.rs to preserve \n-containing text nodes under pre-line, preventing them from being discarded at block boundaries. Add 21 unit tests covering pre-line (newline preservation, space collapsing, wrapping, inheritance, consecutive newlines, whitespace-only lines, vertical stacking, normalize guard) and pre-wrap (newline/space preservation, wrapping, tabs). Update golden test 072 expected output. Promote WPT white-space-letter-spacing-001 from known_fail to pass. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
12 lines
834 B
Plaintext
12 lines
834 B
Plaintext
DisplayList items=10
|
|
Text rect=(8, 9.6, 22.449337, 16) text="This" color=#000000 font_size=16
|
|
Text rect=(33.50367, 9.6, 19.477238, 16) text="has" color=#000000 font_size=16
|
|
Text rect=(56.03524, 9.6, 45.427315, 16) text="multiple" color=#000000 font_size=16
|
|
Text rect=(104.516884, 9.6, 37.333336, 16) text="spaces" color=#000000 font_size=16
|
|
Text rect=(8, 28.800001, 18.725403, 16) text="but" color=#000000 font_size=16
|
|
Text rect=(8, 48, 23.389135, 16) text="only" color=#000000 font_size=16
|
|
Text rect=(8, 67.200005, 48.693096, 16) text="newlines" color=#000000 font_size=16
|
|
Text rect=(8, 86.4, 37.509544, 16) text="should" color=#000000 font_size=16
|
|
Text rect=(48.563877, 86.4, 13.85022, 16) text="be" color=#000000 font_size=16
|
|
Text rect=(65.46843, 86.4, 55.62408, 16) text="preserved" color=#000000 font_size=16
|