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] Get rid of CSS transform on each annotation in the annotation layer #15036

Merged
merged 1 commit into from
Jun 19, 2022

Conversation

calixteman
Copy link
Contributor

  • each annotation has its coordinates/dimensions expressed in percentage,
    hence it's correctly positioned whatever the scale factor is;
  • the font sizes are expressed in percentage too and the main font size
    is scaled thanks a css var (--scale-factor);
  • the rotation is now applied on the div annotationLayer;
  • this patch improve the rendering of some strings where the glyph spacing
    was not correct (it's a Firefox bug);
  • it helps to simplify the code and it should slightly improve the update of
    page (on zoom or rotation).

@Snuffleupagus Snuffleupagus changed the title Get rid of CSS transform on each annotation in the annotation layer [api-minor] Get rid of CSS transform on each annotation in the annotation layer Jun 13, 2022
@Snuffleupagus
Copy link
Collaborator

I'm assuming, based on a very brief look at the code, that we no longer can easily avoid having both a --scale-factor and a --zoom-factor CSS variable?

@calixteman calixteman force-pushed the remove_scale branch 2 times, most recently from 333a597 to d72e819 Compare June 13, 2022 17:40
@Snuffleupagus
Copy link
Collaborator

Also, with the last round of changes it seems that

/**
* Get the zoom factor.
* @returns {number}
*/
get zoomFactor() {
return this.viewport.scale / PixelsPerInch.PDF_TO_CSS_UNITS;
}
is now unused. Are you planning on using that one later, or can it be removed?

@Snuffleupagus
Copy link
Collaborator

/botio test

@pdfjsbot
Copy link

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/11c6759447a1ac9/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/3691ae9085a7771/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/11c6759447a1ac9/output.txt

Total script time: 26.09 mins

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

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

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/3691ae9085a7771/output.txt

Total script time: 28.35 mins

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

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

@calixteman
Copy link
Contributor Author

/botio browsertest

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.241.84.105:8877/277aa41f8d821d0/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/88cb25d1f3c8a30/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/88cb25d1f3c8a30/output.txt

Total script time: 20.99 mins

  • Regression tests: FAILED
  different ref/snapshot: 69

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

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/277aa41f8d821d0/output.txt

Total script time: 21.90 mins

  • Regression tests: FAILED
  different ref/snapshot: 159
  different first/second rendering: 1

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

@calixteman
Copy link
Contributor Author

/botio browsertest

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.241.84.105:8877/1fe7461cdabf122/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/24c633e5dd31ec1/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/24c633e5dd31ec1/output.txt

Total script time: 20.83 mins

  • Regression tests: FAILED
  different ref/snapshot: 69

Image differences available at: http://54.193.163.58:8877/24c633e5dd31ec1/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.

Fixes #14935 I presume? Looks good to me with these comments addressed.

src/display/annotation_layer.js Outdated Show resolved Hide resolved
src/display/annotation_layer.js Outdated Show resolved Hide resolved
src/display/base_factory.js Outdated Show resolved Hide resolved
@calixteman calixteman linked an issue Jun 18, 2022 that may be closed by this pull request
- each annotation has its coordinates/dimensions expressed in percentage,
  hence it's correctly positioned whatever the scale factor is;
- the font sizes are expressed in percentage too and the main font size
  is scaled thanks a css var (--scale-factor);
- the rotation is now applied on the div annotationLayer;
- this patch improve the rendering of some strings where the glyph spacing
  was not correct (it's a Firefox bug);
- it helps to simplify the code and it should slightly improve the update of
  page (on zoom or rotation).
@calixteman
Copy link
Contributor Author

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

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

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

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

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

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

Total script time: 25.53 mins

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

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

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

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

Total script time: 28.25 mins

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

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

@calixteman calixteman merged commit 54777b4 into mozilla:master Jun 19, 2022
@calixteman
Copy link
Contributor Author

/botio makeref

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.241.84.105:8877/6c8f21f60953ec8/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/51819cac3333fe7/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/51819cac3333fe7/output.txt

Total script time: 21.91 mins

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

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/6c8f21f60953ec8/output.txt

Total script time: 23.49 mins

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

@timvandermeij timvandermeij removed their request for review June 19, 2022 11:18
calixteman added a commit to calixteman/pdf.js that referenced this pull request Jun 19, 2022
calixteman added a commit to calixteman/pdf.js that referenced this pull request Jun 19, 2022
calixteman added a commit to calixteman/pdf.js that referenced this pull request Jun 19, 2022
Snuffleupagus added a commit that referenced this pull request Jun 20, 2022
Avoid having overflowing sections (#15036 follow-up)
rousek pushed a commit to signosoft/pdf.js that referenced this pull request Aug 10, 2022
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.

Get rid of transform in the annotation layer
5 participants