Skip to content

Fix the rendering of XFA rich text in popup annotations#20238

Merged
calixteman merged 1 commit intomozilla:masterfrom
timvandermeij:fix-freetext-permafail
Sep 7, 2025
Merged

Fix the rendering of XFA rich text in popup annotations#20238
calixteman merged 1 commit intomozilla:masterfrom
timvandermeij:fix-freetext-permafail

Conversation

@timvandermeij
Copy link
Contributor

Before the introduction of the renderRichText helper function we exclusively used this.#html for XFA rich text and exclusively used this.#contentsObj for plain text. However, after the refactoring we tried to access this.#contentsObj.dir in both cases, which fails for XFA rich text because this.#contentsObj is null in that case.

This commit fixes the issue by using optional chaining to make sure we don't try to access non-existent this.#contentsObj properties, which makes the must update an existing annotation and show the right popup freetext integration pass again.

Fixes #20237.
Fixes 35c9098.

Before the introduction of the `renderRichText` helper function we
exclusively used `this.#html` for XFA rich text and exclusively used
`this.#contentsObj` for plain text. However, after the refactoring we
tried to access `this.#contentsObj.dir` in both cases, which fails for
XFA rich text because `this.#contentsObj` is `null` in that case.

This commit fixes the issue by using optional chaining to make sure we
don't try to access non-existent `this.#contentsObj` properties, which
makes the `must update an existing annotation and show the right popup`
freetext integration pass again.

Fixes mozilla#20237.
Fixes 35c9098.
@timvandermeij
Copy link
Contributor Author

/botio integrationtest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_integrationtest from @timvandermeij received. Current queue size: 0

Live output at: http://54.241.84.105:8877/5c6e7537f1771fa/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_integrationtest from @timvandermeij received. Current queue size: 0

Live output at: http://54.193.163.58:8877/349fa40d8aabfbc/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/5c6e7537f1771fa/output.txt

Total script time: 18.17 mins

  • Integration Tests: Passed

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/349fa40d8aabfbc/output.txt

Total script time: 39.31 mins

  • Integration Tests: Passed

@calixteman calixteman merged commit d946de9 into mozilla:master Sep 7, 2025
9 checks passed
@timvandermeij timvandermeij deleted the fix-freetext-permafail branch September 8, 2025 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Integration test must update an existing annotation and show the right popup permafails

3 participants