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>
77 lines
3.3 KiB
Plaintext
77 lines
3.3 KiB
Plaintext
LayoutBox node=#1 tag=html box=block
|
|
content: (0, 0, 800, 127.600006)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
LayoutBox node=#8 tag=body box=block
|
|
content: (8, 8, 784, 103.600006)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 8 8 8 8
|
|
LayoutBox node=#10 tag=table box=table
|
|
content: (9, 9, 193.23053, 50.4)
|
|
padding: 0 0 0 0
|
|
border: 1 1 1 1
|
|
margin: 0 0 0 0
|
|
LayoutBox node=#12 tag=tbody box=table-row-group
|
|
content: (9, 11, 193.23053, 46.4)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
LayoutBox node=#13 tag=tr box=table-row
|
|
content: (9, 11, 193.23053, 46.4)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
LayoutBox node=#14 tag=td box=table-cell
|
|
content: (15, 15, 76.65198, 38.4)
|
|
padding: 4 4 4 4
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
inline_context: 1 lines, height=19.2, max_width=76.65198
|
|
line[0]: rect=(15, 15, 76.65198, 19.2) fragments=4
|
|
frag[0]: rect=(15, 15, 25.703377, 16) text="Bare" start=false end=false
|
|
frag[1]: rect=(43.75771, 15, 18.32599, 16) text="cell" start=false end=false
|
|
frag[2]: rect=(65.13803, 15, 14.367107, 16) text="no" start=false end=false
|
|
frag[3]: rect=(82.55947, 15, 9.09251, 16) text="tr" start=false end=false
|
|
LayoutBox node=#15 tag=anonymous box=anon
|
|
content: (0, 15, 76.65198, 16)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
text: "Bare cell no tr"
|
|
LayoutBox node=#17 tag=td box=table-cell
|
|
content: (101.65198, 15, 94.57855, 38.4)
|
|
padding: 4 4 4 4
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
inline_context: 2 lines, height=38.4, max_width=76.25258
|
|
line[0]: rect=(101.65198, 15, 76.25258, 19.2) fragments=2
|
|
frag[0]: rect=(101.65198, 15, 44.851685, 16) text="Another" start=false end=false
|
|
frag[1]: rect=(149.558, 15, 25.292217, 16) text="bare" start=false end=false
|
|
line[1]: rect=(101.65198, 34.2, 18.325989, 19.2) fragments=1
|
|
frag[0]: rect=(101.65198, 34.2, 18.32599, 16) text="cell" start=false end=false
|
|
LayoutBox node=#18 tag=anonymous box=anon
|
|
content: (0, 15, 94.57855, 16)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
text: "Another bare cell"
|
|
LayoutBox node=#21 tag=p box=block
|
|
content: (8, 76.4, 784, 19.200005)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 16 0 16 0
|
|
inline_context: 1 lines, height=19.200005, max_width=179.35977
|
|
line[0]: rect=(8, 76.4, 179.35977, 19.2) fragments=4
|
|
frag[0]: rect=(8, 78, 58.29075, 16) text="Paragraph" start=false end=false
|
|
frag[1]: rect=(69.34508, 78, 26.349485, 16) text="after" start=false end=false
|
|
frag[2]: rect=(98.74889, 78, 40.211456, 16) text="implicit" start=false end=false
|
|
frag[3]: rect=(142.0147, 78, 45.34508, 16) text="creation" start=false end=false
|
|
LayoutBox node=#22 tag=anonymous box=anon
|
|
content: (0, 0, 179.35977, 16)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
text: "Paragraph after impl..."
|