-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Conversation
calixteman
commented
Sep 18, 2021
- it aims to fix PDF rendering problem: Checkboxes have black background #13003;
- set the bg and fg colors as they're in the pdf;
- put a transparent overlay to help to see the fields.
e67971e
to
bc24dcf
Compare
bc24dcf
to
a201fce
Compare
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @calixteman received. Current queue size: 1 Live output at: http://54.241.84.105:8877/8d23aedb8d165e2/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @calixteman received. Current queue size: 1 Live output at: http://54.193.163.58:8877/c0c952716cc48f4/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/8d23aedb8d165e2/output.txt Total script time: 20.25 mins
Image differences available at: http://54.241.84.105:8877/8d23aedb8d165e2/reftest-analyzer.html#web=eq.log |
/botio-linux test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @calixteman received. Current queue size: 0 Live output at: http://54.241.84.105:8877/344baaf712bab05/output.txt |
@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)? |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/344baaf712bab05/output.txt Total script time: 22.03 mins
Image differences available at: http://54.241.84.105:8877/344baaf712bab05/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/c0c952716cc48f4/output.txt Total script time: 40.07 mins
Image differences available at: http://54.193.163.58:8877/c0c952716cc48f4/reftest-analyzer.html#web=eq.log |
There was a problem hiding this 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".
a201fce
to
d8b5115
Compare
d8b5115
to
82ac5a0
Compare
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @calixteman received. Current queue size: 1 Live output at: http://54.241.84.105:8877/f90d1e8d094d754/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @calixteman received. Current queue size: 1 Live output at: http://54.193.163.58:8877/3d92a6b327e5941/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/f90d1e8d094d754/output.txt Total script time: 22.03 mins
Image differences available at: http://54.241.84.105:8877/f90d1e8d094d754/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/3d92a6b327e5941/output.txt Total script time: 39.82 mins
Image differences available at: http://54.193.163.58:8877/3d92a6b327e5941/reftest-analyzer.html#web=eq.log |
@Snuffleupagus Thank you for the ping; I'll have a look at this PR today so we can hopefully get it merged soon. |
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://54.241.84.105:8877/60d0559f5dcb868/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/60d0559f5dcb868/output.txt Total script time: 4.51 mins Published |
There was a problem hiding this 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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
pdf.js/web/annotation_layer_builder.css
Lines 144 to 152 in 93ed4bf
.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%; | |
} |
- 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.
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://54.241.84.105:8877/2b5da8bcc1c35a9/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/2b5da8bcc1c35a9/output.txt Total script time: 4.34 mins Published |
Thank you for improving this! /botio makeref |
From: Bot.io (Linux m4)ReceivedCommand cmd_makeref from @timvandermeij received. Current queue size: 0 Live output at: http://54.241.84.105:8877/c2c6a29fe214288/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @timvandermeij received. Current queue size: 1 Live output at: http://54.193.163.58:8877/d242bcc69d010e3/output.txt |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/d242bcc69d010e3/output.txt Total script time: 1.06 mins
|
Euh... what? Let's try that again. /botio-windows makeref |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @timvandermeij received. Current queue size: 0 Live output at: http://54.193.163.58:8877/01d9ffc1e72b281/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/c2c6a29fe214288/output.txt Total script time: 18.52 mins
|
Windows works, now Linux... /botio-linux makeref |
From: Bot.io (Linux m4)ReceivedCommand cmd_makeref from @timvandermeij received. Current queue size: 0 Live output at: http://54.241.84.105:8877/efb659728cfb593/output.txt |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/01d9ffc1e72b281/output.txt Total script time: 31.09 mins
|
/botio-windows makeref |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/efb659728cfb593/output.txt Total script time: 20.37 mins
|
From: Bot.io (Windows)ReceivedCommand 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", |
There was a problem hiding this comment.
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?
Add the missing pdf file for the test in the PR #14049
From: Bot.io (Windows)SuccessFull output at http://54.193.163.58:8877/21c0a2c6b97b557/output.txt Total script time: 38.32 mins
|
data.color[0] | 0, | ||
data.color[1] | 0, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
…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.
…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.
…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.
…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.