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

Annotation - Use border and background colors from MK dictionary #14049

Merged
merged 1 commit into from
Sep 29, 2021

Conversation

calixteman
Copy link
Contributor

src/core/annotation.js Outdated Show resolved Hide resolved
web/annotation_layer_builder.css Outdated Show resolved Hide resolved
@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: 1

Live output at: http://54.241.84.105:8877/8d23aedb8d165e2/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

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

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/8d23aedb8d165e2/output.txt

Total script time: 20.25 mins

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

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

@calixteman
Copy link
Contributor Author

/botio-linux 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/344baaf712bab05/output.txt

@Snuffleupagus
Copy link
Collaborator

@timvandermeij Since you reviewed the previous PR, i.e. #13006, mind taking a look at this one when you've got time (so I'm not overlooking anything, given the previous discussion in that PR)?

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/344baaf712bab05/output.txt

Total script time: 22.03 mins

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

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

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

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

Total script time: 40.07 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: FAILED
  • Regression tests: FAILED
  errors: 4
  different ref/snapshot: 24
  different first/second rendering: 1

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

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.

Looking at the latest round of test results, there's also a couple of breaking errors during the reference tests; one example being:
TEST-UNEXPECTED-FAIL | test failed issue13823 | in firefox | page1 round 1 | render : Error: rasterizeAnnotationLayer: "can't access property 0, color is undefined".

@calixteman
Copy link
Contributor Author

@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: 1

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

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/3d92a6b327e5941/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

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

Total script time: 22.03 mins

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

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

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/3d92a6b327e5941/output.txt

Total script time: 39.82 mins

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

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

@timvandermeij
Copy link
Contributor

@Snuffleupagus Thank you for the ping; I'll have a look at this PR today so we can hopefully get it merged soon.

@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.241.84.105:8877/60d0559f5dcb868/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/60d0559f5dcb868/output.txt

Total script time: 4.51 mins

Published

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.

Looks good to me with these two comments addressed.

