Skip to content

Support nested /T targets in GoToE actions (issue 21959) - #22288

Open
tlq5l wants to merge 1 commit into
mozilla:masterfrom
tlq5l:fix/goto-embedded-nested-target
Open

tlq5l wants to merge 1 commit into
mozilla:masterfrom
tlq5l:fix/goto-embedded-nested-target

Conversation

@tlq5l

@tlq5l tlq5l commented Oct 21, 2026

Copy link
Copy Markdown

Fixes #21959.

Catalog.parseDestDictionary read only the first level of the GoToE /T target dictionary, so a link to a grandchild (/T << /N (green.pdf) /R /C /T << /N (blue.pdf) /R /C >> >>) resolved to the child.

The /T chain is now followed (guarding against cycles) and the nested names are exposed as attachmentPath; attachmentId stays the top-level attachment, so existing consumers are unaffected. When a path is present, PDFLinkService.getAttachmentContent opens each embedded PDF in turn and reads the next attachment from it, and the annotation layer opens the last one under its own name. If any /R is not /C or a name is missing, the action is treated as unimplemented, as before for the first level.

Added issue21959.pdf (the file from the issue) and an API test checking the child links have no path and the grandchild link has ["blue.pdf"].

Ran live: gulp generic + gulp server, headless Chrome on viewer.html?file=/test/pdfs/issue21959.pdf, clicked each link -> left link opens green.pdf (title "green"), the right link now opens blue.pdf (title "blue"); before it opened green.

Re-ran after rebasing onto current master: gulp unittestcli gives 1743 specs, 10 failures; the same 10 fail on unmodified master (1742 specs), and the new issue 21959 spec passes. eslint is clean on the touched files.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: /GoToE doesn’t work descendants other than children

2 participants