-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Fix XFA links (bug 1735738) #14153
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
Fix XFA links (bug 1735738) #14153
Conversation
Can you please provide a bit more detail in the commit message as well (since it's currently a single sentence), and not just in the PR description? |
Yes, it's no problem. Sorry for that, I'll make sure to be more specific in my commits from now on |
The commit message is still just a single sentence, and doesn't really contain all that much more information. Please imagine that you're looking at this commit locally, without using GitHub, in e.g. one month's time. Will it still help you understand what you changed and (importantly) why the implementation looks the way it does? In #14153 (comment) you've got the following paragraph, which definitely seems like a good thing to also add to the commit message:
|
web/xfa_layer_builder.css
Outdated
@@ -221,6 +221,8 @@ | |||
} | |||
|
|||
.xfaLink { | |||
display: inline-block; |
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 think display: inline-block
is useless here.
Could you elaborate on why you added it ?
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.
Yes, as I mentioned I added it because the inline display can't receive any height. When changing the display the link start working and the absolute position it's for the text in the links to show properly.
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.
Ok, I see it's still working with just the absolute position. Do you want me to remove the display?
I think we should add a reftest for that to avoid future regressions. @catherinemds, would you mind to do that ? |
Sure, no problem. |
"file": "pdfs/xfa_bug1735738.pdf", | ||
"md5": "7aa91f6681798c48e0c9d9836ed30742", | ||
"rounds": 1, | ||
"type": "eq" |
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.
You should add "enableXfa": true
else the pdf won't rendered correctly.
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.
Also, are we allowed to include the file or should it be a link
test-case instead?
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.
Oh yes, correct.
@catherinemds, please add a file named xfa_bug1735738.pdf.link
which contains only the url to the pdf which is in the bugzilla bug and remove from this PR `xfa_bug1735738.pdf`` you added.
@catherinemds, you added a test: nice. |
Hey @calixteman I submitted the changes even though I could still see the yellow box from the override file after commenting my modifications, I'm struggling to understand what when wrong here, also I wonder if the changes made to the driver.js file are okay |
Could you try to see if there is any difference in removing the display:block in th overriden css ? |
Yes, I tried that. The yellow box is almost gone but you can still see a bit of it in a little corner of the button |
It's likely due to the box-shadow. |
1fdf6b0
to
0ce9a0e
Compare
@calixteman I noticed something here, the litle corner where the yellow box it's still showing it's not the same xfalink that contains that "www.assuredynamics.com" link. Sorry for pushing so many times, I made a mistake and the .gitignore file updated and somehow I pushed it and had to fix it |
test/pdfs/xfa_bug1735738.pdf.link
Outdated
@@ -0,0 +1 @@ | |||
https://bugzilla.mozilla.org/attachment.cgi?id=9227382 |
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.
Missing a line-break at the end here.
Your code-editor should be able to help you enforce this, thanks to this file; please see https://editorconfig.org/#pre-installed or https://editorconfig.org/#download
@@ -0,0 +1,5 @@ | |||
.xfaLink { |
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.
This file is missing a license header, please copy the one found e.g. in https://github.com/mozilla/pdf.js/blob/master/test/annotation_layer_builder_overrides.css (obviously with the year adjusted).
test/driver.js
Outdated
.then(async ([cssRules]) => { | ||
style.textContent = fontRules + "\n" + cssRules; | ||
.then(async ([common, overrides]) => { | ||
style.textContent = common + "\n" + overrides; |
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.
Why did you remove fontRules
?
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.
Yeah sorry, I was following the example of rasterizeAnnotationLayer and I removed to make it work at first but I fixed it now, I ran gulp makeref again to make sure it still working and everything seems fine
test/driver.js
Outdated
.then(async ([cssRules, common, overrides]) => { | ||
style.textContent = | ||
fontRules + "\n" + cssRules + "\n" + common + "\n" + overrides; |
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.
Have you successfully tested this, since I don't believe that the style promise will return an Array with three elements?
Based on the styles
definition above, I'd expect that the correct thing here would be:
.then(async ([common, overrides]) => {
style.textContent = fontRules + "\n" + common + "\n" + overrides;
/botio xfatest |
From: Bot.io (Windows)ReceivedCommand cmd_xfatest from @calixteman received. Current queue size: 0 Live output at: http://54.193.163.58:8877/3ccf85e57f0f0ce/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_xfatest from @calixteman received. Current queue size: 0 Live output at: http://54.241.84.105:8877/e2008b4f3f92e3e/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/e2008b4f3f92e3e/output.txt Total script time: 9.21 mins
Image differences available at: http://54.241.84.105:8877/e2008b4f3f92e3e/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/3ccf85e57f0f0ce/output.txt Total script time: 15.87 mins
Image differences available at: http://54.193.163.58:8877/3ccf85e57f0f0ce/reftest-analyzer.html#web=eq.log |
The reftests are showing links at incorrect positions. |
There were some links not working in some XFA files,I realized that the anchor tag that contains the link has an inline display and couldn't receive any height, solved this by adding a "position: absolute". Tested with two different files in Firefox Nightly and Chrome and now all links are working perfectly fine. Added reftest to avoid future regressions
/botio 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/93de029e54a7f12/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @calixteman received. Current queue size: 0 Live output at: http://54.193.163.58:8877/114d54c44ff3527/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/93de029e54a7f12/output.txt Total script time: 22.84 mins
Image differences available at: http://54.241.84.105:8877/93de029e54a7f12/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/114d54c44ff3527/output.txt Total script time: 43.28 mins
Image differences available at: http://54.193.163.58:8877/114d54c44ff3527/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.
LGTM, thank you for doing this.
From: Bot.io (Linux m4)ReceivedCommand cmd_makeref from @calixteman received. Current queue size: 0 Live output at: http://54.241.84.105:8877/c365f25e21a2085/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @calixteman received. Current queue size: 1 Live output at: http://54.193.163.58:8877/6f396e8be2c881d/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/c365f25e21a2085/output.txt Total script time: 20.61 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.193.163.58:8877/6f396e8be2c881d/output.txt Total script time: 39.03 mins
|
At the end the anchor tag inside the button wasn't the problem here, after comparing the reference file and this one
I realized that in the reference file the anchor tag has an inline display and couldn't receive any height. After changing the display to inline-block it started working but since it receives a 100% height the text wasn't showing properly so I added an absolute position and now the reference file it's working in both Firefox nightly and Chrome.
It also solves a bug in this file
Where the second link in schedule II wasn't working at all, now all links in both files are working just fine.
Thank you @calixteman for explaining me with so much patience!
closes #14139