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

[api-minor] Implement basic support for OptionalContent Usage dicts (issue 5764, bug 1826783) #17726

Merged
merged 2 commits into from Mar 12, 2024

Conversation

Snuffleupagus
Copy link
Collaborator

@Snuffleupagus Snuffleupagus commented Feb 25, 2024

The following are some highlights of this patch:

  • In the Worker we only extract a subset of the potential contents of the Usage dictionary, to avoid having to implement/test a bunch of code that'd be completely unused in the viewer.

  • In order to still allow the user to manually override the default visible layers in the viewer, the viewable/printable state is purposely not enforced during initialization in the OptionalContentConfig constructor.

  • Printing will now always use the default visible layers, rather than using the same state as the viewer (as was the case previously).
    This ensures that the printing-output will correctly take the Usage dictionary into account, and in practice toggling of visible layers rarely seem to be necessary except in the viewer itself (if at all).[1]


[1] In the unlikely case that it'd ever be deemed necessary to support fine-grained control of optional content visibility during printing, some new (additional) UI would likely be needed to support that case.

@Snuffleupagus Snuffleupagus force-pushed the OptionalContent-Usage branch 9 times, most recently from 002ea3f to 06d269b Compare February 27, 2024 16:46
@Snuffleupagus
Copy link
Collaborator Author

/botio-linux preview

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.241.84.105:8877/2bdfe9b8fd5c021/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/2bdfe9b8fd5c021/output.txt

Total script time: 1.39 mins

Published

@Snuffleupagus Snuffleupagus marked this pull request as ready for review February 27, 2024 16:53
src/core/catalog.js Outdated Show resolved Hide resolved
@Snuffleupagus Snuffleupagus force-pushed the OptionalContent-Usage branch 2 times, most recently from 088940c to f8ce385 Compare March 5, 2024 17:00
Copy link
Contributor

@calixteman calixteman left a comment

Choose a reason for hiding this comment

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

Overall it looks good to me. Thank you.

… (issue 5764, bug 1826783)

The following are some highlights of this patch:
 - In the Worker we only extract a *subset* of the potential contents of the `Usage` dictionary, to avoid having to implement/test a bunch of code that'd be completely unused in the viewer.

 - In order to still allow the user to *manually* override the default visible layers in the viewer, the viewable/printable state is purposely *not* enforced during initialization in the `OptionalContentConfig` constructor.

 - Printing will now always use the *default* visible layers, rather than using the same state as the viewer (as was the case previously).
   This ensures that the printing-output will correctly take the `Usage` dictionary into account, and in practice toggling of visible layers rarely seem to be necessary except in the viewer itself (if at all).[1]

---
[1] In the unlikely case that it'd ever be deemed necessary to support fine-grained control of optional content visibility during printing, some new (additional) UI would likely be needed to support that case.
… (PR 15377 follow-up)

This helps ensure that /SetOCGState actions always take the `Usage` dictionary into account as expected.
@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/e7276edd9b5529b/output.txt

@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/f3c88d08f4d3284/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

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

Total script time: 25.32 mins

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

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

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

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

Total script time: 42.81 mins

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

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

@Snuffleupagus Snuffleupagus merged commit eb16072 into mozilla:master Mar 12, 2024
9 checks passed
@Snuffleupagus
Copy link
Collaborator Author

/botio makeref

@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/9bbc1f8022c4ae0/output.txt

@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/1df8ac9ab5ddf69/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/1df8ac9ab5ddf69/output.txt

Total script time: 18.84 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/9bbc1f8022c4ae0/output.txt

Total script time: 27.29 mins

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

@Snuffleupagus Snuffleupagus deleted the OptionalContent-Usage branch March 12, 2024 13:46
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.

'Only print' watermark is shown ( incorrectly ) when viewed in browser
3 participants