Files
rust_browser/tests/goldens/expected/019-text-wrapping.layout.txt
Zachary D. Rowitsch d5234cf546 Implement HTML5 tree builder insertion modes with code review fixes (§13.2.6)
Refactor tree_builder.rs into module directory with 7 files implementing all
23 insertion modes per WHATWG HTML §13.2.6.4 as an explicit state machine.
Includes active formatting elements list with Noah's Ark clause, scope
checking for all 5 scope types, context-sensitive fragment parsing, and
iterative token reprocessing via ProcessResult enum.

Code review fixes: fix formatting element end tag truncation bug (save
node_id before truncate), replace manual element creation in catch-all
StartTag with insert_element_maybe_self_closing, add skip_next_newline for
pre/listing/textarea per spec, add QuirksMode to Document with basic DOCTYPE
detection, refactor all 23 handlers from Token to &Token to eliminate clone
per dispatch, fix self_closing handling for pre/listing/textarea/plaintext,
improve golden test 276 fixture coverage and foster-parent test assertion.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 22:12:19 -04:00

46 lines
2.4 KiB
Plaintext

LayoutBox node=#1 tag=html box=block
content: (0, 0, 800, 150.4)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
LayoutBox node=#3 tag=body box=block
content: (8, 8, 784, 134.4)
padding: 0 0 0 0
border: 0 0 0 0
margin: 8 8 8 8
LayoutBox node=#4 tag=div box=block
content: (8, 8, 100, 134.4)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
inline_context: 7 lines, height=134.4, max_width=85.92069
line[0]: rect=(8, 8, 74.537445, 19.2) fragments=4
frag[0]: rect=(8, 9.6, 22.449337, 16) text="This" start=false end=false
frag[1]: rect=(33.50367, 9.6, 8.657856, 16) text="is" start=false end=false
frag[2]: rect=(45.21586, 9.6, 6.590308, 16) text="a" start=false end=false
frag[3]: rect=(54.8605, 9.6, 24.622616, 16) text="long" start=false end=false
line[1]: rect=(8, 27.2, 78.343605, 19.2) fragments=2
frag[0]: rect=(8, 28.800001, 49.903084, 16) text="sentence" start=false end=false
frag[1]: rect=(60.957417, 28.800001, 22.331863, 16) text="that" start=false end=false
line[2]: rect=(8, 46.4, 85.92069, 19.2) fragments=3
frag[0]: rect=(8, 48, 37.509544, 16) text="should" start=false end=false
frag[1]: rect=(48.563877, 48, 27.900146, 16) text="wrap" start=false end=false
frag[2]: rect=(79.51835, 48, 11.348018, 16) text="to" start=false end=false
line[3]: rect=(8, 65.600006, 77.11013, 19.2) fragments=2
frag[0]: rect=(8, 67.200005, 45.427315, 16) text="multiple" start=false end=false
frag[1]: rect=(56.481647, 67.200005, 25.574158, 16) text="lines" start=false end=false
line[4]: rect=(8, 84.8, 69.82672, 19.2) fragments=2
frag[0]: rect=(8, 86.4, 45.591774, 16) text="because" start=false end=false
frag[1]: rect=(56.646107, 86.4, 18.126286, 16) text="the" start=false end=false
line[5]: rect=(8, 104, 67.37151, 19.2) fragments=2
frag[0]: rect=(8, 105.6, 52.604992, 16) text="container" start=false end=false
frag[1]: rect=(63.659325, 105.6, 8.657856, 16) text="is" start=false end=false
line[6]: rect=(8, 123.2, 43.042583, 19.2) fragments=1
frag[0]: rect=(8, 124.799995, 43.042583, 16) text="narrow." start=false end=false
LayoutBox node=#5 tag=anonymous box=anon
content: (0, 0, 496.15256, 16)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
text: "This is a long sente..."