/
resources.feature
653 lines (509 loc) · 26.5 KB
/
resources.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
Feature: EPUB 3 — Publication Resources
Checks conformance to the "Publication resources" section of the EPUB 3.3 specification:
https://www.w3.org/TR/epub-33/#sec-publication-resources
Background:
Given EPUB test files located at '/epub3/03-resources/files/'
And EPUBCheck with default settings
## 3.2 Core Media Types
#### Audio core media types
Scenario: items with Core Media Types do not require fallbacks
The test document contains one item of each supported core media types
When checking file 'resources-core-media-types-valid.opf'
Then no errors or warnings are reported
Scenario: items with Core Media Types that are not preferred types are reported as usage
The test document contains one item of each non-preferred core media types
When the reporting level is set to USAGE
And checking EPUB 'resources-core-media-types-not-preferred-valid.opf'
Then Usage OPF-090 is reported 6 times
And no errors or warnings are reported
Scenario: Verify MP3 audio is allowed
When checking EPUB 'resources-cmt-audio-mp3-valid'
Then no errors or warnings are reported
Scenario: Verify AAC/MP4 audio is allowed
When checking EPUB 'resources-cmt-audio-mp4-valid'
Then no errors or warnings are reported
Scenario: Verify OPUS audio is allowed
When checking EPUB 'resources-cmt-audio-opus-valid'
Then no errors or warnings are reported
#### Image core media types
Scenario: Verify GIF images are allowed
When checking EPUB 'resources-cmt-image-gif-valid'
Then no errors or warnings are reported
Scenario: Verify JPEG images are allowed
When checking EPUB 'resources-cmt-image-jpg-valid'
Then no errors or warnings are reported
Scenario: Verify PNG images are allowed
When checking EPUB 'resources-cmt-image-png-valid'
Then no errors or warnings are reported
Scenario: Verify WebP images are allowed
When checking EPUB 'resources-cmt-image-webp-valid'
Then no errors or warnings are reported
Scenario: Verify that JPEG file is not corrupt (issue 567)
When checking EPUB 'resources-cmt-image-jpg-not-corrupt-valid'
Then no errors or warnings are reported
Scenario: Report a corrupt image
When checking EPUB 'resources-cmt-image-corrupt-error'
Then error MED-004 is reported
And error PKG-021 is reported
And no other errors or warnings are reported
Scenario: Report a JPEG image declared as 'image/gif'
When checking EPUB 'resources-cmt-image-jpeg-declared-as-gif-error'
Then error OPF-029 is reported
And no other errors or warnings are reported
Scenario: Report a JPEG image with a '.gif' extension
When checking EPUB 'resources-cmt-image-wrong-extension-warning'
Then warning PKG-022 is reported
And no errors or warnings are reported
#### Font core media types
Scenario: Verify Open Type fonts are allowed
When checking EPUB 'resources-cmt-font-opentype-valid'
Then no errors or warnings are reported
Scenario: Verify SVG fonts are allowed
When checking EPUB 'resources-cmt-font-svg-valid'
Then no errors or warnings are reported
## 3.3 Foreign resources
@spec @xref:sec-foreign-resources
Scenario: Allow a foreign resource in HTML `audio` with a manifest fallback
When checking EPUB 'foreign-xhtml-audio-manifest-fallback-valid'
And no other errors or warnings are reported
@spec @xref:sec-foreign-resources
Scenario: Report a foreign resource in HTML `audio` with no fallbacks
When checking EPUB 'foreign-xhtml-audio-no-fallback-error'
Then error RSC-032 is reported
And no other errors or warnings are reported
@spec @xref:sec-foreign-resources
Scenario: Report a foreign resource in HTML `audio` `source` with no fallback
When checking EPUB 'foreign-xhtml-audio-source-no-fallback-error'
Then error RSC-032 is reported
And no errors or warnings are reported
@spec @xref:sec-foreign-resources
Scenario: Allow a foreign resource in HTML `embed` with a manifest fallback
When checking EPUB 'foreign-xhtml-embed-fallback-valid'
Then no errors or warnings are reported
@spec @xref:sec-foreign-resources
Scenario: Report a foreign resource in HTML `embed` with no fallback
When checking EPUB 'foreign-xhtml-embed-no-fallback-error'
Then error RSC-032 is reported
And no other errors or warnings are reported
@spec @xref:sec-foreign-resources
Scenario: Report a foreign resource in HTML video `input` with no fallack
When checking EPUB 'foreign-xhtml-input-image-no-fallback-error'
Then error RSC-032 is reported
And no other errors or warnings are reported
@spec @xref:sec-foreign-resources
Scenario: Allow a foreign resource in HTML video `poster` with a manifest fallback
When checking EPUB 'foreign-xhtml-video-poster-fallback-valid'
And no errors or warnings are reported
@spec @xref:sec-foreign-resources
Scenario: Report a foreign resource in HTML video `poster` with no fallack
When checking EPUB 'foreign-xhtml-video-poster-no-fallback-error'
Then error RSC-032 is reported
And no other errors or warnings are reported
@spec @xref:sec-foreign-resources
Scenario: Report a foreign resource in MathML `altimg` attribute with no fallack
When checking EPUB 'foreign-xhtml-math-altimg-no-fallback-error'
Then error RSC-032 is reported
And no other errors or warnings are reported
## 3.4 Exempt resources
### Fonts
@spec @xref:sec-exempt-resources
Scenario: Allow foreign font media types without fallbacks
When checking EPUB 'foreign-exempt-font-valid'
Then info CSS-007 is reported
And no other errors or warnings are reported
### Linked resources
@spec @xref:sec-exempt-resources
Scenario: Allow foreign linked resources without fallbacks
When checking EPUB 'foreign-exempt-xhtml-link-valid'
And no errors or warnings are reported
@spec @xref:sec-exempt-resources
Scenario: Allow XPGT style sheets without fallbacks
See issues #271, #241
When checking EPUB 'foreign-exempt-xhtml-link-xpgt-no-fallback-valid'
Then no errors or warnings are reported
Scenario: Allow an xpgt style sheet to have an explicit manifest fallback
See issues #271, #241
When checking EPUB 'foreign-exempt-xhtml-link-xpgt-manifest-fallback-valid'
Then no errors or warnings are reported
### Tracks
@spec @xref:sec-exempt-resources
Scenario: Allow foreign text tracks without fallbacks
When checking EPUB 'foreign-exempt-xhtml-track-valid'
And no errors or warnings are reported
### Video
@spec @xref:sec-foreign-resources
Scenario: Allow foreign video in a HTML `video` element without a fallback
When checking EPUB 'foreign-exempt-xhtml-video-valid'
Then no errors or warnings are reported
@spec @xref:sec-foreign-resources
Scenario: Allow foreign video in a HTML `img` element without a fallback
When checking EPUB 'foreign-exempt-xhtml-video-in-img-valid'
Then no errors or warnings are reported
#### Other
@spec @xref:sec-exempt-resources
Scenario: Allow unreferenced foreign resources without fallbacks
When checking EPUB 'foreign-exempt-unused-valid'
Then no errors or warnings are reported
## 3.5 Resource fallbacks
### 3.5.1 Manifest fallbacks
@spec @xref:sec-manifest-fallbacks
Scenario: Allow non-CMT file to be in the spine if they have an XHTML Content Document fallback
Note: here an audio file is used in the spine
When checking file 'fallback-to-xhtml-valid.opf'
Then no errors or warnings are reported
@spec @xref:sec-manifest-fallbacks
Scenario: Allow an SVG Content Document to be used as a fallback
Note: here an image file is used in the spine
When checking file 'fallback-to-svg-valid.opf'
Then no errors or warnings are reported
@spec @xref:sec-manifest-fallbacks
Scenario: Report files that aren't Content Documents (like audio) in spine when they don't have a fallback
Note: here an audio file is used in the spine
When checking file 'fallback-missing-error.opf'
Then error OPF-043 is reported
And no other errors or warnings are reported
@spec @xref:sec-manifest-fallbacks
Scenario: Allow valid manifest fallback chain (single doc)
When checking file 'fallback-chain-valid.opf'
And no errors or warnings are reported
@spec @xref:sec-manifest-fallbacks
Scenario: Allow valid manifest fallback chain (waterfall)
When checking file 'fallback-chain-waterfall-valid'
And no errors or warnings are reported
@spec @xref:sec-manifest-fallbacks
Scenario: Allow valid manifest fallback chain (n-to-1)
When checking file 'fallback-chain-n-to-1-valid'
And no errors or warnings are reported
@spec @xref:sec-manifest-fallbacks
Scenario: Report a circular manifest fallback chain (single doc)
When checking file 'fallback-chain-circular-error.opf'
Then error OPF-045 is reported (circular reference)
And no other errors or warnings are reported
@spec @xref:sec-manifest-fallbacks
Scenario: Report a circular manifest fallback chain (full publication)
When checking EPUB 'fallback-chain-circular-error'
Then error OPF-045 is reported
And no other errors or warnings are reported
### 3.5.2 Intrinsic fallbacks
#### 3.5.2.2 HTML `audio` fallbacks
@spec @xref:sec-fallbacks-audio
Scenario: Report foreign HTML `audio` without fallbacks even with inner flow content
When checking EPUB 'foreign-xhtml-audio-no-fallback-with-flow-content-error'
Then error RSC-032 is reported
And no other errors or warnings are reported
@spec @xref:sec-fallbacks-audio
Scenario: Allow foreign HTML `audio` with a `source` fallback
When checking EPUB 'foreign-xhtml-audio-source-fallback-valid'
And no errors or warnings are reported
@spec @xref:sec-resource-locations
Scenario: Allow remote foreign HTML `audio` with a remote `source` fallback
When checking EPUB 'foreign-xhtml-audio-source-remote-fallback-valid'
Then no errors or warnings are reported
@spec @xref:sec-fallbacks-audio
Scenario: Report foreign audio in HTML `video` element without fallback
When checking EPUB 'foreign-xhtml-audio-in-video-no-fallback-error'
Then error RSC-032 is reported
And no other errors or warnings are reported
#### 3.5.2.2 HTML `img` fallbacks
@spec @xref:sec-fallbacks-img
Scenario: Verify that an `img` element can reference a foreign resource so long as it has a manifest fallback (and is not in a `picture` element)
When checking EPUB 'foreign-xhtml-img-manifest-fallback-valid'
Then no errors or warnings are reported
@spec @xref:sec-fallbacks-img
Scenario: Verify that an `img srcset` can reference foreign resources when they have manifest fallbacks
When checking EPUB 'foreign-xhtml-img-srcset-manifest-fallback-valid'
Then no errors or warnings are reported
@spec @xref:sec-fallbacks-img
Scenario: Report an `img src` with a foreign resource and no manifest fallback (when the `img` is not in a `picture` element)
When checking EPUB 'foreign-xhtml-img-src-no-manifest-fallback-error'
Then error RSC-032 is reported
And no other errors or warnings are reported
@spec @xref:sec-fallbacks-img
Scenario: Report a `picture` element with a foreign resource in its `img src` fallback
When checking EPUB 'foreign-xhtml-picture-img-src-error'
Then error MED-003 is reported
And no other errors or warnings are reported
@spec @xref:sec-fallbacks-img
Scenario: Report a `picture` element with a foreign resource in its `img srcset` fallback
When checking EPUB 'foreign-xhtml-picture-img-srcset-error'
Then error MED-003 is reported 2 times
And no other errors or warnings are reported
@spec @xref:sec-fallbacks-img
Scenario: Verify the `picture source` element can reference foreign resources so long as the `type` attribute is declared
When checking EPUB 'foreign-xhtml-picture-source-with-type-valid'
Then no errors or warnings are reported
@spec @xref:sec-fallbacks-img
Scenario: Report a `picture source` element that does not include a `type` attribute for a foreign resource
When checking EPUB 'foreign-xhtml-picture-source-no-type-error'
Then error MED-007 is reported
And no other errors or warnings are reported
#### 3.5.2.3 HTML `script` element
@spec @xref:html-script-element
Scenario: Verify a script data block does not require a fallback
When checking EPUB 'foreign-xhtml-script-datablock-valid'
Then no errors or warnings are reported
## 3.6 Resources Locations
Scenario: remote XHTML document is not detected in single-document mode
Remote resources checks depend on publication-wide validation
(e.g. to check if the resource is used a font)
When checking file 'resources-remote-xhtml-error.opf'
Then no errors or warnings are reported
Scenario: remote SVG document is not detected in single-document mode
Remote resources checks depend on publication-wide validation
(e.g. to check if the resource is used a font)
When checking file 'resources-remote-svg-font-valid.opf'
Then no errors or warnings are reported
@spec @xref:sec-resource-locations
Scenario: Allow audio resources to be remote
When checking file 'resources-remote-audio-valid.opf'
Then no errors or warnings are reported
@spec @xref:sec-resource-locations
Scenario: Verify that remote audio resources are allowed
When checking EPUB 'resources-remote-audio-valid'
Then no errors or warnings are reported
@spec @xref:sec-resource-locations
Scenario: Verify that remote audio resources are allowed anywhere
(not only in `audio` elements)
When checking EPUB 'resources-remote-audio-object-valid'
Then no errors or warnings are reported
@spec @xref:sec-resource-locations
Scenario: Verify that remote audio resources defined in the `sources` element are allowed
When checking EPUB 'resources-remote-audio-sources-valid'
Then no errors or warnings are reported
@spec @xref:sec-resource-locations
Scenario: Verify that remote video resources are allowed
When checking EPUB 'resources-remote-video-valid'
Then no errors or warnings are reported
@spec @xref:sec-resource-locations
Scenario: Verify that remote video resources are allowed anywhere
(not only in `video` elements)
When checking EPUB 'resources-remote-audio-object-valid'
Then no errors or warnings are reported
@spec @xref:sec-resource-locations
Scenario: Report a reference to a remote resource from an `iframe` element when the resource is declared in the package document (issue 852)
When checking EPUB 'resources-remote-iframe-error'
Then error RSC-006 is reported
And no other errors or warnings are reported
@spec @xref:sec-resource-locations
Scenario: Report a reference to a remote resource from an `iframe` element when the resource is not declared in package document
When checking EPUB 'resources-remote-iframe-undeclared-error'
Then error RSC-006 is reported
And no other errors or warnings are reported
@spec @xref:sec-resource-locations
Scenario: Report a remote image that is declared in the packaged document
When checking EPUB 'resources-remote-img-error'
Then error RSC-006 is reported
And no other errors or warnings are reported
@spec @xref:sec-resource-locations
Scenario: Report a remote image that is not declared in the package document
When checking EPUB 'resources-remote-img-undeclared-error'
Then error RSC-006 is reported
And no other errors or warnings are reported
@spec @xref:sec-resource-locations
Scenario: Report a remote image declared in the package document when it is referenced from an `img` tag and also retrieved by a script
When checking EPUB 'resources-remote-img-in-script-error'
Then error RSC-006 is reported
And no other errors or warnings are reported
@spec @xref:sec-resource-locations
Scenario: Verify that remote fonts are allowed
When checking EPUB 'resources-remote-font-valid'
Then no errors or warnings are reported
@spec @xref:sec-resource-locations
Scenario: Verify that remote SVG fonts are allowed
When checking EPUB 'resources-remote-font-svg-valid'
Then no errors or warnings are reported
@spec @xref:sec-resource-locations
Scenario: Verify that remote fonts of unknown type declared in CSS `@font-face` are allowed
When checking EPUB 'resources-remote-font-in-css-valid'
Then no errors or warnings are reported
@spec @xref:sec-resource-locations
Scenario: Verify that remote fonts of unknown type declared in SVG `font-face-uri` are allowed
When checking EPUB 'resources-remote-font-in-svg-valid'
Then no errors or warnings are reported
@spec @xref:sec-resource-locations
Scenario: Report a remote SVG font when it is referenced from an HTML `img` element
When checking EPUB 'resources-remote-font-svg-also-used-as-img-error'
Then error RSC-006 is reported
And no other errors or warnings are reported
@spec @xref:sec-resource-locations
Scenario: Report a reference to a remote resource from an `object` element when the resource is not declared in package document
When checking EPUB 'resources-remote-object-undeclared-error'
Then error RSC-006 is reported
And no other errors or warnings are reported
@spec @xref:sec-resource-locations
Scenario: Report a remote SVG Content Document
When checking EPUB 'resources-remote-svg-contentdoc-error'
Then error RSC-006 is reported
And no other errors or warnings are reported
@spec @xref:sec-resource-locations
Scenario: Verify that a remote foreign resource is allowed when used by a script
Given the reporting level set to usage
When checking EPUB 'resources-remote-resource-for-script-foreign-valid'
Then usage OPF-018b is reported (since the `remote-resources` property couldn't be verified)
And usage RSC-006b is reported (to suggest checking scripts manually)
And no other errors or warnings are reported
@spec @xref:sec-resource-locations
Scenario: Verify that a remote core media type resource is allowed when used by a script
Given the reporting level set to usage
When checking EPUB 'resources-remote-resource-for-script-cmt-valid'
Then usage OPF-018b is reported (since the `remote-resources` property couldn't be verified)
And usage RSC-006b is reported (to suggest checking scripts manually)
And no other errors or warnings are reported
@spec @xref:sec-resource-locations
Scenario: Report a remote top-level Content Documents
When checking EPUB 'resources-remote-spine-item-error'
Then error RSC-006 is reported
And no other errors or warnings are reported
@spec @xref:sec-resource-locations
Scenario: Report a remote script
When checking EPUB 'resources-remote-script-error'
Then error RSC-006 is reported
And no other errors or warnings are reported
@spec @xref:sec-resource-locations
Scenario: Report a remote stylesheet
When checking EPUB 'resources-remote-stylesheet-error'
Then error RSC-006 is reported
And no other errors or warnings are reported
@spec @xref:sec-resource-locations
Scenario: Warn about a remote resource with a non `https` URL
When checking EPUB 'resources-remote-not-https-warning'
Then warning RSC-031 is reported 3 times
And no other errors or warnings are reported
## 3.7 Data URLs
@spec @xref:sec-data-urls
Scenario: Allow a data URL in a manifest item not in the spine
When checking file 'data-url-in-manifest-item-valid.opf'
Then no errors or warnings are reported
@spec @xref:sec-data-urls
Scenario: Report a data URL in a manifest item referenced in the spine
When checking file 'data-url-in-manifest-item-in-spine-error.opf'
Then error RSC-029 is reported
And no other errors or warnings are reported
@spec @xref:sec-data-urls
Scenario: Report a data URL in the `href` attribute of an HTML `a` element
When checking file 'data-url-in-html-a-href-error.xhtml'
Then error RSC-029 is reported
And no other errors or warnings are reported
@spec @xref:sec-data-urls
Scenario: Report a data URL in the `href` attribute of an SVG `a` element
When checking file 'data-url-in-svg-a-href-error.xhtml'
Then error RSC-029 is reported
And no other errors or warnings are reported
@spec @xref:sec-data-urls
Scenario: Report a data URL in the `href` attribute of an HTML `area` element
When checking file 'data-url-in-html-area-href-error.xhtml'
Then error RSC-029 is reported
And no other errors or warnings are reported
@spec @xref:sec-data-urls
Scenario: Allow a data URL defining an exmpt resource (in an HTML `link` element)
When checking EPUB 'data-url-in-html-link-exempt-valid'
And no errors or warnings are reported
@spec @xref:sec-data-urls
Scenario: Allow a data URL defining a CMT resource (in an HTML `img` element)
When checking EPUB 'data-url-in-html-img-cmt-valid'
And no errors or warnings are reported
@spec @xref:sec-data-urls
Scenario: Allow a data URL defining a foreign resource with intrinsic fallback (in an HTML `img` element)
When checking EPUB 'data-url-in-html-img-foreign-intrinsic-fallback-valid'
And no errors or warnings are reported
@spec @xref:sec-data-urls
Scenario: Allow a data URL defining a foreign resource with a manifest fallback (in an HTML `img` element)
When checking EPUB 'data-url-in-html-img-foreign-manifest-fallback-valid'
And no errors or warnings are reported
@spec @xref:sec-data-urls
Scenario: Report a data URL defining a foreign resource with no fallback (in an HTML `img` element)
When checking EPUB 'data-url-in-html-img-foreign-no-fallback-error'
Then error RSC-032 is reported
And no other errors or warnings are reported
## 3.8 File URLs
@spec @xref:sec-file-urls
Scenario: Report a file URL used in the package document
When checking document 'file-url-in-package-document-error.opf'
Then error RSC-030 is reported
And no other errors or warnings are reported
@spec @xref:sec-file-urls
Scenario: Report a file URL used in a content document
When checking document 'file-url-in-xhtml-content-error.xhtml'
Then error RSC-030 is reported
And no other errors or warnings are reported
@spec @xref:sec-file-urls
Scenario: Report a file URL used in a CSS document
When checking EPUB 'file-url-in-css-error'
Then error RSC-030 is reported 2 times (one in the package doc, one in the CSS)
And no other errors or warnings are reported
## 3.9 XML conformance
@spec @xref:sec-xml-constraints
Scenario: an XML document encoded as UTF-8 with an encoding declaration is valid
When checking file 'xml-encoding-utf8-declared-valid.opf'
Then no errors or warnings are reported
@spec @xref:sec-xml-constraints
Scenario: an XML document encoded as UTF-8 with a BOM is valid
When checking file 'xml-encoding-utf8-BOM-valid.opf'
Then no errors or warnings are reported
@spec @xref:sec-xml-constraints
Scenario: an XML document encoded as UTF-8 with no encoding declaration is valid
When checking file 'xml-encoding-utf8-no-declaration-valid.opf'
Then no errors or warnings are reported
@spec @xref:sec-xml-constraints
Scenario: Warn about an XML document encoded as UTF-16 (with an encoding declaration)
When checking file 'xml-encoding-utf16-declared-warning.opf'
Then warning RSC-027 is reported
And no other errors or warnings are reported
@spec @xref:sec-xml-constraints
Scenario: Warn about an XML document encoded as UTF-16 (not declared but with a BOM)
When checking file 'xml-encoding-utf16-BOM-no-declaration-warning.opf'
Then warning RSC-027 is reported
And no other errors or warnings are reported
@spec @xref:sec-xml-constraints
Scenario: Warn about an XML document encoded as UTF-16 (even with an UTF-8 declaration)
When checking file 'xml-encoding-utf16-BOM-and-utf8-declaration-warning.opf'
Then warning RSC-027 is reported
And fatal error RSC-016 is reported (by the XML parser)
And no other errors or warnings are reported
@spec @xref:sec-xml-constraints
Scenario: Report an XML document encoded as ISO-8859-1 (detected in the encoding declaration)
When checking file 'xml-encoding-latin1-declaration-error.opf'
Then error RSC-028 is reported
And no other errors or warnings are reported
@spec @xref:sec-xml-constraints
Scenario: Report an XML document encoded as UCS-4 (detected with a BOM)
When checking file 'xml-encoding-utf32-BOM-error.opf'
Then error RSC-028 is reported
And no other errors or warnings are reported
@spec @xref:sec-xml-constraints
Scenario: Report an XML document declared with an unknown encoding name
When checking file 'xml-encoding-unknown-declared-error.opf'
Then error RSC-028 is reported
And fatal error RSC-016 is reported (by the XML parser)
And no other errors or warnings are reported
@spec @xref:sec-xml-constraints
Scenario: a not well-formed Package Document is reported
When checking file 'conformance-xml-malformed-error.opf'
Then fatal error RSC-016 is reported (parsing error)
And no other errors or warnings are reported
@spec @xref:sec-xml-constraints
Scenario: using a not-declared namespace is not allowed
When checking file 'conformance-xml-undeclared-namespace-error.opf'
Then fatal error RSC-016 is reported (parsing error)
And no other errors or warnings are reported
Scenario: Verify an attribute value with leading/trailing whitespace is allowed (issue 332)
When checking EPUB 'conformance-xml-id-leading-trailing-spaces-valid'
Then no errors or warnings are reported
## Other: non EPUB-defined checks
### MIME type mismatch warning
Scenario: Report an `object` element with a `type` attribute not matching the publication resource type
When checking EPUB 'type-mismatch-in-object-warning'
Then warning OPF-013 is reported
And no other errors or warnings are reported
Scenario: Report a picture `source` element `type` attribute not matching the publication resource type
When checking EPUB 'type-mismatch-in-picture-source-warning'
Then warning OPF-013 is reported
And no other errors or warnings are reported
Scenario: Report an audio `source` element `type` attribute not matching the publication resource type
When checking EPUB 'type-mismatch-in-picture-source-warning'
Then warning OPF-013 is reported
And no other errors or warnings are reported
Scenario: Report an `embed` element with a `type` attribute not matching the publication resource type
When checking EPUB 'type-mismatch-in-embed-warning'
Then warning OPF-013 is reported
And no other errors or warnings are reported