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

Add support for radios printing #12108

Merged
merged 2 commits into from
Aug 2, 2020
Merged

Conversation

calixteman
Copy link
Contributor

No description provided.

@calixteman calixteman force-pushed the radio branch 2 times, most recently from 8f19bef to 8e25e04 Compare July 24, 2020 09:55
@lundjordan lundjordan added the Gecko 81 Tracking work planned for Form Fill in Shirley 81 release label Jul 27, 2020
@timvandermeij
Copy link
Contributor

timvandermeij commented Jul 27, 2020

When the checkbox PR is merged, I think this only requires a rebase and a unit test similar to the checkbox one but for radio buttons. We should also move the existing checkbox printing unit test a bit up to group the checkbox tests apart from the radio button tests.

src/core/annotation.js Outdated Show resolved Hide resolved
src/display/annotation_layer.js Outdated Show resolved Hide resolved
@calixteman
Copy link
Contributor Author

I added a test so this PR is ready to be reviewed.

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 with the final comments addressed!

@@ -1088,6 +1088,8 @@ class ButtonWidgetAnnotation extends WidgetAnnotation {
break;
}
}
this.checkedAppearance = normalAppearanceState.get(this.data.buttonValue);
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add a newline above this line like we did for the checkboxes to separate the appearance from the button value.

@@ -1088,6 +1088,8 @@ class ButtonWidgetAnnotation extends WidgetAnnotation {
break;
}
}
this.checkedAppearance = normalAppearanceState.get(this.data.buttonValue);
this.uncheckedAppearance = normalAppearanceState.get("Off") || null;
Copy link
Contributor

Choose a reason for hiding this comment

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

Hm, this was already there, but it might be better to rename normalAppearanceState to normalAppearance here too like we did for the checkboxes to match the specification more closely.

@@ -1741,6 +1741,93 @@ describe("annotation", function () {
done();
}, done.fail);
});

it("should render radios for printing", function (done) {
Copy link
Contributor

Choose a reason for hiding this comment

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

radios -> radio buttons for consistency with the other tests.

);
return annotation;
}, done.fail)
.then(annotation => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Testing the unchecked flow is a pretty good addition that we didn't think of when the checkboxes were made. Could we perhaps add a second commit to the PR that does two things:

  1. Move the checkbox unit test from line 1659 to to line 1624 so it's grouped with the other checkbox tests (now it's a checkbox test in between radio buttons tests which makes it a bit hard to find).
  2. Introduce the same flow for testing the unchecked case there too.

Doing so would be a nice way to improve checkbox test coverage and for consistency.

@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.67.70.0:8877/72a18cd80f38fa0/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/72a18cd80f38fa0/output.txt

Total script time: 3.48 mins

Published

@timvandermeij
Copy link
Contributor

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/9b6cfd509218d91/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://54.215.176.217:8877/b4c46fb92241266/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/9b6cfd509218d91/output.txt

Total script time: 26.79 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: FAILED

Image differences available at: http://54.67.70.0:8877/9b6cfd509218d91/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://54.215.176.217:8877/b4c46fb92241266/output.txt

Total script time: 29.96 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: FAILED

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

@timvandermeij timvandermeij merged commit 5a66c56 into mozilla:master Aug 2, 2020
@timvandermeij
Copy link
Contributor

Another piece of the puzzle done. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
annotations form-acroform Gecko 81 Tracking work planned for Form Fill in Shirley 81 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants