check:side-lanes accepts the document print: a printed sheet goes to its own document before any raster (the photo guarantee holds), and its poison follows the new line

This commit is contained in:
Doxa Maps 2026-10-03 16:27:58 +00:00
parent 02d708769c
commit 19bce9aa94

View file

@ -107,7 +107,11 @@ async function photoArms(html, rasterSrc, wallSrc) {
else if (ext(svg)) fails.push(`photos: rasterPoster would rasterise ${ext(svg)} external <image> (each one prints the broken-image glyph)`)
// (b) the wall's generated-sheet branch prints a sheet with external images as a document, before any raster
const branch = (wallSrc.match(/if \(props\.sheet\) \{[\s\S]*?rasterPoster\(html/) || [''])[0]
if (!/posterAction === 'print' && hasExternalImages\(html\)\) \{ await printSheetDocument\(html\); return \}/.test(branch)) fails.push('photos: PosterWall prints a sheet with photos through the raster (they cannot draw there)')
// Either route keeps the guarantee: a PRINT of a sheet with photos never reaches the raster. Today every printed
// sheet goes to its own document first (the document print); before that, only a sheet with photos did.
const docFirst = /posterAction === 'print'\) \{ step\('print'\); await printSheetDocument\(html\); return \}/.test(branch)
|| /posterAction === 'print' && hasExternalImages\(html\)\) \{ await printSheetDocument\(html\); return \}/.test(branch)
if (!docFirst) fails.push('photos: PosterWall prints a sheet with photos through the raster (they cannot draw there)')
if (!/async function printSheetDocument\(html\)[\s\S]{0,400}printDocument\(html,/.test(wallSrc)) fails.push('photos: printSheetDocument does not hand the sheet itself to printDocument')
return fails
}
@ -152,7 +156,7 @@ if (selfTest) {
const rs = readFileSync(RASTER, 'utf8'), ws = readFileSync(WALL, 'utf8')
for (const [name, r, w, rx] of [
['a raster that keeps external images', rs.replace('stripExternalImages(inlineSvg(posterHtml))', 'inlineSvg(posterHtml)'), ws, /rasterise \d+ external/],
['a wall print that rasterises a sheet with photos', rs, ws.replace("if (props.posterAction === 'print' && hasExternalImages(html)) { await printSheetDocument(html); return }", ''), /through the raster/],
['a wall print that rasterises a sheet with photos', rs, ws.replace("if (props.posterAction === 'print') { step('print'); await printSheetDocument(html); return }", ''), /through the raster/],
]) {
if (r === rs && w === ws) { console.log(`NOT MEASURED: the poison anchor for "${name}" moved`); process.exitCode = 75; continue }
const f = await photoArms(html, r, w)