xref: /aosp_15_r20/external/pdfium/testing/resources/javascript/mouse_events.in (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
1{{header}}
2{{object 1 0}} <<
3  /Type /Catalog
4  /Pages 2 0 R
5  /AcroForm 4 0 R
6>>
7endobj
8{{object 2 0}} <<
9  /Type /Pages
10  /Count 1
11  /Kids [
12    3 0 R
13  ]
14>>
15endobj
16% Page number 0.
17{{object 3 0}} <<
18  /Type /Page
19  /Parent 2 0 R
20  /Resources <<
21    /Font <</F1 20 0 R>>
22  >>
23  /Annots [ 5 0 R ]
24  /Contents [21 0 R]
25  /MediaBox [0 0 612 792]
26>>
27endobj
28% Forms
29{{object 4 0}} <<
30  /Fields [
31    5 0 R
32    6 0 R
33    7 0 R
34  ]
35>>
36endobj
37% Field with actions:
38% Cursor enter: E
39% Cursor exit: X
40% Mouse down: D
41% Mouse up: U
42% Focus: Fo
43% Blur: Bl
44{{object 5 0}} <<
45 /Type /Annot
46 /Subtype /Widget
47 /FT /Tx
48 /T (MyField)
49 /Rect [100 200 150 250]
50 /AA <<
51   /E 10 0 R
52   /X 11 0 R
53   /D 12 0 R
54   /U 13 0 R
55   /Fo 14 0 R
56   /Bl 15 0 R
57 >>
58>>
59endobj
60{{object 6 0}} <<
61 /Type /Annot
62 /Subtype /Widget
63 /FT /Tx
64 /T (name)
65 /Rect [400 400 500 429]
66 /V (Tralfaz)
67>>
68endobj
69{{object 7 0}} <<
70 /Type /Annot
71 /Subtype /Widget
72 /FT /Tx
73 /T (age)
74 /Rect [400 440 500 469]
75 /V (12)
76>>
77endobj
78{{object 10 0}} <<
79  /Type /Action
80  /S /JavaScript
81  /JS (
82    app.alert\("enter"\);
83    try {
84       this.submitForm\("myform", true, true, ["name", "age"]\);
85       app.alert\("ERROR: this.submitForm\(\) must not be allowed to execute"\);
86    } catch \(e\) {
87       app.alert\("PASS: this.submitForm blocked with " + e\);
88    }
89    try {
90       this.print\(\);
91       app.alert\("ERROR: this.print\(\) must not be allowed to execute"\);
92    } catch \(e\) {
93       app.alert\("PASS: this.print blocked with " + e\);
94    }
95  )
96>>
97endobj
98{{object 11 0}} <<
99  /Type /Action
100  /S /JavaScript
101  /JS (
102    app.alert\("exit"\);
103    try {
104       this.submitForm\("myform", true, true, ["name", "age"]\);
105       app.alert\("ERROR: this.submitForm\(\) must not be allowed to execute"\);
106    } catch \(e\) {
107       app.alert\("PASS: this.submitForm blocked with " + e\);
108    }
109    try {
110       this.print\(\);
111       app.alert\("ERROR: this.print\(\) must not be allowed to execute"\);
112    } catch \(e\) {
113       app.alert\("PASS: this.print blocked with " + e\);
114    }
115  )
116>>
117endobj
118{{object 12 0}} <<
119  /Type /Action
120  /S /JavaScript
121  /JS (
122    app.alert\("down"\);
123    try {
124       this.submitForm\("https://example.com", true, true, ["name", "age"]\);
125    } catch \(e\) {
126       app.alert\("ERROR: " + e\);
127    }
128    try {
129       this.print\(\);
130       this.print\(false, 1, 10, true, true, true, true, true\);
131       this.print\({}\);
132       this.print\({"bUi": false, "nStart": 42, "nEnd": 17,
133            "bSilent": true, "bShrinkToFit": true, "bPrintAsImage": true,
134            "bReverse": true, "bAnnotations": true, "bogus": "yes"}\);
135    } catch \(e\) {
136       app.alert\("ERROR: " + e\);
137    }
138  )
139>>
140endobj
141{{object 13 0}} <<
142  /Type /Action
143  /S /JavaScript
144  /JS (
145    app.alert\("up"\);
146    try {
147       // Use different bUrl value this time around.
148       this.submitForm\("https://example.com", false, true, ["name", "age"]\);
149    } catch \(e\) {
150       app.alert\("ERROR: " + e\);
151    }
152    try {
153       this.print\(\);
154    } catch \(e\) {
155       app.alert\("ERROR: " + e\);
156    }
157  )
158>>
159endobj
160{{object 14 0}} <<
161  /Type /Action
162  /S /JavaScript
163  /JS (
164    app.alert\("focus"\);
165    try {
166       this.submitForm\("myform", true, true, ["name", "age"]\);
167       app.alert\("ERROR: this.submitForm\(\) must not be allowed to execute"\);
168    } catch \(e\) {
169       app.alert\("PASS: this.submitForm blocked with " + e\);
170    }
171    try {
172       this.print\(\);
173       app.alert\("ERROR: this.print\(\) must not be allowed to execute"\);
174    } catch \(e\) {
175       app.alert\("PASS: this.print blocked with " + e\);
176    }
177  )
178>>
179endobj
180{{object 15 0}} <<
181  /Type /Action
182  /S /JavaScript
183  /JS (
184    app.alert\("blur"\);
185    try {
186       this.submitForm\("myform", true, true, ["name", "age"]\);
187       app.alert\("ERROR: this.submitForm\(\) must not be allowed to execute"\);
188    } catch \(e\) {
189       app.alert\("PASS: this.submitForm blocked with " + e\);
190    }
191    try {
192       this.print\(\);
193       app.alert\("ERROR: this.print\(\) must not be allowed to execute"\);
194    } catch \(e\) {
195       app.alert\("PASS: this.print blocked with " + e\);
196    }
197  )
198>>
199endobj
200{{xref}}
201{{trailer}}
202{{startxref}}
203%%EOF
204