-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
implementing optional content radiobutton groups #18825
Conversation
@Snuffleupagus I updated the PR with your version of |
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.
Thanks for the patch; based on an initial look I've left a number of inline comments.
Please remember to include the information from #18825 (comment) in the commit message as well, such that the patch is easier to understand also on the Git command line.
Thank you, @Snuffleupagus, for your comments. I am going to work through all of them. Is it OK to do the code changes locally and to force-push them afterwards? |
That's a lot of text. I thought a commit message should fit on a single line. But I will do so when appropriate. |
7fb8170
to
c0f14a0
Compare
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 also needs tests, and I'd suggest adding a couple of reference tests for this.
- Add the PDF document that you attached in [Feature]: Optional Content Radio Button Groups #18823 (comment) to the
test/pdfs/
folder, but name itissue18823.pdf
. - Run
node test/add_test.mjs test/pdfs/issue18823.pdf
in the root of your local PDF.js Git-clone. - Open the
test/test_manifest.json
file and find the newly added test-case. Here we also want to add another test-case for a non-default optionalContent-state.
To make this process slightly less daunting I've done these steps in the following diff, which you're obviously welcome to copy and include as-is in your patch: master...Snuffleupagus:pdf.js:issue-18823-test
7e7817a
to
bd46207
Compare
Thanks a lot for this, I merged the test case into the patch. I just don't quite understand what is to be done regarding the other test case for a non-default OC state (third item in your comment). |
That patch already includes all of those steps, however I just wanted to highlight that the script can only create "simple" entries in the
It seems that the PR currently contains unrelated commits, maybe a rebase gone wrong? |
OK, so nothing else needs to be done regarding this.
I hope the commit history is in sync again. Going to work on the other changes now. |
…ozilla#18823. The code parses the /RBGroups entry in the OC configuration dict and adds the property `rbGroups' to instances of the OptionalContentGroup class. rbGroups takes an array of Sets, where each Set instance represents an RB group the OptionalContentGroup instance is a member of. Such a Set instance contains all OCG ids within the corresponding RB group. RB groups an OCG is associated with are processed when its visibility is set to true, as required by the PDF spec.
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/0dddf080415168d/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/0dddf080415168d/output.txt Total script time: 1.02 mins Published |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/e5f2c5253faf64a/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/3332fffe33746b9/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/e5f2c5253faf64a/output.txt Total script time: 31.49 mins
Image differences available at: http://54.241.84.105:8877/e5f2c5253faf64a/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/3332fffe33746b9/output.txt Total script time: 52.87 mins
Image differences available at: http://54.193.163.58:8877/3332fffe33746b9/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.
r=me, thank you.
/botio makeref |
From: Bot.io (Linux m4)ReceivedCommand cmd_makeref from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/813a9fbb6328fdf/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/1a80bcacdd4199c/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/813a9fbb6328fdf/output.txt Total script time: 21.01 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.193.163.58:8877/1a80bcacdd4199c/output.txt Total script time: 30.15 mins
|
This PR implements OC radio button groups. It could resolve #18823.
The suggested code parses the
/RBGroups
entry in the optional content configuration dict and adds the propertymyRbGroups
to instances of theOptionalContentGroup
class.myRbGroups
takes an array ofSet
s , where eachSet
instance represents a radio button group theOptionalContentGroup
instance is a member of. Such aSet
instance contains all OCG ids within the corresponding RB group. The RB groups an OCG is associated with are processed when its visibility is set totrue
, as required by the PDF spec.