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>
85 lines
2.8 KiB
Plaintext
85 lines
2.8 KiB
Plaintext
LayoutBox node=#1 tag=html box=block
|
|
content: (0, 0, 800, 67.2)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
LayoutBox node=#3 tag=body box=block
|
|
content: (8, 16, 784, 35.2)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 8 8 8 8
|
|
LayoutBox node=#5 tag=p box=block
|
|
content: (8, 16, 784, 19.2)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 16 0 16 0
|
|
inline_context: 1 lines, height=19.2, max_width=200.35243
|
|
line[0]: rect=(8, 16, 200.35243, 19.2) fragments=5
|
|
frag[0]: rect=(8, 17.6, 41.491924, 16) text="Normal" start=false end=false
|
|
frag[1]: rect=(52.546257, 17.6, 25.69163, 16) text="bold" start=true end=true
|
|
frag[2]: rect=(81.29221, 17.6, 24.986786, 16) text="italic" start=true end=true
|
|
frag[3]: rect=(109.33333, 17.6, 56.14097, 16) text="bold-italic" start=true end=true
|
|
frag[4]: rect=(168.52864, 17.6, 39.823788, 16) text="normal" start=false end=false
|
|
LayoutBox node=#6 tag=anonymous box=anon
|
|
content: (0, -8, 44.546257, 16)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
text: "Normal "
|
|
LayoutBox node=#7 tag=b box=inline
|
|
content: (0, -8, 0, 0)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
LayoutBox node=#8 tag=anonymous box=anon
|
|
content: (0, -8, 25.69163, 16)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
text: "bold"
|
|
LayoutBox node=#9 tag=anonymous box=anon
|
|
content: (0, -8, 3.0543318, 16)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
text: " "
|
|
LayoutBox node=#10 tag=em box=inline
|
|
content: (0, -8, 0, 0)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
LayoutBox node=#11 tag=anonymous box=anon
|
|
content: (0, -8, 24.986786, 16)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
text: "italic"
|
|
LayoutBox node=#12 tag=anonymous box=anon
|
|
content: (0, -8, 3.0543318, 16)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
text: " "
|
|
LayoutBox node=#13 tag=b box=inline
|
|
content: (0, -8, 0, 0)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
LayoutBox node=#14 tag=em box=inline
|
|
content: (0, -8, 0, 0)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
LayoutBox node=#15 tag=anonymous box=anon
|
|
content: (0, -8, 56.14097, 16)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
text: "bold-italic"
|
|
LayoutBox node=#16 tag=anonymous box=anon
|
|
content: (0, -8, 42.87812, 16)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
text: " normal"
|