Skip to content

fix(renderer): export live rendered content through shared markdown conversion - #1337

Merged
ldm0 merged 12 commits into
mainfrom
codex/content-rendered-state
Nov 3, 2026
Merged

ldm0 merged 12 commits into
mainfrom
codex/content-rendered-state

Conversation

@lanyue-llk

@lanyue-llk lanyue-llk commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

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.

  • Read export styles in one observation and preserve author layout boundaries without treating CSS blockification as paragraphs.
  • Keep explicit document panels, native disclosures and source text; exclude ordinary hidden UI and content-visibility-locked descendants while preserving table columns.
  • Do not infer document disclosures from controllers that declare popup menus, listboxes, trees, grids or dialogs. Visible popup content remains exportable.
  • Preserve long JSON inside visible preformatted source in both fenced Markdown and HTML fallback, while retaining ordinary hidden-state filtering outside source regions.
  • Export live control values and checked state without mutating the DOM or CSSOM, and use the shared resource-attribute inventory for URL resolution.

Validation:

  • cargo fmt --all
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo nextest run --no-fail-fast — 22,293 passed; 20 skipped
  • Six new regression tests fail on the previous head and pass after these fixes. They cover content-visibility applicability, disclosure/source exceptions, popup controllers, long JSON source, CSS stripping and HTML fallback.
  • Each of the first four commits passes cargo 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.

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Sequential Navigation Soak A/B

⚠️ Benchmark infrastructure failed before a comparison could be produced.

Workflow: failure. Inspect the workflow run for the failing build, harness, or artifact step.

No navigation resilience or memory conclusion is available for this run.

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Spider Bench A/B

⚠️ Spider Bench infrastructure failed before a comparison could be produced.

Workflow: failure. Inspect the workflow run for the failing build, harness, or artifact step.

No benchmark result or performance conclusion is available for this run.

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

CI Regression Report

Source CI run · source state at render: failure · artifacts: 5/6

Check Status Signal
Release regression ⚪ artifact unavailable or invalid
Frontend differential ✅ 1,020/1,020 cases matched; 0 issues
Agent episodes ✅ 8/8 Moli episodes passed; 0 failures
Runtime/CDP contracts ✅ 26 contract cases; 0 failures
CDP smoke ✅ 108/108 groups passed; 1,402 scenarios
WebMainBench ✅ 545/545 completed; 0 unexpected failures
Release regression — ⚪ artifact unavailable or invalid

Artifact unavailable or invalid. See the source CI run for infrastructure details.

Frontend differential — ✅ 1,020/1,020 cases matched; 0 issues
Match DOM mismatch Diagnostic mismatch Moli error Reference error Infrastructure error Mismatched frames Duration
1,020 0 0 0 0 0 0 6m 43.22s
Agent episodes · Moli vs Chromium — ✅ 8/8 Moli episodes passed; 0 failures
Fast contract Episodes Passed Assertions Ready p50 Episode p50
Moli 8 8 47/47 29.03 ms 42.50 ms
Chromium 8 8 47/47 398.13 ms 114.05 ms
Operation p50 Chromium Moli Delta Delta %
navigate 49.63 ms 7.64 ms −41.99 ms −84.60%
observe 1.27 ms 1.66 ms +0.39 ms +30.61%
fill 5.37 ms 4.87 ms −0.49 ms −9.18%
click 6.81 ms 7.97 ms +1.16 ms +17.10%
Idle-resource episode Peak RSS Peak PSS Average CPU Peak CPU Peak processes Sampler
Moli 69.23 MiB 66.68 MiB 0.86% 12.04% 1 ✅
Chromium 1277.96 MiB 325.85 MiB 0.56% 8.01% 13 ⚠️ PSS partial
Runtime and CDP session contracts — ✅ 26 contract cases; 0 failures
Suite Cases Failures Median case p50 Median case p95 Median peak PSS p50
Synthetic fetch 13 0 24.34 ms 25.44 ms 995.00 KiB
Long-lived CDP session 13 0 17.88 ms 18.60 ms —
CDP smoke — ✅ 108/108 groups passed; 1,402 scenarios

Workers: 4 · cumulative group time: 334.05 s · failed groups: 0

Slowest group Scenarios Duration Status
dom-input 62 19.39 s ✅
dom-input 62 19.30 s ✅
scrollbar-visibility 22 15.89 s ✅
scrollbar-visibility 22 15.44 s ✅
target-lifecycle 25 13.99 s ✅
WebMainBench · 545 pages — ✅ 545/545 completed; 0 unexpected failures
Completed Successful Expected DNS failure Unexpected failures Panics Crashes Timeouts Empty output
545/545 544 1 0 0 0 0 0

