Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: testing/resources/javascript/bug_679643.in

Issue 2628233002: Custom toString() methods may delete annots. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 {{header}}
2 {{object 1 0}} <<
3 /Type /Catalog
4 /Pages 2 0 R
5 /AcroForm 4 0 R
6 /OpenAction 10 0 R
7 >>
8 endobj
9 {{object 2 0}} <<
10 /Type /Pages
11 /Count 1
12 /Kids [
13 3 0 R
14 ]
15 >>
16 endobj
17 % Page number 0.
18 {{object 3 0}} <<
19 /Type /Page
20 /Parent 2 0 R
21 /Resources <<
22 /Font <</F1 15 0 R>>
23 >>
24 /Contents [21 0 R]
25 /MediaBox [0 0 612 792]
26 /Annots [7 0 R 8 0 R 9 0 R]
27 >>
28 endobj
29 % Forms
30 {{object 4 0}} <<
31 /XFA [
32 (xdp:xdp) 23 0 R
33 (form) 29 0 R
34 (</xdp:xdp>) 30 0 R
35 ]
36 /Fields [
37 5 0 R
38 ]
39 >>
40 endobj
41 % Fields
42 {{object 5 0}} <<
43 /T (MyField)
44 /Kids [
45 6 0 R
46 ]
47 /Rect [100 100 400 400]
48 >>
49 endobj
50 {{object 6 0}} <<
51 /Parent 5 0 R
52 /FT /Btn
53 /Kids [
54 7 0 R
55 8 0 R
56 9 0 R
57 ]
58 /Rect [200 200 220 220]
59 >>
60 endobj
61 {{object 7 0}} <<
62 /Parent 6 0 R
63 /Type /Annot
64 /Subtype /Widget
65 /Rect [220 220 240 240]
66 >>
67 endobj
68 {{object 8 0}} <<
69 /Parent 6 0 R
70 /Type /Annot
71 /Subtype /Widget
72 /Rect [240 240 260 260]
73 >>
74 endobj
75 {{object 9 0}} <<
76 /Parent 6 0 R
77 /Type /Annot
78 /Subtype /Widget
79 /Rect [240 240 260 260]
80 >>
81 endobj
82 % OpenAction action
83 {{object 10 0}} <<
84 /Type /Action
85 /S /JavaScript
86 /JS 11 0 R
87 >>
88 endobj
89 % JS program to exexute
90 {{object 11 0}} <<
91 >>
92 stream
93 var theName = "MyField";
94 function Mangles() {
95 app.alert('Starting ...');
96 try {
97 var annots = this.getAnnots();
98 annots[0].name = {
99 toString: () => {
100 app.alert('Firing ...');
101 this.removeField(theName);
102 gc();
103 return false;
104 }
105 };
106 } catch (e) {
107 app.alert("failed: " + e);
108 }
109 }
110 Mangles();
111 endstream
112 endobj
113 {{object 23 0}} <<
114 >>stream
115 <?xml version="1.0" encoding="UTF-8"?>
116 <xdp:xdp xmlns:xdp="http://ns.adobe.com/xdp/">
117 endstream
118 endobj
119 {{object 29 0}} <<
120 >>stream
121 <config></config>
122 <template></template>
123 endstream
124 endobj
125 {{object 30 0}} <<
126 >>stream
127 </xdp:xdp>
128 endstream
129 endobj
130 {{xref}}
131 trailer <<
132 /Root 1 0 R
133 >>
134 {{startxref}}
135 %%EOF
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698