mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-10-26 11:08:48 -06:00
Review on #3943, point 1. has_password_values ran a full fields() walk on every save and recovery snapshot, and clear_password_values walked every field's ancestors again for each ancestor of each target. has_password_flag now answers first, reading only /Ff, /Kids and /Parent: the field tree from /Fields (seen set, 32 levels) and, as fields() does, the widgets on the pages with the fields above them. A form without such a field returns before any Field is built. clear_password_values finds each field's ancestors once. The test puts a page-only widget, a flag inherited from an unlisted parent and a nested field whose widget is on no page each alone in a document. Mutants that drop the page scan, the parent chain, the tree walk or the descent into kids each fail it, as does treating every ancestor as exclusive. Dropping the seen set or the early-out changes only speed (equivalent). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>