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][Editor] Don't use the editor parent which can be null. #15782

Merged
merged 1 commit into from
Dec 8, 2022

Conversation

calixteman
Copy link
Contributor

@calixteman calixteman commented Dec 5, 2022

An annotation editor layer can be destroyed when it's invisible, hence some
annotations can have a null parent but when printing/saving or when changing
font size, color, ... of all added annotations (when selected with ctrl+a) we
still need to have some parent properties especially the page dimensions, global
scale factor and global rotation angle.
This patch aims to remove all the references to the parent in the editor instances
except in some cases where an editor should obviously have one.
It fixes #15780.

test/integration/test_utils.js Outdated Show resolved Hide resolved
test/integration/scripting_spec.js Outdated Show resolved Hide resolved
src/display/editor/editor.js Outdated Show resolved Hide resolved
@calixteman calixteman changed the title [Editor] Serialize editors when the parent layer is destroyed [Editor] Don't use the editor parent which can be null. Dec 6, 2022
src/display/editor/editor.js Outdated Show resolved Hide resolved
src/display/editor/editor.js Outdated Show resolved Hide resolved
src/display/editor/tools.js Outdated Show resolved Hide resolved
src/display/editor/tools.js Outdated Show resolved Hide resolved
web/pdf_viewer.js Outdated Show resolved Hide resolved
@Snuffleupagus
Copy link
Collaborator

Also, something that just occurred to me: Is this perhaps something that we want to try and uplift?
If so, would it make sense to land the previous (much smaller) patch first and then make the larger re-factoring later to mitigate risks?

@calixteman
Copy link
Contributor Author

Also, something that just occurred to me: Is this perhaps something that we want to try and uplift? If so, would it make sense to land the previous (much smaller) patch first and then make the larger re-factoring later to mitigate risks?

Good question, let me think (chat with @marco-c) about it.

@calixteman calixteman marked this pull request as draft December 6, 2022 15:21
@calixteman calixteman marked this pull request as ready for review December 7, 2022 09:18
@calixteman calixteman marked this pull request as draft December 7, 2022 11:35
@calixteman calixteman marked this pull request as ready for review December 7, 2022 11:59
@Snuffleupagus
Copy link
Collaborator

/botio test

@pdfjsbot
Copy link

pdfjsbot commented Dec 7, 2022

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/36b28e684d7f658/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Dec 7, 2022

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/64098853c2d09d6/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Dec 7, 2022

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/36b28e684d7f658/output.txt

Total script time: 25.44 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 9
  different first/second rendering: 2

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

@pdfjsbot
Copy link

pdfjsbot commented Dec 7, 2022

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/64098853c2d09d6/output.txt

Total script time: 31.19 mins

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

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

@calixteman
Copy link
Contributor Author

/botio integrationtest

@pdfjsbot
Copy link

pdfjsbot commented Dec 7, 2022

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.241.84.105:8877/235270412fdf8f0/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Dec 7, 2022

From: Bot.io (Windows)


Received

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

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

@pdfjsbot
Copy link

pdfjsbot commented Dec 7, 2022

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/235270412fdf8f0/output.txt

Total script time: 4.18 mins

  • Integration Tests: Passed

@pdfjsbot
Copy link

pdfjsbot commented Dec 7, 2022

From: Bot.io (Windows)


Failed

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

Total script time: 12.47 mins

  • Integration Tests: FAILED

@Snuffleupagus Snuffleupagus changed the title [Editor] Don't use the editor parent which can be null. [api-minor][Editor] Don't use the editor parent which can be null. Dec 8, 2022
web/pdf_viewer.js Outdated Show resolved Hide resolved
web/interfaces.js Outdated Show resolved Hide resolved
web/default_factory.js Outdated Show resolved Hide resolved
src/display/editor/tools.js Outdated Show resolved Hide resolved
src/display/editor/tools.js Outdated Show resolved Hide resolved
src/display/editor/ink.js Outdated Show resolved Hide resolved
An annotation editor layer can be destroyed when it's invisible, hence some
annotations can have a null parent but when printing/saving or when changing
font size, color, ... of all added annotations (when selected with ctrl+a) we
still need to have some parent properties especially the page dimensions, global
scale factor and global rotation angle.
This patch aims to remove all the references to the parent in the editor instances
except in some cases where an editor should obviously have one.
It fixes mozilla#15780.
@calixteman
Copy link
Contributor Author

/botio integrationtest

@pdfjsbot
Copy link

pdfjsbot commented Dec 8, 2022

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/01d7d5c6cabf114/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Dec 8, 2022

From: Bot.io (Linux m4)


Received

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

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

@pdfjsbot
Copy link

pdfjsbot commented Dec 8, 2022

From: Bot.io (Linux m4)


Success

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

Total script time: 4.25 mins

  • Integration Tests: Passed

@pdfjsbot
Copy link

pdfjsbot commented Dec 8, 2022

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/01d7d5c6cabf114/output.txt

Total script time: 10.48 mins

  • Integration Tests: FAILED

Copy link
Collaborator

@Snuffleupagus Snuffleupagus 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, since I'm assuming that you've tested this carefully locally (given the amount of changes); thank you!

@calixteman calixteman merged commit fe3df4d into mozilla:master Dec 8, 2022
@calixteman calixteman deleted the 15780 branch December 8, 2022 13:27
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.

When annotaion exceeds 10 pages, print and download are abnormal
3 participants