Repository navigation
fix(renderer): export live rendered content through shared markdown conversion - #1337
Conversation
efe538b to
73c4a29
Compare
73c4a29 to
3fae227
Compare
3fae227 to
0476c31
Compare
0476c31 to
c98074f
Compare
c98074f to
a0ad007
Compare
Sequential Navigation Soak A/BWorkflow: No navigation resilience or memory conclusion is available for this run. |
Spider Bench A/BWorkflow: No benchmark result or performance conclusion is available for this run. |
CI Regression ReportSource CI run · source state at render:
Release regression — ⚪ artifact unavailable or invalidArtifact unavailable or invalid. See the source CI run for infrastructure details. Frontend differential — ✅ 1,020/1,020 cases matched; 0 issues
Agent episodes · Moli vs Chromium — ✅ 8/8 Moli episodes passed; 0 failures
Runtime and CDP session contracts — ✅ 26 contract cases; 0 failures
CDP smoke — ✅ 108/108 groups passed; 1,402 scenariosWorkers: 4 · cumulative group time: 334.05 s · failed groups: 0
WebMainBench · 545 pages — ✅ 545/545 completed; 0 unexpected failures
Frozen HTML · Linux · Diagnostics: All artifact fields are parsed by the trusted default-branch renderer; missing or invalid inputs remain visible as unavailable. |
a0ad007 to
b7f4f45
Compare
b7f4f45 to
3d68030
Compare
3d68030 to
1acd30d
Compare
f04b0b1 to
9272068
Compare
lanyue-llk
left a comment
There was a problem hiding this comment.
Round-4 re-review of the updated version (92720683b)
Round-4 re-review (head 92720683b, base #1336 99e374401). This PR makes the renderer's Markdown export read live state (computed display/visibility/baseline-shift, Stylo own-visibility, live control values, base-resolved URLs) through the MarkdownDom adapter over moli-html2md. The new commit 92720683b and the #1336 commit 68cc9e546 beneath it fix both blocking stack findings. Live lists stay tight and <select> options stay on single lines, because content::owns_boundaries makes the converter ignore CSS boundaries on elements it already structures. A visibility:hidden cell keeps its <td>, so later columns no longer shift. The new markdown_live_structure_and_visibility_have_exact_outputs test fails on the round-3 code for each of these cases. I traced the code by hand and did not build or run anything.
Verdict: request changes, small. The two majors are gone. One minor regression came in with the hidden-cell fix: a hidden table that needs the HTML fallback now emits an empty <table> skeleton. Two minor/medium stack items are also still open: CSS boundaries inside fallback <pre>/<code> (#1336 layer) and loose lists from block-styled item children, which the new README sentence says cannot happen. Everything else is low or nit, or is stack hygiene that a squash merge removes.
Previous findings
| # | Finding | Status | Evidence at 92720683b |
|---|---|---|---|
| R3-1 / stack #1 | [major] UA display makes lists loose and splits <select> |
FIXED | machine.rs:216-219 and html_fallback.rs:192-198 skip both hooks when owns_boundaries(tag) holds (is_structural_block + select/optgroup/option; content.rs:140-142). <ul><li>a</li><li>b</li></ul> → - a\n- b; nested list and select/optgroup are exact-tested (markdown_dump.rs:477-479). No more <div><option>. A residual looseness case is in new #2. |
| R3-2 / stack #2 | [major] hidden element → NodeKind::Document shifts table columns |
FIXED (one regression, new #1) | visibility.rs:358-382 keeps table/list tags. Text under an invisible parent is Other (L383-390). …<td style=visibility:hidden>private</td>… → | A | | alice | (exact test L482). |
| R3-3 / stack #3 | [minor] UA inline-block controls → \n in Markdown, <br> in cells, space in fallback |
FIXED | The adapter skips native controls whose display is exactly inline-block (L213-218). html2md maps has_text_boundary to a space in both paths (Task::InlineSpace, machine.rs:80/221). Search q Go and | Alice Edit | are exact-tested. The Font Awesome link split is gone too, because text(" ") does not close styles. Design nit in new #6. |
| R3-4 | [minor] tabpanel inside closed <dialog>/[popover] exported |
FIXED | content_context rejects the dialog element and any popover attribute (L289-292). The exact test omits both panels. |
| R3-5 / stack #9 | [low] fragment-link predicate | FIXED | Requires a non-empty fragment (L57-62), matching anchors::referenced. Head links are out of scope now. |
| R3-6 / stack #6 | [minor] production adapter barely tested | FIXED | 8 exact live cases × strip on/off (markdown_dump.rs:471-492), plus an HTTP FixtureServer CLI test with base-resolved URLs (fetch_cli/markdown.rs:75-95). Pushback accepted on keeping the source-only unit helper. |
| R3-7 / stack #10 | [nit] duplicated tag list, unread source srcset, names |
FIXED | One (standard, lazy) match (media.rs:12-18). source advertises src and lazy inputs only. Renamed to tag. |
| R3-8 / stack #4 | [nit] README stale; R2-S5 export policy undocumented | FIXED (wrap nit remains) | L5/L20/L48 corrected, and the policy paragraph is added at L163-169. L5 (97 cols) and L20 (99 cols) are still unwrapped, and L169 overclaims (new #2). |
| R3-9 / stack #8 | [minor] many full passes per conversion | PARTIAL, pushback accepted for the rest | Styles are now collected for <html> + body subtree only (page_dump.rs:19-27). The 7 sets and per-panel ancestor walks remain. Accepted as not worth a redesign without a measured bottleneck. |
| R2-1 | [minor] Stylo pin on unmerged fork PR | merge-order item, unchanged | lexmount/stylo#2 still OPEN at e2baa14. |
| R2-S6 | [nit] minified tests | NOT FIXED | New test lines reach ~230 cols (markdown_dump.rs:475-485), and the CLI test args line is ~190. |
| R2-N1 / stack #11 | [minor] commits 1–4 don't build; churn | NOT FIXED (more churn) | Commits 1–4 are unchanged. New: 040269fd4 adds a blank line between a doc comment and fn needed (clippy empty_line_after_doc_comments) and a double blank in lib.rs, both removed by 92720683b. 3511c199a adds hacker-news-layout-computed.md and 92720683b deletes it. Moot with a squash merge. |
| R2-N2 | [nit] computed fixture in html2md; needed doc in #1337; #1592 missing from stack line |
PARTIAL | Fixture deleted, and html_fallback.rs is no longer in the net diff. The PR body stack line still ends at #1380. |
| stack #5 / #7 | html2md API and Stylo bump inside renderer commit | NOT FIXED (moot if squashed) | Both still in 040269fd4. |
| stack N2 | [medium] computed boundaries inside fallback <pre>/<code> |
NOT FIXED | html_fallback.rs:190-199 (#1336 file, touched by 68cc9e546 this round) still ignores code. See below. |
| stack N3 | [low] range/color sanitized defaults | NOT FIXED | See new #4. |
| stack N4 | [low] col/colgroup become <div>s in fallback tables |
NOT FIXED | See new #5. |
New / still-open findings
- [minor] Regression from the hidden-cell fix: a hidden table that takes the HTML fallback now emits an empty
<table>skeleton, andvisibility:collapserows become empty GFM rows (visibility.rs:358). - [minor] Lists are still loose when an item's child is block-styled (
li > a{display:block}, common in nav and dropdown menus). The README claim at L169 is false for this case. - [medium, #1336 × #1337, stack N2 still open] Live CSS boundaries change the text of linked code blocks (below, not anchorable in this diff).
- [low] Untouched range/color inputs print
50/#000000(visibility.rs:145). Stack N3. - [low] UA
table-column/table-column-groupare stillblocks, so fallback tables gain<div>s (visibility.rs:222). Stack N4. - [nit] The control exemption is a tag-and-string special case split across two layers (visibility.rs:217).
- [nit] README wrapping and placement (README.md:20).
3. (not anchorable: html_fallback.rs is not in this PR's diff) Computed boundaries rewrite linked code
html_fallback::render computes code (L190) but applies has_block_layout/has_text_boundary without checking it (L192-199). 68cc9e546 added the owns_boundaries guard on these exact lines but did not add !code. The adapter is the only producer of these hooks, so this only happens on the live path.
- Input:
<pre><code>let v = <span style="display:inline-block">f</span>(<a href="/doc">x</a>);</code></pre> - Live:
<pre>\n<code>let v = f (<a href="/doc">x</a>);</code></pre>, with two characters that are not in the source. Adisplay:blockline span produces<div>…</div>inside<pre>. - Source path, or the same block without a link (raw path, which never calls
visit):let v = f(x);.
Fix: skip both hooks whilecodeis true (if !code && let NodeKind::Element(tag) = …), and add one live case with a linked<pre>to the new exact-output test.
Other
- Merge state:
git merge-treeagainst #1336 (99e374401) and againstorigin/main(45be4e353) is clean. - CI: Format, Clippy, CDP smoke, harness tests, SecTrust and Windows storage pass. Nextest and both release builds are still queued, so the new exact-output and HTTP CLI tests have not run in CI yet.
Verdict: changes requested (posted as a comment because GitHub does not allow requesting changes on your own PR).
Automated review by Claude Code.
Stack-level re-review (#1334–#1337), round 4Scope. This round covers only cross-layer and combined-state problems. Refs: Changes since round 3. There are seven new commits: This round fixes the two round-3 blockers in the cases we wrote down:
Both fixes have exact-output live tests ( Status of the round-3 findings
New findings
N5. High: blockified computed
|
9272068 to
6d0a254
Compare
lanyue-llk
left a comment
There was a problem hiding this comment.
Round-5 re-review of the updated version (6d0a2549a)
Round-5 re-review (head 6d0a2549a, base #1336 39ae6b32e). This PR makes the renderer's Markdown export read live state (computed display/visibility/baseline-shift, Stylo own-visibility, live control values, base-resolved URLs) through the MarkdownDom adapter over moli-html2md. The new commit 6d0a2549a and the #1336 changes beneath it fix the hidden-table skeleton, collapsed rows, single-block list items, col/colgroup and the control special case. Each fix has an exact live test that fails on the round-4 code. I traced the code by hand and did not build or run anything.
Verdict: request changes. The top stack item, N5 (high), is not fixed. The classifier still reads only the computed display (page_dump.rs still requests just display/visibility/baseline-shift). Stylo blockifies flex/grid items, floats and abspos elements (stylo e2baa14 style_adjuster.rs:221-256), so they still produce paragraph breaks. N6 is also open, and the range/color fix still leaks defaults when value="".
Previous findings
| # | Finding | Status | Evidence at 6d0a2549a |
|---|---|---|---|
| R4-1 | [minor] hidden fallback table emits an empty <table> skeleton; collapse rows become empty GFM rows |
FIXED | A reverse pre-order pass (visibility.rs:266-283) suppresses an invisible table/ul/ol/dl that has no visible descendant. visibility:collapse tr/thead/tbody/tfoot is suppressed (L199-214). Exact tests L486-487, plus a restored-descendant test at L500-511. Residual nit: col/colgroup in that list do nothing (new #5). |
| R4-2 | [minor] loose list from a block-styled item child; README claim | FIXED for the reported case | #1336 adds Writer::layout_boundary, which does not set has_blocks (writer.rs:276-283). flush_breaks sets it only when a break of 2 or more lands between content (writer.rs:504). Exact test L485. The README now claims only the single-block case (L119-121). Two flex items in an item are still loose (N5). |
| R4-3 / stack N3 | [low] range/color sanitized defaults | PARTIAL | Absent value is fixed and tested (L488-489, L505). value="" or an invalid authored value still prints 50/#000000 (new #3). |
| R4-4 / stack N4 | [low] col/colgroup become <div> |
FIXED (in #1336) | owns_boundaries now includes col/colgroup (#1336 machine.rs). Exact test L490. |
| R4-6 | [nit] control inline-block exemption |
FIXED | Branch deleted (L221-228). Controls get a collapsible space, and the existing exact control and cell tests are unchanged. |
| R4-7 | [nit] README wrap/placement | MOSTLY FIXED | Policy is under ## Content policy (L107) and the duplicate is gone. L20 and L113 are rewrapped. L6 is now 94 cols (new #6). |
| stack N2 | [medium] CSS boundaries inside fallback <pre>/<code> |
FIXED (in #1336) | html_fallback.rs now guards both hooks with !code. |
| stack N5 | [high] blockified flex/grid items, floats, abspos | NOT FIXED | See new #1. |
| stack N6 | [low] per-character inline-block spans split |
NOT FIXED | See new #2. |
| R2-1 | [minor] Stylo pin on unmerged fork PR | merge-order item, unchanged | lexmount/stylo#2 is still OPEN at e2baa14. |
| R3-9 / stack #8 | full passes per conversion | pushback accepted | This commit adds one more pass plus a node_order Vec. Still acceptable. |
| R2-S6 | [nit] minified tests | NOT FIXED | New lines reach 237 cols (L490) and 329 cols (L505). |
| R2-N1 / stack #5/#7/#11 | commit hygiene; html2md API and Stylo bump in the renderer commit | NOT FIXED (moot if squashed) | Commits 1-8 are unchanged (range-diff =). 6d0a2549a is titled fix(renderer) but mostly rewraps html2md README. |
| R2-N2 | PR body stack line omits #1592 | NOT FIXED | It still ends at #1380. |
New / still-open findings
- [high] N5 still open: blockified
displayturns flex children, floats and.sr-only/abspos spans into paragraph breaks (visibility.rs:222). - [low] N6 still open: every
inline-*box gets a space, so per-character spans split words (visibility.rs:223). - [low] range/color:
value=""or an invalid authored value still leaks the synthetic default. The type is re-parsed from the attribute (visibility.rs:142). - [low] The new range/color and hidden-structure test uses
containsassertions, not exact output (markdown_dump.rs:505). - [nit]
col/colgroupincollapsed_table_partare no-ops. Collapsed columns still export their cells, though the author reply says columns are removed (visibility.rs:202). - [nit] README L6 is 94 cols. "wholly invisible tables" also covers lists (README.md:6, :120).
Other
- #1592 is not rebased. Its head is still
86ed30b95on the round-3 basef04b0b151.git merge-tree --merge-base f04b0b151 6d0a2549a 86ed30b95conflicts inpage_dump.rsandpage_dump/visibility.rs. When it is rebased, it must apply body-only collection per frame document and run the newnode_orderreverse pass over each frame's styles. - Merge state: clean against #1336 (
39ae6b32e) and againstorigin/main. - CI: Format, Clippy, CDP smoke, harness, SecTrust and Windows storage pass. Nextest and both release builds are QUEUED, so none of the new exact tests have run in CI.
Verdict: changes requested (posted as a comment because GitHub does not allow requesting changes on your own PR).
Automated review by Claude Code.
Stack-level re-review (#1334–#1337), round 5Scope. This round covers only cross-layer and combined-state problems. Refs: merge-base Changes since round 4. Four new commits: Status of the round-4 findings
New findings
B1. High: nine commits do not compile on their own
Both problems were already present in round 4 ( Other per-commit checks found no further breaks. I resolved B2. Medium: collapsed rows shift
|
6d0a254 to
4e58ef8
Compare
lanyue-llk
left a comment
There was a problem hiding this comment.
Final re-review (P0/P1 only) (4e58ef889)
Round-6 (final) re-review. Head is 4e58ef889 and base is #1336 5df2dd7f7. I traced the code by hand and did not build or run anything.
Verdict: request changes for one remaining P0, and only if this PR is rebase-merged. The new commit 4e58ef889 fixes N5 for all five reported inputs, and each has an exact live test. Column-flex and grid children still become blocks, as they should. N3 and N6 are fixed too. B1 has not changed: four commits do not compile on their own. The repository allows rebase merge (allow_rebase_merge: true), so if this PR is squash-merged, B1 does not matter and nothing at P0/P1 remains.
Previous P0/P1-level findings
| # | Finding | Status | Evidence at 4e58ef889 |
|---|---|---|---|
| N5 | [high] Stylo-blockified flex/grid items, floats and abspos elements produce paragraph breaks | FIXED | page_dump.rs:36-44 now also reads position, float and flex-direction, plus Stylo's original_display (computed.rs:288-290). visibility.rs:126-137 builds item_blocks from the parent's display: row flex/inline-flex and inline-grid children get a space boundary; column flex and grid children become blocks. Abspos/fixed elements, and floats that are not flex items, add no boundary (:244-271). Because set_adjusted_display(.., false) keeps original_display for floats and abspos (Stylo properties.mako.rs:1436-1446), a non-item inline-flex button keeps its inline outer type. Structural tags (div, li, td, form…) still own their boundaries (machine.rs:222, owns_boundaries), so floated or abspos divs are still paragraphs. Exact live tests at markdown_dump.rs:491-506 cover the search form (rust Search), inline-flex button, abspos .sr-only, flex li (tight list), flex cell (Alice Edit), floats, column flex (A\n\nB), grid and inline-grid. A CSSOM/DOM invariance test is at :536-547. |
| N6 | [low, user-visible] per-character inline-block spans split words |
FIXED | Plain atomic inlines get no space now. Only input/textarea/select/button and inline list-items do (visibility.rs:259-268). <h1> with per-letter spans gives # Hi (test :498). |
| N3 | range/color sanitized defaults leak when value="" or the value is invalid |
FIXED | Range/color use the live value only when dirty (visibility.rs:161-163, using element.input_type()). Tests: value='' gives Volume and invalid values give abc invalid (:500-501). A script-set value is asserted exactly (:519-532). |
| B1 | [P0 if rebase-merged] #1337 commits call HAS_OWN_VISIBILITY before the Stylo pin bump |
NOT FIXED | Commits 1-4 are unchanged (range-diff =). 5f4a1e855, f6342b5d8, aa9b30ced and 60a926f2e use ComputedValueFlags::HAS_OWN_VISIBILITY (computed.rs:312 at 5f4a1e855), while Cargo.toml/Cargo.lock pin Stylo 973988b9, which has no such constant. The bump arrives only in cc4aa24e1. Squash-merge, or move the bump into the first commit. |
| B2 | collapsed rows are removed, so a rowspan shifts cells |
NOT FIXED (P2 for this round) | visibility.rs:217-223 still suppresses a visibility:collapse tr/thead/tbody/tfoot. The author says this is intended. It needs a collapsed row with a rowspan from an earlier row reaching into it, which is rare on real pages, so I do not block on it. |
| R2-1 | Stylo pinned to an unmerged fork PR | merge-order item, unchanged | lexmount/stylo#2 is still OPEN at e2baa14. |
New P0/P1 findings
No new P0/P1 issues in 4e58ef889 or 85969dc48. Residual edge cases, below P1 and not blocking:
- The flex-item lookup uses the DOM parent, while Stylo uses the layout parent. A
display:contentswrapper between a row-flex container and its items still gives paragraph breaks, becauseoriginal_displayis blockified for items. - An abspos inline badge with no source whitespace now glues to its neighbour, for example
Cart<span style=position:absolute>3</span>→Cart3.
Other
- #1592 is rebased onto
4e58ef889(head8a423e752, merge-base = this head).git merge-treeis clean, and it now collects body-only styles per frame document. - CI: Format, Clippy (so the head compiles), CDP smoke, Node/Python harness, SecTrust and Windows storage pass. Nextest and both release builds are still pending, so the new exact tests have not run in CI yet.
Verdict: changes requested (posted as a comment because GitHub does not allow requesting changes on your own PR).
Automated review by Claude Code.
| pub(crate) fn has_own_visibility_value(&self) -> bool { | ||
| self.primary | ||
| .flags | ||
| .contains(ComputedValueFlags::HAS_OWN_VISIBILITY) |
There was a problem hiding this comment.
[P0 if rebase-merged] Still open (stack B1): the first four commits of this PR do not compile. 5f4a1e855, f6342b5d8, aa9b30ced and 60a926f2e reference ComputedValueFlags::HAS_OWN_VISIBILITY (here; computed.rs:312 at 5f4a1e855). In those commits Cargo.toml/Cargo.lock still pin Stylo 973988b9c…, whose computed_value_flags.rs has no such constant. It first appears at e2baa14, and the pin moves only in cc4aa24e1. The repo has allow_rebase_merge: true, so a rebase merge would put four non-building commits on main. Fix: squash-merge, or move the Cargo.toml/Cargo.lock Stylo bump into 5f4a1e855 (ideally after lexmount/stylo#2 lands).
4e58ef8 to
19bfc78
Compare
eeb9156 to
8fa1598
Compare
8fa1598 to
c582612
Compare
Markdown export now uses the current page's computed visibility, live form state and resolved resource URLs through a read-only DOM adapter, while keeping structural conversion in
moli-html2md.Validation:
cargo fmt --allcargo clippy --workspace --all-targets --all-features -- -D warningscargo nextest run --no-fail-fast— 22,293 passed; 20 skippedcargo check -p moli-renderer-v8 --lib --all-features --locked. The initial feature commit includes the dependency pin and omits the obsolete animation API path.Stylo is pinned to
5e853c2255715a825e3f9ea043d3998a55377e77, which combines the existing font fixes with the visibility-provenance flag. The pin is included in the first commit that uses the flag. The dependency remains on a fork branch; Stylo #2 is still open and is not merged by this update.The earlier seven-page WebMainBench investigation remains historical evidence, not a new 545-page quality evaluation. This update does not claim a full-corpus quality score. Historical benchmark report.