Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the ignoreErrors option from the FontFaceObject class #18066

Merged

Conversation

Snuffleupagus
Copy link
Collaborator

  • The stopAtErrors API option, which is the inverse of the "internal" ignoreErrors option, is explicitly documented as applying to parsing (i.e. the worker-thread) while the FontFaceObject class is used during rendering (i.e. the main-thread); see

    pdf.js/src/display/api.js

    Lines 164 to 167 in b676540

    * @property {boolean} [stopAtErrors] - Reject certain promises, e.g.
    * `getOperatorList`, `getTextContent`, and `RenderTask`, when the associated
    * PDF data cannot be successfully parsed, instead of attempting to recover
    * whatever possible of the data. The default value is `false`.

  • A glyph that fails in the FontRendererFactory, on the worker-thread, will already cause (overall) parsing to stop when ignoreErrors === false hence checking the option on the main-thread as well seems redundant; see

    pdf.js/src/core/evaluator.js

    Lines 4527 to 4533 in b676540

    } catch (reason) {
    if (evaluatorOptions.ignoreErrors) {
    warn(`buildFontPaths - ignoring ${glyphName} glyph: "${reason}".`);
    return;
    }
    throw reason;
    }

  • Removing this option simplifies the code, and slightly reduces the number of options that we need to handle in the main-thread code.

 - The `stopAtErrors` API option, which is the inverse of the "internal" `ignoreErrors` option, is explicitly documented as applying to *parsing* (i.e. the worker-thread) while the `FontFaceObject` class is used during rendering (i.e. the main-thread); see https://github.com/mozilla/pdf.js/blob/b6765403a1b08aa80a21cb0809741875a925ab4d/src/display/api.js#L164-L167

 - A glyph that fails in the `FontRendererFactory`, on the worker-thread, will already cause (overall) parsing to stop when `ignoreErrors === false` hence checking the option on the main-thread as well seems redundant; see https://github.com/mozilla/pdf.js/blob/b6765403a1b08aa80a21cb0809741875a925ab4d/src/core/evaluator.js#L4527-L4533

 - Removing this option simplifies the code, and slightly reduces the number of options that we need to handle in the main-thread code.
@Snuffleupagus
Copy link
Collaborator Author

/botio test

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/62f5af02a7e7642/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/62f5af02a7e7642/output.txt

Total script time: 27.45 mins

  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 18
  different first/second rendering: 1

Image differences available at: http://54.241.84.105:8877/62f5af02a7e7642/reftest-analyzer.html#web=eq.log

Copy link
Contributor

@timvandermeij timvandermeij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me, with passing Windows tests once the bot is working again (since this might, although not very likely, differ between Linux and Windows). Thank you!

@Snuffleupagus
Copy link
Collaborator Author

/botio-windows test

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.193.163.58:8877/c9cce03005fa799/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/c9cce03005fa799/output.txt

Total script time: 42.63 mins

  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 47

Image differences available at: http://54.193.163.58:8877/c9cce03005fa799/reftest-analyzer.html#web=eq.log

@Snuffleupagus Snuffleupagus merged commit 761abc7 into mozilla:master May 14, 2024
9 checks passed
@Snuffleupagus
Copy link
Collaborator Author

The small movement in various XFA reference-tests look like the usual fallout from Firefox being updated (in this case to version 128) on the bots.

/botio makeref

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_makeref from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/e8c7d6cda5c94d0/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_makeref from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.193.163.58:8877/d7d048fab6984f8/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/e8c7d6cda5c94d0/output.txt

Total script time: 20.05 mins

  • Lint: Passed
  • Make references: Passed
  • Check references: Passed

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/d7d048fab6984f8/output.txt

Total script time: 25.40 mins

  • Lint: Passed
  • Make references: Passed
  • Check references: Passed

@Snuffleupagus Snuffleupagus deleted the rm-FontFaceObject-ignoreErrors branch May 14, 2024 08:17
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.

3 participants