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>
101 lines
4.1 KiB
Plaintext
101 lines
4.1 KiB
Plaintext
LayoutBox node=#1 tag=html box=block
|
|
content: (0, 0, 800, 70)
|
|
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, 54)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 8 8 8 8
|
|
LayoutBox node=#14 tag=ul box=table
|
|
content: (9, 9, 400, 52)
|
|
padding: 0 0 0 0
|
|
border: 1 1 1 1
|
|
margin: 0 0 0 0
|
|
LayoutBox node=#16 tag=(anonymous-table-row) box=table-row
|
|
content: (9, 9, 400, 52)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
LayoutBox node=#16 tag=li box=table-cell
|
|
content: (15, 15, 88, 40)
|
|
padding: 5 5 5 5
|
|
border: 1 1 1 1
|
|
margin: 0 0 0 0
|
|
inline_context: 1 lines, height=19.2, max_width=29.885468
|
|
line[0]: rect=(15, 15, 29.885468, 19.2) fragments=2
|
|
frag[0]: rect=(15, 16.6, 20.111603, 16) text="Cell" start=false end=false
|
|
frag[1]: rect=(38.165936, 16.6, 6.71953, 16) text="1" start=false end=false
|
|
LayoutBox node=#17 tag=anonymous box=anon
|
|
content: (0, 15, 29.885466, 16)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
text: "Cell 1"
|
|
LayoutBox node=#19 tag=(anonymous-table-cell) box=table-cell
|
|
content: (109, 9, 102, 52)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
LayoutBox node=#19 tag=li box=table
|
|
content: (110, 10, 100, 0)
|
|
padding: 0 0 0 0
|
|
border: 1 1 1 1
|
|
margin: 0 0 0 0
|
|
LayoutBox node=#20 tag=(anonymous-table-row) box=table-row
|
|
content: (110, 10, 100, 19.2)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
LayoutBox node=#20 tag=(anonymous-table-cell) box=table-cell
|
|
content: (110, 10, 100, 19.2)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
inline_context: 1 lines, height=19.2, max_width=39.77681
|
|
line[0]: rect=(110, 10, 39.77681, 19.2) fragments=2
|
|
frag[0]: rect=(110, 11.6, 30.00294, 16) text="Table" start=false end=false
|
|
frag[1]: rect=(143.05728, 11.6, 6.71953, 16) text="2" start=false end=false
|
|
LayoutBox node=#20 tag=anonymous box=anon
|
|
content: (0, 10, 39.776802, 16)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
text: "Table 2"
|
|
LayoutBox node=#22 tag=li box=table-cell
|
|
content: (217, 15, 88, 40)
|
|
padding: 5 5 5 5
|
|
border: 1 1 1 1
|
|
margin: 0 0 0 0
|
|
inline_context: 1 lines, height=19.2, max_width=29.885468
|
|
line[0]: rect=(217, 15, 29.885468, 19.2) fragments=2
|
|
frag[0]: rect=(217, 16.6, 20.111603, 16) text="Cell" start=false end=false
|
|
frag[1]: rect=(240.16594, 16.6, 6.71953, 16) text="3" start=false end=false
|
|
LayoutBox node=#23 tag=anonymous box=anon
|
|
content: (0, 15, 29.885466, 16)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
text: "Cell 3"
|
|
LayoutBox node=#25 tag=(anonymous-table-cell) box=table-cell
|
|
content: (311, 9, 102, 52)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
LayoutBox node=#25 tag=li box=block
|
|
content: (312, 10, 100, 40)
|
|
padding: 0 0 0 0
|
|
border: 1 1 1 1
|
|
margin: 0 0 0 0
|
|
inline_context: 1 lines, height=19.2, max_width=39.459625
|
|
line[0]: rect=(312, 10, 39.459625, 19.2) fragments=2
|
|
frag[0]: rect=(312, 11.6, 29.685757, 16) text="Block" start=false end=false
|
|
frag[1]: rect=(344.74008, 11.6, 6.71953, 16) text="4" start=false end=false
|
|
LayoutBox node=#26 tag=anonymous box=anon
|
|
content: (0, 9, 39.459618, 16)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
text: "Block 4"
|