Skip to content

Commit cf9dfbc

Browse files
Merge pull request #18394 from Snuffleupagus/rm-annotation-getOperatorList-renderForms
Remove the `renderForms` parameter from the Annotation `getOperatorList` methods
2 parents 9065ee4 + 38528d1 commit cf9dfbc

File tree

3 files changed

+7
-58
lines changed

3 files changed

+7
-58
lines changed

src/core/annotation.js

+7-44
Original file line numberDiff line numberDiff line change
@@ -1105,13 +1105,7 @@ class Annotation {
11051105
});
11061106
}
11071107

1108-
async getOperatorList(
1109-
evaluator,
1110-
task,
1111-
intent,
1112-
renderForms,
1113-
annotationStorage
1114-
) {
1108+
async getOperatorList(evaluator, task, intent, annotationStorage) {
11151109
const { hasOwnCanvas, id, rect } = this.data;
11161110
let appearance = this.appearance;
11171111
const isUsingOwnCanvas = !!(
@@ -1959,17 +1953,11 @@ class WidgetAnnotation extends Annotation {
19591953
return str;
19601954
}
19611955

1962-
async getOperatorList(
1963-
evaluator,
1964-
task,
1965-
intent,
1966-
renderForms,
1967-
annotationStorage
1968-
) {
1956+
async getOperatorList(evaluator, task, intent, annotationStorage) {
19691957
// Do not render form elements on the canvas when interactive forms are
19701958
// enabled. The display layer is responsible for rendering them instead.
19711959
if (
1972-
renderForms &&
1960+
intent & RenderingIntentFlag.ANNOTATIONS_FORMS &&
19731961
!(this instanceof SignatureWidgetAnnotation) &&
19741962
!this.data.noHTML &&
19751963
!this.data.hasOwnCanvas
@@ -1982,13 +1970,7 @@ class WidgetAnnotation extends Annotation {
19821970
}
19831971

19841972
if (!this._hasText) {
1985-
return super.getOperatorList(
1986-
evaluator,
1987-
task,
1988-
intent,
1989-
renderForms,
1990-
annotationStorage
1991-
);
1973+
return super.getOperatorList(evaluator, task, intent, annotationStorage);
19921974
}
19931975

19941976
const content = await this._getAppearance(
@@ -1998,13 +1980,7 @@ class WidgetAnnotation extends Annotation {
19981980
annotationStorage
19991981
);
20001982
if (this.appearance && content === null) {
2001-
return super.getOperatorList(
2002-
evaluator,
2003-
task,
2004-
intent,
2005-
renderForms,
2006-
annotationStorage
2007-
);
1983+
return super.getOperatorList(evaluator, task, intent, annotationStorage);
20081984
}
20091985

20101986
const opList = new OperatorList();
@@ -2934,13 +2910,7 @@ class ButtonWidgetAnnotation extends WidgetAnnotation {
29342910
}
29352911
}
29362912

2937-
async getOperatorList(
2938-
evaluator,
2939-
task,
2940-
intent,
2941-
renderForms,
2942-
annotationStorage
2943-
) {
2913+
async getOperatorList(evaluator, task, intent, annotationStorage) {
29442914
if (this.data.pushButton) {
29452915
return super.getOperatorList(
29462916
evaluator,
@@ -2962,13 +2932,7 @@ class ButtonWidgetAnnotation extends WidgetAnnotation {
29622932
if (value === null && this.appearance) {
29632933
// Nothing in the annotationStorage.
29642934
// But we've a default appearance so use it.
2965-
return super.getOperatorList(
2966-
evaluator,
2967-
task,
2968-
intent,
2969-
renderForms,
2970-
annotationStorage
2971-
);
2935+
return super.getOperatorList(evaluator, task, intent, annotationStorage);
29722936
}
29732937

29742938
if (value === null || value === undefined) {
@@ -3001,7 +2965,6 @@ class ButtonWidgetAnnotation extends WidgetAnnotation {
30012965
evaluator,
30022966
task,
30032967
intent,
3004-
renderForms,
30052968
annotationStorage
30062969
);
30072970
this.appearance = savedAppearance;

src/core/document.js

-1
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,6 @@ class Page {
592592
partialEvaluator,
593593
task,
594594
intent,
595-
renderForms,
596595
annotationStorage
597596
)
598597
.catch(function (reason) {

test/unit/annotation_spec.js

-13
Original file line numberDiff line numberDiff line change
@@ -1768,7 +1768,6 @@ describe("annotation", function () {
17681768
partialEvaluator,
17691769
task,
17701770
RenderingIntentFlag.PRINT,
1771-
false,
17721771
annotationStorage
17731772
);
17741773
expect(opList.argsArray.length).toEqual(3);
@@ -2523,7 +2522,6 @@ describe("annotation", function () {
25232522
checkboxEvaluator,
25242523
task,
25252524
RenderingIntentFlag.PRINT,
2526-
false,
25272525
annotationStorage
25282526
);
25292527
expect(opList.argsArray.length).toEqual(5);
@@ -2584,7 +2582,6 @@ describe("annotation", function () {
25842582
partialEvaluator,
25852583
task,
25862584
RenderingIntentFlag.PRINT,
2587-
false,
25882585
annotationStorage
25892586
);
25902587
expect(opList1.argsArray.length).toEqual(3);
@@ -2608,7 +2605,6 @@ describe("annotation", function () {
26082605
partialEvaluator,
26092606
task,
26102607
RenderingIntentFlag.PRINT,
2611-
false,
26122608
annotationStorage
26132609
);
26142610
expect(opList2.argsArray.length).toEqual(3);
@@ -2670,7 +2666,6 @@ describe("annotation", function () {
26702666
partialEvaluator,
26712667
task,
26722668
RenderingIntentFlag.PRINT,
2673-
false,
26742669
annotationStorage
26752670
);
26762671
expect(opList.argsArray.length).toEqual(3);
@@ -2732,7 +2727,6 @@ describe("annotation", function () {
27322727
partialEvaluator,
27332728
task,
27342729
RenderingIntentFlag.PRINT,
2735-
false,
27362730
annotationStorage
27372731
);
27382732
expect(opList.argsArray.length).toEqual(3);
@@ -2986,7 +2980,6 @@ describe("annotation", function () {
29862980
partialEvaluator,
29872981
task,
29882982
RenderingIntentFlag.PRINT,
2989-
false,
29902983
annotationStorage
29912984
);
29922985
expect(opList1.argsArray.length).toEqual(3);
@@ -3010,7 +3003,6 @@ describe("annotation", function () {
30103003
partialEvaluator,
30113004
task,
30123005
RenderingIntentFlag.PRINT,
3013-
false,
30143006
annotationStorage
30153007
);
30163008
expect(opList2.argsArray.length).toEqual(3);
@@ -3070,7 +3062,6 @@ describe("annotation", function () {
30703062
partialEvaluator,
30713063
task,
30723064
RenderingIntentFlag.PRINT,
3073-
false,
30743065
annotationStorage
30753066
);
30763067
expect(opList.argsArray.length).toEqual(3);
@@ -4242,7 +4233,6 @@ describe("annotation", function () {
42424233
partialEvaluator,
42434234
task,
42444235
RenderingIntentFlag.PRINT,
4245-
false,
42464236
null
42474237
);
42484238

@@ -4503,7 +4493,6 @@ describe("annotation", function () {
45034493
partialEvaluator,
45044494
task,
45054495
RenderingIntentFlag.PRINT,
4506-
false,
45074496
null
45084497
);
45094498

@@ -4672,7 +4661,6 @@ describe("annotation", function () {
46724661
partialEvaluator,
46734662
task,
46744663
RenderingIntentFlag.PRINT,
4675-
false,
46764664
null
46774665
);
46784666

@@ -4791,7 +4779,6 @@ describe("annotation", function () {
47914779
partialEvaluator,
47924780
task,
47934781
RenderingIntentFlag.PRINT,
4794-
false,
47954782
null
47964783
);
47974784

0 commit comments

Comments
 (0)