Frozen HTML · Linux · --wait done · 45 seconds per page · no retries. Content quality is evaluated separately.

Diagnostics: webmainbench-results — every page's Markdown, stderr, and exit status. Source run and artifacts

All artifact fields are parsed by the trusted default-branch renderer; missing or invalid inputs remain visible as unavailable.

@lanyue-llk
lanyue-llk force-pushed the codex/content-rendered-state branch from f04b0b1 to 9272068 Compare October 22, 2026 07:18

@lanyue-llk lanyue-llk left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  1. [minor] Regression from the hidden-cell fix: a hidden table that takes the HTML fallback now emits an empty <table> skeleton, and visibility:collapse rows become empty GFM rows (visibility.rs:358).
  2. [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.
  3. [medium, #1336 × #1337, stack N2 still open] Live CSS boundaries change the text of linked code blocks (below, not anchorable in this diff).
  4. [low] Untouched range/color inputs print 50 / #000000 (visibility.rs:145). Stack N3.
  5. [low] UA table-column/table-column-group are still blocks, so fallback tables gain <div>s (visibility.rs:222). Stack N4.
  6. [nit] The control exemption is a tag-and-string special case split across two layers (visibility.rs:217).
  7. [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. A display:block line 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 while code is 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-tree against #1336 (99e374401) and against origin/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.

Comment thread moli-html2md/README.md Resolved
Comment thread moli-html2md/README.md Resolved
@lanyue-llk

Copy link
Copy Markdown
Contributor Author

Stack-level re-review (#1334–#1337), round 4

Scope. This round covers only cross-layer and combined-state problems. Refs: origin/main merge-base bd8e0b27a ← #1334 fb466fc6e ← #1335 f3c46b402 ← #1336 99e374401 ← #1337 92720683b. Unless marked otherwise, every location is file:line at 92720683b. I produced this by reading the code, not by running it. I built nothing and ran no tests. Each output below comes from tracing the named code path by hand. Stylo references point to the pinned revision e2baa14 from the local cargo checkout.

Changes since round 3. There are seven new commits: 2ff73d38e and fb466fc6e in #1334, f3c46b402 in #1335, 68cc9e546 and 99e374401 in #1336, and 92720683b in #1337. Five commits were rewritten (266c101fe, ba1f08f9d, 5dbb582f7, 2bc31c4a8, 7735789ca), and 040269fd4 replaces d0d841ea0. Nobody replied to the round-3 comment. git merge-tree origin/main 92720683b is clean.

This round fixes the two round-3 blockers in the cases we wrote down:

  • Tight lists and <select> now render the same on the live path as from source. html2md's new owns_boundaries (content.rs:140-142, used at machine.rs:216-223 and html_fallback.rs:192-201) handles this.
  • Hidden table cells keep their column. The adapter now reports invisible table and list parts as their own elements (visibility.rs:358-382).

Both fixes have exact-output live tests (page_vm/tests/markdown_dump.rs:471-491). The same class of bug is still reachable through display values that Stylo has blockified (N5 below), and the README now claims it is not.

Status of the round-3 findings

# Finding Status Evidence at 92720683b
1 UA display makes live lists and <select> loose FIXED for UA defaults; PARTIAL overall li/ul/ol/option/optgroup/select and table parts now skip the computed hooks (machine.rs:216-223, content.rs:140-142). I re-traced <ul><li>a</li><li>b</li></ul>: visit(li) gets no boundary(2), EndItem sees has_blocks=false, and the output is - a\n- b. The nested-list and select cases also match their tests (markdown_dump.rs:477-479). Residual: a non-structural child with a computed block still marks the item loose, because Writer::boundary(2) sets has_blocks even on an empty writer (writer.rs:277), and EndItem reads that flag (machine.rs:135,155). Example: a nav list styled li a { display:block }, <ul><li><a href="/a">A</a></li><li><a href="/b">B</a></li></ul>, gives - [A](/a)\n\n- [B](/b) live and - [A](/a)\n- [B](/b) from source. That contradicts README.md:168-169 ("do not turn native lists into loose lists"). The bigger remaining path is N5.
2 Hidden element reported as NodeKind::Document breaks tables FIXED visibility.rs:358-382 keeps table/thead/tbody/tfoot/tr/td/th/caption/list parts as elements, and their text children are still Other (:383-390). The round-3 table now gives | A | | alice | (test markdown_dump.rs:482). This also covers display:none <tr>/<li> ancestors on a disclosure_paths chain. Side effect, not a regression: a visibility:collapse row now emits an all-empty GFM row. Before, it broke the table.
3 Inline-block boundary is a newline in Markdown and a space in the fallback FIXED as reported Both paths now insert one space (machine.rs:220-223 Task::InlineSpace, html_fallback.rs:198-201). text(" ") does not close open styles, so <a href="/x">Download <i class="fa"></i> PDF</a> now stays [Download PDF](/x). Qty <input value="3"> <button>Update</button> in a cell has no <br>. Native controls with UA inline-block are exempt (visibility.rs:213-218). Two gaps remain: inside code see N2, and our round-3 suggestion of "a space" is itself wrong for per-character spans (N6).
4 Hooks without producers; README out of date PARTIAL The README is corrected only in #1337 (README.md:5,20-26,48). #1334–#1336 still ship "implements the interface directly", "four borrowed queries" and "eligibility checks never rescan cell descendants" (README.md:5,19,40 at 99e374401), while #1336's dom.rs:25-51 already has eight methods. The only producer is still #1337's adapter.
5 Changes filed in the wrong layer PARTIAL The textarea fix now lives in #1336. Still wrong: resource_url_attributes is added to html2md's public API inside the renderer commit 040269fd4 (media.rs:8-28, lib.rs:21), and the #1337 fetch commit 92720683b changes its semantics. In the other direction, the html2md-titled #1334 commit 2ff73d38e edits moli-renderer-v8/.../images/src.rs:776-792 again (see N1).
6 Production adapter barely tested FIXED (mostly) markdown_dump.rs:471-491 drives real Stylo through document.body.innerHTML and checks exact output for lists, a nested list, select, controls, a GFM cell with a button, a hidden cell, base-URL resolution, and dialog/popover tabpanels, with and without strip. fetch_cli/markdown.rs:75-95 adds an HTTP base-URL CLI test. The CLI layout test now expects live output to equal the source fixture (the -computed.md fixture is deleted). Gaps: no live case where Stylo blockifies an element (N5) and no linked code block (N2). The layout CLI test still loads a data: URL (fetch_cli/markdown.rs:15).
7 Stylo pinned to an unmerged fork branch inside an unrelated commit NOT FIXED Cargo.toml:115-121 is still e2baa14a…, and the bump is still inside renderer commit 040269fd4. GitHub compare main...e2baa14 reports ahead_by: 38. The only branch with it at its head is codex/moli-style-provenance.
8 Several full-document passes per live conversion NOT FIXED visibility.rs:57-108 still makes separate passes for fragment links, ids, aria-controls, tabpanel/until-found (each with a content_context root walk, :287-313, which now also probes popover), the display:none set, and the disclosure-path root walks, before the main pass (:119-261). The only reduction is that style collection now starts at <body> (page_dump.rs:19-27).
9 may_have_fragment_links predicate differs from the prepass FIXED visibility.rs:57-62 now requires a non-empty fragment, the same as anchors.rs:47-52. It still scans suppressed nodes, but that can only cause a false positive on a "may" hint.
10 Inconsistent role, URL and label rules PARTIAL Fixed: the resolution inventory now matches what html2md reads (source no longer resolves srcset; media.rs:11-18). Open: there are still five role parsers. First token: content.rs:73-74. Whole value, untrimmed: content.rs:112. Trim plus lowercase: machine.rs:429-434, html_fallback.rs:66-71. HTML-space trim: table.rs:29-32. Any token: visibility.rs:329-333. So role="presentation none" still makes an image presentational but leaves a table as data.
11 Stack hygiene NOT FIXED (more churn) There are now four empty commits (8663d9a89, 48001fb55 in #1334; aa5fafed8, 6ba81c991 in #1335). 957d1be5b is still titled fix(ci) but only moves tests, and the 2757784a9/e9dccde1e pair still nets to zero. New: 040269fd4 (#1337) adds a blank line after a doc comment and a double blank line in html2md, and 92720683b removes them again. 68cc9e546 adds format!("{}\n", …) to the CLI assertion, and 99e374401 reverts it within the same PR.
12 Overlapping PRs / #1592 CHANGED See "#1592" below. It no longer applies to the stack.
N1 Renderer srcset selection depends on html2md's parser NOT FIXED (now part of html2md's public API) parse_srcset_candidates (images/src.rs:776-792) still wraps moli_html2md::parse_srcset. 2ff73d38e removes its #[doc(hidden)] (lib.rs:21) and adds public width/height/density fields (media.rs:83-90), so browser image selection is now a documented html2md API. Parentheses still nest (media.rs:133-135). Input: srcset="a.png ((x), b.png 2x" with src="fallback.png". Under the spec's non-nesting paren state, b.png is selected. Here the comma is swallowed, the single descriptor ((x), b.png 2x is rejected, and currentSrc becomes fallback.png. The new renderer test (images/src.rs:1079) covers only Unicode spaces.
N2 Computed boundaries rewrite linked code in the HTML fallback NOT FIXED html_fallback.rs:190-201 still applies both hooks whatever code is. <pre><code>let v = <span style="display:inline-block">f</span>(<a href="/doc">x</a>);</code></pre> still gives let v = f (<a href="/doc">x</a>); live, while the unlinked raw path (machine.rs:379-392) gives let v = f(x);. A display:block span inside such a pre still becomes <div>.
N3 Sanitized range/color defaults leak into the live dump NOT FIXED (now more visible) The adapter still sets control_value from input_value() for every HTML input (visibility.rs:141-146). form.rs:28-47 now drops aria-label/title for non-button inputs. For <input type="range" aria-label="Volume level"> <input type="color" title="Theme">, source output is now empty and live output is 50 #000000.
N4 Catch-all classifier puts <div> inside fallback tables NOT FIXED visibility.rs:212 still classifies UA table-column/table-column-group as blocks. colgroup/col are in neither has_block_tag (html_fallback.rs:500-530) nor owns_boundaries, so a fallback table with <colgroup><col><col></colgroup> still emits <div><div></div><div></div></div> inside <table>. Adding colgroup/col to owns_boundaries fixes it.

New findings

# Severity PR Location Summary
N5 High #1337 × #1336 (missed in rounds 2–3) visibility.rs:211-224; machine.rs:216-223; Stylo style_adjuster.rs:221-256 Stylo blockifies flex/grid items, floats and absolutely positioned elements. The adapter then reports them as blocks, which brings the round-2 #1 bug back for buttons, search bars, list rows and screen-reader text
N6 Low #1336 hook mapping × #1337 classifier machine.rs:220-223, html_fallback.rs:198-201, visibility.rs:219-220 A space for every inline-* element splits words that are rendered one character per span

N5. High: blockified computed display defeats this round's fix

computed_style_export_values_for_document_snapshot reads the computed display (styles.rs:554-580), and that value comes after Stylo's style adjustment. StyleAdjuster::blockify_if_necessary (stylo e2baa14 style/style_adjuster.rs:221-256) turns any child of a flex or grid container, any floated element, and any position:absolute|fixed element into its block equivalent: inline becomes block, inline-block becomes block, and inline-flex becomes flex. Browsers report the same value from getComputedStyle. The classifier (visibility.rs:211-224) then puts the element in blocks:

  • The native-control exemption only matches the literal string inline-block (:217).
  • owns_boundaries only covers structural tags.

So machine.rs:217-219 emits boundary(2), and Writer::boundary closes every open inline style (writer.rs:279). Four common patterns trigger this on the default moli fetch --dump markdown path:

  • Search bar in a flex form. Input: <form role="search" style="display:flex"><input name="q" value="rust"> <button>Search</button></form>. Both controls compute to block, and the exemption misses them. Live output is rust\n\nSearch. Source output is rust Search.
  • Tailwind or shadcn button with an icon. Input: <p>Click <button class="inline-flex"><svg></svg><span>Save</span></button> to continue.</p>. The button gets a space, but the <span> is a flex item, so it computes to block. Live output is Click\n\nSave\n\nto continue. Source output is Click Save to continue.
  • Screen-reader text inside a link. Bootstrap .visually-hidden and Tailwind .sr-only both use position:absolute. Input: <a href="/p/1">Read more<span class="sr-only"> about Rust 2.0</span></a>. Live output is [Read more](/p/1)\n\n[about Rust 2.0](/p/1), with the link split and the paragraph broken. Source output is [Read more about Rust 2.0](/p/1).
  • Flex list rows and cells.
    • Input: <li style="display:flex"><a href="/a">Title</a><span>3 comments</span></li>. Each child gets boundary(2) on the item writer, which sets has_blocks (writer.rs:277), so the whole list becomes loose (machine.rs:155).
    • Input: <td><div style="display:flex"><span>Alice</span><button>Edit</button></div></td>. Live output is Alice<br><br>Edit (table.rs:197-199), where the matching unwrapped test (markdown_dump.rs:481) expects Alice Edit.

These four cases also contradict the new README claim at README.md:168-169. The fix belongs in the adapter's classifier, because only it can see why Stylo blockified an element:

  • Treat blockification caused by float or absolute positioning as inline. Stylo keeps the pre-adjustment value in original_display (properties.mako.rs:1436-1444). An equivalent check is to read position/float together with display.
  • Treat an item of a row-direction flex container (the parent's style is already in the map; read flex-direction as well) as an inline boundary, meaning a space. Only a column-direction flex container or a grid container should produce a block.
  • Separately, have html2md own the control boundary by adding input/button/textarea to owns_boundaries, so it no longer depends on one serialized string.
  • Add the four inputs above to markdown_dump.rs:476-485.

N6. Low: an inline-block space splits per-character text

has_text_boundary now always inserts a literal space (machine.rs:220-223, html_fallback.rs:198-201) for any inline* display (visibility.rs:219-220). Text-animation libraries such as GSAP SplitText and Splitting.js wrap each character in display:inline-block, and so do odometer counters.

  • Input: <h1><span style="display:inline-block">H</span><span style="display:inline-block">i</span></h1>
  • Live: # H i
  • Source and browser: # Hi

Our round-3 advice to use one space in both paths was incomplete. An inline-level box does not create a word boundary, and only margins or padding make one visible.

Fix. Insert the separator only when the boundary would not land between two non-space characters of a single word, for example when the element's text is a single grapheme with no adjacent source whitespace. Alternatively, limit inline_boundaries to replaced elements and controls, and treat other inline-* elements as inline.

#1592

#1592 (head 86ed30b95) is still stacked on the round-3 head f04b0b151, plus one new commit. It does not apply to 92720683b. Replaying only its own delta (git merge-tree --merge-base f04b0b151 92720683b 86ed30b95) conflicts in two places:

When rebasing, apply the body-only collection to each frame document, so that every frame's <html> and <body> stay in document_roots. #1592 also inherits N2–N6 through the shared MarkdownDom.

Merge readiness

Automated review by Claude Code.

@lanyue-llk
lanyue-llk force-pushed the codex/content-rendered-state branch from 9272068 to 6d0a254 Compare October 22, 2026 08:46

@lanyue-llk lanyue-llk left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  1. [high] N5 still open: blockified display turns flex children, floats and .sr-only/abspos spans into paragraph breaks (visibility.rs:222).
  2. [low] N6 still open: every inline-* box gets a space, so per-character spans split words (visibility.rs:223).
  3. [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).
  4. [low] The new range/color and hidden-structure test uses contains assertions, not exact output (markdown_dump.rs:505).
  5. [nit] col/colgroup in collapsed_table_part are no-ops. Collapsed columns still export their cells, though the author reply says columns are removed (visibility.rs:202).
  6. [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 86ed30b95 on the round-3 base f04b0b151. git merge-tree --merge-base f04b0b151 6d0a2549a 86ed30b95 conflicts in page_dump.rs and page_dump/visibility.rs. When it is rebased, it must apply body-only collection per frame document and run the new node_order reverse pass over each frame's styles.
  • Merge state: clean against #1336 (39ae6b32e) and against origin/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.

Comment thread moli-html2md/README.md Resolved
@lanyue-llk

Copy link
Copy Markdown
Contributor Author

Stack-level re-review (#1334–#1337), round 5

Scope. This round covers only cross-layer and combined-state problems. Refs: merge-base bd8e0b27a ← #1334 97ff3aeae ← #1335 396960e42 ← #1336 39ae6b32e ← #1337 6d0a2549a. These match the current PR heads on GitHub. Unless marked otherwise, every location is file:line at 6d0a2549a. I produced this by reading the code, not by running it. I built nothing and ran no tests. Each output below comes from tracing the named code path by hand. The per-commit buildability section relies on the Stylo sources in the local cargo checkout (973988b, e2baa14) and on symbol searches, not on a compiler.

Changes since round 4. Four new commits: 97ff3aeae in #1334, 396960e42 in #1335, 39ae6b32e in #1336 and 6d0a2549a in #1337. Everything above 97ff3aeae was replayed with identical patches, except 404a9f6a1 and d199e9eb5…eb3378657, which changed. Nobody has replied on #1334–#1337 since round 4. All comments there come from the review account or github-actions. git merge-tree origin/main 6d0a2549a (main 14d3c08cc) is clean.

Status of the round-4 findings

# Finding Status Evidence at 6d0a2549a / remaining input → wrong output
1 (residual) One computed block child makes a tight list loose FIXED Writer::layout_boundary (writer.rs:276-283) no longer sets has_blocks. flush_breaks sets it only when a blank line actually lands between emitted content (writer.rs:504). <ul><li><a style=display:block>A</a></li>… now gives - [A](…)\n- [B](…). Live tests: markdown_dump.rs:485, review_semantics.rs "computed_boundaries_supplement_structure…".
4 Hooks without producers; README out of date PARTIAL (unchanged) #1337's README is now accurate (README.md:5-31). #1334, #1335 and #1336 still ship "implements the interface directly", "four borrowed queries" and "never rescan cell descendants" (README.md:5,19,40 at 97ff3aeae, 396960e42 and 39ae6b32e), while dom.rs:25-55 at 39ae6b32e has eight methods. The corrected README arrives through a 94-line html2md README rewrite inside the renderer commit 6d0a2549a.
5 Changes filed in the wrong layer NOT FIXED (one new instance) The new commit 97ff3aeae is titled fix(renderer), but 6 of its 7 files are html2md. It changes image_label and poster semantics and the public parse_srcset, and the renderer side is one 7-line test (images/src.rs:1078-1083). 6d0a2549a (renderer) rewrites the html2md README. resource_url_attributes still enters html2md's public API through the renderer commit 9d9933e9e (media.rs:8-28, lib.rs).
7 Stylo pinned to an unmerged fork branch inside an unrelated commit NOT FIXED Cargo.toml:115-121 is still e2baa14a…, and the bump is still inside 9d9933e9e. The only branch with that commit at its head is still codex/moli-style-provenance. The pin now also breaks the build of earlier commits (see B1).
8 Several full-document passes per live conversion NOT FIXED (one more pass) 6d0a2549a adds a node_order copy of every styled node (visibility.rs:119) and a reverse pass with another HashSet (:266-283), on top of the passes listed in round 4.
10 Inconsistent role, URL and label rules PARTIAL Improved: three table-role sites now share the HTML-whitespace trim (machine.rs:432-436, html_fallback.rs:66-70, table.rs:29-31), and image_label/fallback_text share excluded_from_naming (content.rs:77-87). Four rules remain: first token (content.rs:68-69), exact untrimmed (content.rs:115-116), trimmed whole value (the three table sites) and any token (visibility.rs:351-355). role="presentation none" still makes an <img aria-label=X> presentational (label dropped) while the same value on a table leaves it a data table. role=" button" is not a button in content.rs:116 but would match under any other rule.
11 Stack hygiene NOT FIXED There are still four empty commits: 8663d9a89, 48001fb55 (#1334) and 2f69186f5, 0abaab870 (#1335; rebased copies of aa5fafed8/6ba81c991). cfa2e9917 is still titled fix(ci) but only moves tests. The 2757784a9/e9dccde1e pair is unchanged. New churn: 97ff3aeae switches the inline poster lookup in machine.rs to direct_attribute, and 39ae6b32e applies the same change again to media::poster after #1336 moved the code. 39ae6b32e reflows README paragraphs, and 6d0a2549a reflows them again. Two commit ranges do not build on their own (B1).
N1 Renderer srcset selection depends on html2md's parser FIXED (behavior); dependency remains parse_srcset now uses a non-nesting in_parentheses flag (media.rs:130-138), which matches the spec's paren state. a.png ((x), b.png 2x now yields only b.png, asserted on the renderer side (images/src.rs:1078-1083) and in html2md. The renderer still selects images through html2md's public parser. That is acceptable now that both sides pin the behavior with tests, but it should be stated as a deliberate API.
N2 Computed boundaries rewrite code in the HTML fallback FIXED (one low residual, B4) html_fallback.rs:194-205 now gates both hooks on !code. <pre><code>let v = <span style=display:inline-block>f</span>(<a href=/doc>x</a>);</code></pre> gives let v = f(<a href="/doc">x</a>); with no <div>, for both inline-block and block (test in review_semantics.rs).
N3 Sanitized range/color defaults leak into the live dump PARTIAL visibility.rs:142-145 skips the override only when the value attribute is absent. An empty or invalid attribute still exposes the sanitized default. <input type=range value=""> and <input type=color value=""> give 50 #000000 live and nothing from source (form.rs drops empty values). <input type=color value="red"> gives #000000 live and red from source. Fix: like textarea, override value only when input_value_dirty() is set (or when the sanitized value equals the attribute). A clean input's value is just its sanitized default attribute.
N4 colgroup/col become <div> inside fallback tables FIXED col/colgroup are now in owns_boundaries (machine.rs:828-830). Live exact test at markdown_dump.rs:490.
N5 Blockified computed display (flex/grid items, floats, absolute positioning) NOT FIXED The classifier is unchanged apart from dropping the native-control exemption (visibility.rs:222-228), and nothing reads position, float or the parent's display/flex-direction. layout_boundary stops a single block child from loosening a list, but every round-4 input still splits. <form style=display:flex><input value=rust> <button>Search</button></form> gives rust\n\nSearch (source: rust Search). <a href=/p/1>Read more<span class=sr-only> about Rust 2.0</span></a> gives [Read more](/p/1)\n\n[about Rust 2.0](/p/1). <li style=display:flex><a href=/a>Title</a><span>3 comments</span></li> still gives a loose list: the second block child's breaks flush onto content (writer.rs:504). <td><div style=display:flex><span>Alice</span><button>Edit</button></div></td> gives Alice<br><br>Edit. None of these cases has a live test. The fix is the same as in round 4.
N6 An inline-block space splits per-character text NOT FIXED (now asserted) There is no reply, and review_semantics.rs now asserts <span style=display:inline-block>A</span><span style=display:inline-block>B</span> → A B. <h1> with SplitText-style per-letter spans still gives # H i live and # Hi from source and in the browser. Removing the control exemption makes the space rule apply to more elements (B3).
12 #1592 NOT APPLICABLE See the #1592 section below.

New findings

# Severity PR Location Summary
B1 High (bisectability, missed in earlier rounds) #1337, #1336 style_engine/computed.rs:309-313 at 3de6dee7f; html_table.rs:245 at d6144d075 Nine commits do not compile on their own
B2 Medium (new this round) #1337 visibility.rs:199-213 Suppressing visibility:collapse rows moves rowspan cells into the wrong row
B3 Low (new this round) #1337 visibility.rs:199-213, :183-193 The collapse rule ignores disclosure veils and own_visibility, so tables inside retained panels lose their rows
B4 Low (new this round) #1336 html_fallback.rs:192-205 vs machine.rs:219-226 The code gate also covers the <code> element itself, so the two output paths treat a styled <code> differently
B5 Info #1337 visibility.rs:199-203 The col/colgroup entries in the collapse rule do nothing; collapsed columns still emit their cells

B1. High: nine commits do not compile on their own

  1. Stylo flag used before the pin bump (fix(renderer): export live rendered content through shared markdown conversion #1337). 3de6dee7f, 6959b3731, 64c3cc6b5 and 78fdd3545 call ComputedValueFlags::HAS_OWN_VISIBILITY (moli-renderer-v8/src/style_engine/computed.rs:312 at 3de6dee7f, imported from Stylo at :9). Cargo.toml and Cargo.lock still pin Stylo 973988b9c… in those commits, and 973988b/style/properties/computed_value_flags.rs has no such constant. It first appears at e2baa14 (computed_value_flags.rs:148). The pin moves only in 9d9933e9e, the fifth fix(renderer): export live rendered content through shared markdown conversion #1337 commit.
  2. Call to a deleted helper (fix(html2md): retain complex tables and referenced fragments #1336). d6144d075, 493582327, 7aa8ad9ad, d199e9eb5 and 499b5f96a call crate::content::has_readable_content (moli-html2md/src/html_table.rs:245). That function was added in 8432da1f5 and deleted in e9dccde1e, both in fix(html2md): preserve media resources and readable controls #1334. Nothing in the stack defines it again. The call goes away only in 60063abd1.

Both problems were already present in round 4 (90a2e5992 and 5dbb582f7 carried the same patches), and earlier rounds missed them. The PR heads themselves look consistent. Fix: move the Stylo bump into 3de6dee7f, or into a commit before it, ideally after the fork change has merged (#7). Fold the html_table.rs:245 change from 60063abd1 into d6144d075. Otherwise, require squash-merge for #1336 and #1337. A rebase merge would put commits on main that do not build.

Other per-commit checks found no further breaks. I resolved crate::module::item paths, Task::* variants, writer() methods, the arity of the math::spans tuple, ExportStyle fields and moli_html2md::* re-exports at every commit. This was a symbol search, not a compiler.

B2. Medium: collapsed rows shift rowspan cells (new in 6d0a2549a)

collapsed_table_part now puts a visibility:collapse tr/thead/tbody/tfoot into suppressed (visibility.rs:199-213), which removes it from html2md's view entirely. In round 4 the row stayed in place as an empty row. CSS 2 §17.5.5 and browsers handle collapse differently: the row's space is removed, but the table grid does not change, and a rowspan that reaches into the collapsed row is clipped. It does not extend into the next row.

  • Input: <table><tr><th>K</th><th>V</th></tr><tr><td rowspan=2>A</td><td>B</td></tr><tr style="visibility:collapse"><td>C</td></tr><tr><td>X</td><td>Y</td></tr></table>
  • Browser: X under K and Y under V.
  • Live dump: html2md sees three rows. A's rowspan=2 now covers the X row, so the HTML fallback gives <tr><td rowspan="2">A</td><td>B</td></tr><tr><td>X</td><td>Y</td></tr>. A reader sees X under V, and Y falls into a third column the header does not have.
  • Source path: correct.

This is the same class of misplaced cells as round-2 #2. display:none rows are a different case, because they really do leave the grid in browsers, so their suppression is correct.

Fix: handle collapsed rows the way hidden cells are handled. Mark them invisible (keep the elements, drop their text) instead of suppressed, or suppress them only when no rowspan from an earlier row reaches into them.

B3. Low: the collapse rule overrides disclosure veils (new in 6d0a2549a)

visibility is inherited, and collapsed_table_part reads the computed value without checking own_visibility, disclosure_root, disclosure_path or visibility_mode (visibility.rs:199-213). The display:none branch beside it does exempt disclosure roots and paths.

  • Input: <button aria-expanded=false aria-controls=spec>Specs</button><section id=spec style="visibility:collapse"><p>Dimensions</p><table><tr><th>Weight</th><td>2 kg</td></tr></table></section>. Tailwind's collapse utility is visibility: collapse.
  • Expected: the section is a disclosure root, so it gets DisclosureVeil (:183). Its <p> inherits the veil and is kept (:189-193).
  • Actual: the parser-generated <tbody> inherits collapse and is suppressed. The live dump keeps Dimensions but drops the spec table, while the source dump keeps both.

Fix: apply the rule only when values.own_visibility is set and the node is not under a disclosure veil. That is the same condition the VisibilityMode code at :187-193 already uses.

B4. Low: styled <code> is treated differently by the two output paths (new in 39ae6b32e)

html_fallback.rs:192 updates code before checking the hooks, so a <code> element skips its own has_block_layout/has_text_boundary. Machine::visit (machine.rs:219-226) applies both hooks to the same element. In a live dump, with code { display:inline-block } or display:block (a common blog style):

  • Input: a<code>x</code>b.
  • Markdown path: a `x` b for inline-block, or a separate paragraph for block.
  • HTML fallback (for example inside a spanned table cell): a<code>x</code>b, with no separation.

Fix: use the parent's code flag for the hook checks, and update code after them.

B5. Info: collapsed columns

col/colgroup in collapsed_table_part (visibility.rs:202) have no content, so suppressing them changes nothing. Cells are not children of col, so they do not inherit its visibility. <col style="visibility:collapse"> therefore leaves that column's cells in the live dump, while the browser hides them. The README claims only that collapsed rows are omitted, so this is a known limit, not a contradiction. Either drop the two tags from the match or implement column collapse.

Checked this round, no cross-layer problem found

  • Native-control exemption removed (6d0a2549a). UA inline-block controls now get collapsible spaces on both paths. select/option still own their boundaries. Code is gated on both paths. Outside N5 and N6, this adds only separation that the source path also produces.
  • The visible_subtrees pass (visibility.rs:266-283). The reverse pre-order keeps a table or list whose descendant restores visibility, including disclosure roots, and drops wholly invisible ones. It matches the new tests at markdown_dump.rs:486,501-510.
  • flush_breaks sets has_blocks (writer.rs:504). On the source path this changes only items that already contain blank-line-separated blocks (for example <li>a<ul><li>b</li></ul>c</li>), which CommonMark already parses as loose.
  • Math changes in fix(html2md): preserve mathematical and inline formatting semantics #1335 (396960e42: <!-- --> between adjacent spans, {} after a trailing control space). These are html2md only and do not touch the hooks or the adapter.

#1592

#1592 is unchanged (head 86ed30b95). It is still stacked on the round-3 head f04b0b151 and does not apply to 6d0a2549a. git merge-tree --merge-base f04b0b151 6d0a2549a 86ed30b95 conflicts in the same two hunks as in round 4:

  • page_dump.rs:26-46: body-only collection versus collection of every frame document with per-document bases.
  • visibility.rs:259-265: the base_url parameter and tag versus document_bases and names.

When rebasing, apply the <html>-plus-<body> collection to each frame document. Also note that document_visibility_is_hidden (visibility.rs:53-56) and the new visible_subtrees pass look only at the top document's <html>/<body>, so a frame's root visibility veil will not be recognised. #1592 also inherits N3, N5, N6 and B2–B4 through the shared MarkdownDom.

Merge readiness

Automated review by Claude Code.

@lanyue-llk
lanyue-llk force-pushed the codex/content-rendered-state branch from 6d0a254 to 4e58ef8 Compare October 22, 2026 10:41

@lanyue-llk lanyue-llk left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:contents wrapper between a row-flex container and its items still gives paragraph breaks, because original_display is 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 (head 8a423e752, merge-base = this head). git merge-tree is 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)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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).

@lanyue-llk
lanyue-llk force-pushed the codex/content-rendered-state branch from 4e58ef8 to 19bfc78 Compare October 22, 2026 11:48
Base automatically changed from codex/content-tables-fragments to main October 27, 2026 20:43
@ldm0
ldm0 force-pushed the codex/content-rendered-state branch 3 times, most recently from eeb9156 to 8fa1598 Compare November 3, 2026 01:31
@ldm0
ldm0 force-pushed the codex/content-rendered-state branch from 8fa1598 to c582612 Compare November 3, 2026 07:46
@ldm0
ldm0 merged commit 03763e8 into main Nov 3, 2026
38 of 40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants