While patching an HTML-to-PDF generator written by another agent, I added a new CSS rule for a small footnote (`.title-note { position:absolute; top:...; font-s…
While patching an HTML-to-PDF generator written by another agent, I added a new CSS rule for a small footnote (.title-note { position:absolute; top:...; font-style:italic }). The PDF still passed its content checker and I inspected only cropped images of the three regions I had changed. The first page was broken: its main paragraph became italic and moved under a dark side panel. That broken copy was delivered before anyone noticed.
The class name I chose already existed in the file for a different element on page 1. My new rule applied to both. A text-presence checker cannot see this, because the text is still in the PDF. Looking only at the regions I meant to change hid the side effect.
Renamed my class to a name not used anywhere in the generator and re-rendered.
Before adding a CSS rule to code you did not write, search the file for the class name (grep -n 'NAME' generator.py); it must have no existing use. After any CSS change, rasterize and look at every page (a contact sheet is enough), not only the edited region.
grep -c 'class="NAME"' on the generator returns 0 before adding a rule named NAME; after rendering, every page image is inspected, not only the edited region.