*/
setBorderAndBackgroundColors(mk) {
if (mk instanceof Dict) {
this.borderColor = getRgbColor(mk.getArray("BC"), null);
Copy link
Contributor

Choose a reason for hiding this comment

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

The borders seem thicker now in the reference tests; it looks like the borders are applied twice now, once here and once in existing CSS perhaps?

Moreover, when opening annotation-text-widget.pdf from the test suite and clicking the combs field, the border is now extended behind the field (due to the way padding works for the combs fields). Would it maybe be a solution to make the border, just like the background, transparent on focus?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The container and the element had a border and so I just removed the one from the element.
About the focus issue on the comb field, I just removed

.annotationLayer .textWidgetAnnotation input.comb:focus {
/*
* Letter spacing is placed on the right side of each character. Hence, the
* letter spacing of the last character may be placed outside the visible
* area, causing horizontal scrolling. We avoid this by extending the width
* when the element has focus and revert this when it loses focus.
*/
width: 103%;
}
which seems to be useless now (something has likely been fixed in Firefox) and without any consequence with the pdf in #12865.

src/core/annotation.js Outdated Show resolved Hide resolved
  - it aims to fix mozilla#13003;
  - set the bg and fg colors as they're in the pdf;
  - put a transparent overlay to help to see the fields.
@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

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

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

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

Total script time: 4.34 mins

Published

@timvandermeij timvandermeij merged commit 9a74f3e into mozilla:master Sep 29, 2021
@timvandermeij
Copy link
Contributor

Thank you for improving this!

/botio makeref

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

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

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_makeref from @timvandermeij received. Current queue size: 1

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

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

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

Total script time: 1.06 mins

  • Lint: FAILED
  • Make references: FAILED

@timvandermeij
Copy link
Contributor

Euh... what? Let's try that again.

/botio-windows makeref

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

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

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

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

Total script time: 18.52 mins

  • Lint: Passed
  • Make references: FAILED

@timvandermeij
Copy link
Contributor

Windows works, now Linux...

/botio-linux makeref

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

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

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

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

Total script time: 31.09 mins

  • Lint: Passed
  • Make references: FAILED

@timvandermeij
Copy link
Contributor

/botio-windows makeref

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

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

Total script time: 20.37 mins

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

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/21c0a2c6b97b557/output.txt

@@ -5975,5 +5975,12 @@
"value": true
}
}
},
{ "id": "issue13003",
"file": "pdfs/issue13003.pdf",
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure why makeref doesn't fail on the bots, since this file isn't included in anywhere in the diff (neither directly or as a linked test-case). Locally this causes makeref to fail completely for me.

@calixteman Can you please do a follow-up PR adding the missing file?

calixteman added a commit to calixteman/pdf.js that referenced this pull request Sep 29, 2021
calixteman added a commit that referenced this pull request Sep 29, 2021
Add the missing pdf file for the test in the PR #14049
@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/21c0a2c6b97b557/output.txt

Total script time: 38.32 mins

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

Comment on lines 250 to 251
data.color[0] | 0,
data.color[1] | 0,
Copy link
Collaborator

@Snuffleupagus Snuffleupagus Sep 30, 2021

Choose a reason for hiding this comment

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

Is this makeHexColor-call supposed to use data.color now, since naively I'd assume that it should actually use borderColor (defined just above) instead?
As-is the borderColor is being ignored, which I'm assuming wasn't intended; was this perhaps fallout from addressing one of the review comments?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

borderColor is set from MK-BC entry and color is set from C one.
If I understand the spec correctly, BC (see https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf#page=417) is optional and for widget annotations, when C (see https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf#page=392) is for icon, popup and link, so only one of the BC and C should be set.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I'm correct, I should likely add a comment.

Snuffleupagus added a commit to Snuffleupagus/pdf.js that referenced this pull request Oct 5, 2021
…ered (PR 14049 follow-up)

Note that PR 14049 removed this, since mozilla#14049 (comment) claimed that it's not necessary anymore. Unfortunately that, in my testing on Windows, actually re-introduced exactly the issue described in the comment; more specifically once the *last* character has been entered in the comb-field it's now again incorrectly scrolled (with the first character being invisible) until focus is lost.

This can be tested with e.g. `f1040.pdf` from the test-suite.
Snuffleupagus added a commit to Snuffleupagus/pdf.js that referenced this pull request Oct 5, 2021
…ered (PR 14049 follow-up)

Note that PR 14049 removed this, since mozilla#14049 (comment) claimed that it's not necessary anymore. Unfortunately that, in my testing on Windows, actually re-introduced exactly the issue described in the comment; more specifically once the *last* character has been entered in the comb-field it's now again incorrectly scrolled (with the first character being invisible) until focus is lost.

This can be tested with e.g. `f1040.pdf`, see page 2, from the test-suite.
bh213 pushed a commit to bh213/pdf.js that referenced this pull request Jun 3, 2022
bh213 pushed a commit to bh213/pdf.js that referenced this pull request Jun 3, 2022
…ered (PR 14049 follow-up)

Note that PR 14049 removed this, since mozilla#14049 (comment) claimed that it's not necessary anymore. Unfortunately that, in my testing on Windows, actually re-introduced exactly the issue described in the comment; more specifically once the *last* character has been entered in the comb-field it's now again incorrectly scrolled (with the first character being invisible) until focus is lost.

This can be tested with e.g. `f1040.pdf`, see page 2, from the test-suite.
rousek pushed a commit to signosoft/pdf.js that referenced this pull request Aug 10, 2022
rousek pushed a commit to signosoft/pdf.js that referenced this pull request Aug 10, 2022
…ered (PR 14049 follow-up)

Note that PR 14049 removed this, since mozilla#14049 (comment) claimed that it's not necessary anymore. Unfortunately that, in my testing on Windows, actually re-introduced exactly the issue described in the comment; more specifically once the *last* character has been entered in the comb-field it's now again incorrectly scrolled (with the first character being invisible) until focus is lost.

This can be tested with e.g. `f1040.pdf`, see page 2, from the test-suite.
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.

PDF rendering problem: Checkboxes have black background
4 participants