-
Notifications
You must be signed in to change notification settings - Fork 396
/
content-document-xhtml.feature
1040 lines (789 loc) · 40.6 KB
/
content-document-xhtml.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
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Feature: EPUB 3 — Content Documents — XHTML
Checks conformance to the "XHTML content documents" section of the EPUB 3.3 specification:
https://www.w3.org/TR/epub-33/#sec-xhtml
Background:
Given EPUB test files located at '/epub3/06-content-document/files/'
And EPUBCheck with default settings
## 6.1 XHTML Content Documents
Scenario: Verify that an XHTML Content Document can have any extension
When checking EPUB 'content-xhtml-file-extension-unusual-valid'
Then no errors or warnings are reported
### 6.1.2 XHTML requirements
@spec @xref:sec-xhtml-req
Scenario: Minimal Content Document
When checking document 'minimal.xhtml'
Then no errors or warnings are reported
@spec @xref:sec-xhtml-req
Scenario: Report RelaxNG schema errors when checking a Content Document in a full publication
When checking EPUB 'content-xhtml-relaxng-error'
Then error RSC-005 is reported
And no other errors or warnings are reported
@spec @xref:sec-xhtml-req
Scenario: Report Schematron schema errors when checking a Content Document in a full publication
When checking EPUB 'content-xhtml-schematron-error'
Then error RSC-005 is reported
And no other errors or warnings are reported
#### Document Properties - HTML Conformance
#### Encoding
Scenario: Report an XHMTL document not encoded as UTF-8
When checking document 'encoding-utf16-error.xhtml'
Then error HTM-058 is reported
And no other errors or warnings are reported
#### Document Title
Scenario: Report empty `title` element
When checking document 'title-empty-error.xhtml'
Then error RSC-005 is reported
And the message contains '"title" must not be empty'
And no other errors or warnings are reported
Scenario: Report missing `title` element
When checking document 'title-missing-warning.xhtml'
Then warning RSC-017 is reported
And the message contains 'The "head" element should have a "title" child element.'
And no other errors or warnings are reported
#### DOCTYPE
Scenario: Verify versionless HTML `doctype`
When checking document 'doctype-valid.xhtml'
Then no errors or warnings are reported
Scenario: Verify `doctype` with legacy string
When checking document 'doctype-legacy-compat-valid.xhtml'
Then no errors or warnings are reported
Scenario: Report `doctype` with obsolete public identifier
When checking document 'doctype-obsolete-error.xhtml'
Then error HTM-004 is reported
And no other errors or warnings are reported
#### Entities
Scenario: Verify that character references are allowed
When checking document 'entities-character-references-valid.xhtml'
Then no errors or warnings are reported
Scenario: Verify that character entity references in comments or CDATA sections are ignored
When checking document 'entities-comments-cdata-valid.xhtml'
Then no errors or warnings are reported
Scenario: Verify that internal entity declarations are allowed
When checking document 'entities-internal-valid.xhtml'
Then no errors or warnings are reported
Scenario: Report external entities
When checking document 'entities-external-error.xhtml'
Then error HTM-003 is reported
And no other errors or warnings are reported
Scenario: Report entity references not ending with a semicolon
When checking document 'entities-no-semicolon-error.xhtml'
Then fatal error RSC-016 is reported
And the message contains 'must end with the \';\' delimiter'
And no other errors or warnings are reported
Scenario: Report unknown entity references
When checking document 'entities-unknown-error.xhtml'
Then fatal error RSC-016 is reported
And the message contains 'was referenced, but not declared'
And no other errors or warnings are reported
#### IDs
Scenario: Report duplicate `id` attribute values
When checking document 'id-duplicate-error.xhtml'
Then error RSC-005 is reported 2 times
And the message contains 'Duplicate ID'
And no other errors or warnings are reported
Scenario: Verify `id` attribute with non-alphanumeric in its value
When checking document 'id-not-ncname-valid.xhtml'
Then no errors or warnings are reported
Scenario: Verify that ID-referencing attributes can refer to non-NCName IDs
When checking document 'id-ref-non-ncname-valid.xhtml'
Then no errors or warnings are reported
Scenario: Report ID-referencing attributes that refer to non-existing IDs
When checking document 'id-ref-not-found-error.xhtml'
Then error RSC-005 is reported
And the message contains 'must refer to elements in the same document (target ID missing)'
And no other errors or warnings are reported
#### ARIA
Scenario: Verify ARIA role allowed on an `a` element with no `href` attribute
When checking document 'aria-role-a-nohref-valid.xhtml'
Then no errors or warnings are reported
Scenario: Report non-existent ARIA `describedat` attribute
When checking document 'aria-describedAt-error.xhtml'
Then error RSC-005 is reported
And the message contains 'attribute "aria-describedat" not allowed here'
And no other errors or warnings are reported
Scenario: Verify the DPUB-ARIA roles allowed on `a`
When checking document 'aria-roles-img-valid.xhtml'
Then no errors or warnings are reported
Scenario: Verify the DPUB-ARIA roles allowed on `aside`
When checking document 'aria-roles-img-valid.xhtml'
Then no errors or warnings are reported
Scenario: Verify the DPUB-ARIA roles allowed on `footer`
When checking document 'aria-roles-footer-valid.xhtml'
Then no errors or warnings are reported
Scenario: Verify the DPUB-ARIA roles allowed on `h1`-'h6`
When checking document 'aria-roles-h1-h6-valid.xhtml'
Then no errors or warnings are reported
Scenario: Verify the DPUB-ARIA roles allowed on `header`
When checking document 'aria-roles-header-valid.xhtml'
Then no errors or warnings are reported
Scenario: Verify the DPUB-ARIA roles allowed on `hr`
When checking document 'aria-roles-header-valid.xhtml'
Then no errors or warnings are reported
Scenario: Verify the DPUB-ARIA roles allowed on `img`
When checking document 'aria-roles-img-valid.xhtml'
Then no errors or warnings are reported
Scenario: Verify the DPUB-ARIA roles allowed on `li`
When checking document 'aria-roles-li-valid.xhtml'
Then no errors or warnings are reported
Scenario: Verify the DPUB-ARIA roles allowed on `nav`
When checking document 'aria-roles-nav-valid.xhtml'
Then no errors or warnings are reported
Scenario: Verify the DPUB-ARIA roles allowed on `section`
When checking document 'aria-roles-section-valid.xhtml'
Then no errors or warnings are reported
Scenario: Verify ARIA attributes allowed on SVG elements
When checking document 'svg-aria-valid.xhtml'
Then no errors or warnings are reported
#### Attributes (General)
Scenario: Verify the value of HTML boolean attributes and enumerated attributes are parsed in a case-insensitive manner
When checking document 'attrs-case-insensitive-valid.xhtml'
Then no errors or warnings are reported
#### base
Scenario: Verify that a base url can be set
When checking EPUB 'content-xhtml-base-url-valid'
Then warning HTM-055 is reported (side effect of `base` being discouraged)
Then no errors or warnings are reported
Scenario: Report relative paths as remote resources when HTML `base` is set to an extenal URL (issue 155)
When checking EPUB 'content-xhtml-base-url-remote-relative-path-error'
Then warning HTM-055 is reported (side effect of `base` being discouraged)
Then error RSC-006 is reported
And no other errors or warnings are reported
Scenario: Report relative paths as remote resources when `xml:base` is set to an extenal URL (issue 155)
When checking EPUB 'content-xhtml-xml-base-url-remote-relative-path-error'
Then error RSC-006 is reported
And no other errors or warnings are reported
#### Canvas
Scenario: Verify canvas element with a fallback
When checking document 'canvas-valid.xhtml'
Then no errors or warnings are reported
Scenario: Report canvas that falls back to a canvas
When checking document 'canvas-fallback-error.xhtml'
Then error MED-002 is reported
And no other errors or warnings are reported
#### Custom Elements
Scenario: Verify custom elements are not rejected
When checking document 'custom-elements-valid.xhtml'
Then no errors or warnings are reported
#### data attributes
Scenario: Verify `data-*` attributes are allowed
When checking document 'data-attr-valid.xhtml'
Then no errors or warnings are reported
Scenario: Report invalid elements after a `data-*` attribute
See issue 189 - was allowed by stripping of `data-*` attributes
When checking EPUB 'content-xhtml-data-attr-removal-markup-error'
Then error RSC-005 is reported
And the message contains 'element "somebadxhtmlformatting" not allowed here'
And no other errors or warnings are reported
Scenario: Verify fragment identifiers are allowed in attributes after a `data-*` declaration
See issue 198 - caused error from stripping of `data-*` attributes
When checking EPUB 'content-xhtml-data-attr-removal-fragments-valid'
Then no errors or warnings are reported
#### hyperlinks
@spec @xref:sec-file-urls
Scenario: Report as an INFO a hyperlink to a resource in the local file system
See issue #289
When checking EPUB 'content-xhtml-link-to-local-file-valid'
Then info HTM-053 is reported
And no errors or warnings are reported
Scenario: Do not report escaped hyperlinks to resources in the local file system
See issue #1182
When checking EPUB 'content-xhtml-link-to-local-file-escaped-valid'
Then info HTM-053 is reported 0 times
And no errors or warnings are reported
@spec @xref:sec-container-iri
Scenario: Report a hyperlink to a resource missing from the publication
When checking EPUB 'content-xhtml-link-to-missing-doc-error'
Then error RSC-007 is reported
And no errors or warnings are reported
Scenario: Report a hyperlink to a missing identifier
When checking EPUB 'content-xhtml-link-to-missing-id-error'
Then error RSC-012 is reported
And no errors or warnings are reported
Scenario: Report a hyperlink to a mising identifier in another document
When checking EPUB 'content-xhtml-link-to-missing-id-xref-error'
Then error RSC-012 is reported
And no errors or warnings are reported
Scenario: Verify that href values that only contain whitepace are allowed
See issue 225 - asked for a warning, but an empty string is a valid URL
When checking EPUB 'content-xhtml-link-href-empty-valid'
Then no errors or warnings are reported
Scenario: Verify `object` element does not cause issues with fragment references
See issue 226
When checking EPUB 'content-xhtml-link-fragment-after-object-valid'
Then no errors or warnings are reported
Scenario: Verify that relative paths starting with a single dot are resolved properly
See issue 270
When checking EPUB 'content-xhtml-link-rel-path-dot-valid'
Then no errors or warnings are reported
@spec @xref:sec-spine-elem
Scenario: Report a link to a resource that is not in the spine
When checking EPUB 'content-xhtml-link-out-of-spine-error'
Then error RSC-011 is reported
And no other errors or warnings are reported
@spec @xref:sec-manifest-elem
Scenario: Report a reference from an XHTML doc to a resource not declared in the manifest
When checking EPUB 'content-xhtml-referenced-resource-missing-error'
Then error RSC-007 is reported
And no other errors or warnings are reported
Scenario: Report fragment identifiers used in stylesheet URLs
When checking document 'content-xhtml-link-stylesheet-fragment-id-error'
Then error RSC-013 is reported
Then no other errors or warnings are reported
# FIXME not sure this error is legit
Scenario: Report a hyperlink to SVG symbol ("incompatible resource type")
When checking document 'content-xhtml-link-to-svg-fragment-error'
Then error RSC-014 is reported
Then no other errors or warnings are reported
Scenario: Allow valid hyperlink URLs
When checking document 'a-href-valid.xhtml'
Then no errors or warnings are reported
#### iframes
Scenario: Verify that an `iframe` can reference another XHTML document
When checking EPUB 'content-xhtml-iframe-basic-valid'
Then no errors or warnings are reported
#### img
Scenario: Report an `img` element with an empty `src` attribute
When checking document 'img-src-empty-error.xhtml'
Then error HTM-008 is reported
And no other errors or warnings are reported
Scenario: Report an `img` element with no `alt` attribute
When checking document 'img-alt-missing-error.xhtml'
# FIXME see issue #446
#Then error RSC-005 is reported
And no other errors or warnings are reported
Scenario: Allow an `img` element with no `alt` attribute when it has a `title` attribute
When checking document 'img-alt-missing-with-title-valid.xhtml'
Then no errors or warnings are reported
Scenario: Allow an `img` element with no `alt` attribute when it is in a captioned figure
When checking document 'img-alt-missing-in-figure-valid.xhtml'
Then no errors or warnings are reported
Scenario: Verify that `img` element can reference SVG fragments
When checking EPUB 'content-xhtml-img-fragment-svg-valid'
Then no errors or warnings are reported
Scenario: Report non-SVG images referenced as fragments
When checking EPUB 'content-xhtml-img-fragment-non-svg-warning'
Then warning RSC-009 is reported 2 times (1 for an HTML `img` element, 1 for an SVG `image` element)
And no other errors or warnings are reported
@spec @xref:sec-manifest-elem
Scenario: Report references to undeclared resources in `img srcset`
When checking EPUB 'content-xhtml-img-srcset-undeclared-error'
Then error RSC-008 is reported (undeclared resource in srcset)
And warning OPF-003 is reported (undeclared resource in container)
And no other errors or warnings are reported
#### lang
Scenario: Verify empty language tag allowed (issue 777)
When checking document 'lang-empty-valid.xhtml'
Then no errors or warnings are reported
Scenario: Report a mismatch in `lang` and `xml:lang` attributes
When checking document 'content-xhtml-lang-xml-lang-mismatch-error'
Then error RSC-005 is reported
And the message contains 'lang and xml:lang attributes must have the same value'
And no other errors or warnings are reported
Scenario: Verify that three-character language codes are allowed (issue 615)
When checking EPUB 'lang-three-char-code-valid.xhtml'
Then no errors or warnings are reported
#### Links
Scenario: Verify a `link` element with a known alt style tag
When checking document 'link-alt-style-tags-valid.xhtml'
Then no errors or warnings are reported
Scenario: Report a `link` element with an unknown alt style tag
When checking document 'link-alt-style-tags-error.xhtml'
Then error OPF-027 is reported
And error CSS-005 is reported
And no other errors or warnings are reported
Scenario: Verify `link` elements used to declare alternative stylesheets
When checking document 'link-rel-stylesheet-alternate-valid.xhtml'
Then no errors or warnings are reported
Scenario: Report `link` element defining an alternative stylesheet with no title
When checking document 'link-rel-stylesheet-alternate-no-title-error.xhtml'
Then error CSS-015 is reported 2 times (one for a missing title, one for an empty title)
And no other errors or warnings are reported
#### Lists
Scenario: Verify an `li` with a `value` attribute (issue 248)
When checking document 'li-with-value-attr-valid.xhtml'
Then no errors or warnings are reported
#### Main
Scenario: Verify `main` element is allowed
See issue 340
When checking document 'main-valid.xhtml'
Then no errors or warnings are reported
#### Map
Scenario: Verify image map
See issue 696
When checking document 'map-valid.xhtml'
Then no errors or warnings are reported
Scenario: Report invalid image map
See issue 696
When checking document 'map-usemap-error.xhtml'
Then error RSC-005 is reported
And the message contains 'value of attribute "usemap" is invalid'
And no errors or warnings are reported
#### MathML
@spec @xref:sec-manifest-elem
Scenario: Report a MathML formula with an alternative image that cannot be found
When checking EPUB 'content-xhtml-mathml-altimg-not-found-warning'
Then error RSC-007 is reported
And no other errors or warnings are reported
#### meta
Scenario: Verify `http-equiv` declaration
When checking document 'http-equiv-valid.xhtml'
Then no errors or warnings are reported
Scenario: Verify case-insensitive `http-equiv` declaration
When checking document 'http-equiv-case-valid.xhtml'
Then no errors or warnings are reported
Scenario: Report `http-equiv` declaration of non-utf8 charset
When checking document 'http-equiv-non-utf8-error.xhtml'
Then error RSC-005 is reported
And the message contains 'must have the value "text/html; charset=utf-8"'
And no other errors or warnings are reported
Scenario: Report both `http-equiv` and `charset` are declared
When checking document 'http-equiv-and-charset-error.xhtml'
Then error RSC-005 is reported
And the message contains 'must not contain both a meta element in encoding declaration state (http-equiv=\'content-type\') and a meta element with the charset attribute'
And no other errors or warnings are reported
@spec @xref:sec-fxl-content-dimensions
Scenario: Verify that `viewport meta` declaration is not checked for non-fixed layout documents (issue 419)
When checking EPUB 'content-xhtml-meta-viewport-non-fxl-valid'
Then no errors or warnings are reported
#### Microdata
Scenario: Verify that microdata attributes are allowed on elements
When checking document 'microdata-valid.xhtml'
Then no errors or warnings are reported
Scenario: Report use of microdata attributes on elements where they are not allowed
When checking document 'microdata-error.xhtml'
Then error RSC-005 is reported
And the message contains 'element "a" missing required attribute "href"'
And error RSC-005 is reported 2 times
And the message contains 'If the itemprop is specified on'
And no other errors or warnings are reported
#### Non-conforming Features
Scenario: Report the obsolete `typemustmatch` attribute
When checking document 'obsolete-typemustmatch-error.xhtml'
Then error RSC-005 is reported
And the message contains 'attribute "typemustmatch" not allowed here'
And no other errors or warnings are reported
Scenario: Report the obsolete `contextmenu` attribute
When checking document 'obsolete-contextmenu-error.xhtml'
Then error RSC-005 is reported
And the message contains 'attribute "contextmenu" not allowed here'
And no other errors or warnings are reported
Scenario: Report the obsolete `dropzone` attribute
When checking document 'obsolete-dropzone-error.xhtml'
Then error RSC-005 is reported
And the message contains 'attribute "dropzone" not allowed here'
And no other errors or warnings are reported
Scenario: Report the obsolete `keygen` element
When checking document 'obsolete-keygen-error.xhtml'
Then error RSC-005 is reported
And the message contains 'element "keygen" not allowed here'
And no other errors or warnings are reported
Scenario: Report obsolete features of the `menu` element
When checking document 'obsolete-menu-features-error.xhtml'
Then error RSC-005 is reported
And the message contains 'attribute "type" not allowed here'
And error RSC-005 is reported
And the message contains 'element "command" not allowed here'
And error RSC-005 is reported
And the message contains 'element "button" not allowed here'
And no other errors or warnings are reported
Scenario: Report obsolete `pubdate` attribute
When checking document 'obsolete-pubdate-error.xhtml'
Then error RSC-005 is reported
And the message contains 'attribute "pubdate" not allowed here'
And no other errors or warnings are reported
Scenario: Report obsolete `seamless` attribute
When checking document 'obsolete-seamless-error.xhtml'
Then error RSC-005 is reported
And the message contains 'attribute "seamless" not allowed here'
And no other errors or warnings are reported
#### object
Scenario: Report an `object` element without a fallback
When checking EPUB 'content-xhtml-object-no-fallback-error'
Then error MED-002 is reported
And no other errors or warnings are reported
@spec @xref:sec-item-elem
Scenario: Report an `object` element with a media type not matching the Package Document declaration
When checking EPUB 'content-xhtml-object-mediatype-mismatch-error'
Then error OPF-013 is reported
And no other errors or warnings are reported
#### Schematron Assertions
@spec @xref:sec-xhtml-req
Scenario: Verify no schematron assertions
When checking document 'schematron-valid.xhtml'
Then no errors or warnings are reported
Scenario: Report schematron assertions without line or column numbers
When checking document 'schematron-error.xhtml'
Then error MED-002 is reported 1 times
And error RSC-005 is reported 43 times
# // unclear how to port this function
# new ExtraReportTest
# @Override
# Scenario: test(ValidationReport testReport)
# for (ItemReport error : testReport.errorList)
# assertTrue("Error '" + error.message + "' has no line number.", error.line != -1);
# assertTrue("Error '" + error.message + "' has no column number.", error.column != -1);
# });
#### script
#//TODO verify script core media types
#### Style
Scenario: Verify use of `style` element in the header
When checking document 'style-valid.xhtml'
Then no errors or warnings are reported
Scenario: Report `style` element without a `type` declaration
When checking document 'style-no-type-error.xhtml'
Then error CSS-008 is reported
And no other errors or warnings are reported
Scenario: Report `style` element in the body
When checking document 'style-in-body-error.xhtml'
Then error RSC-005 is reported
And the message contains 'element "style" not allowed here'
And error RSC-005 is reported
And the message contains 'attribute "scoped" not allowed here'
And no other errors or warnings are reported
Scenario: Verify the `style` attribute is allowed with valid syntax
When checking document 'style-attr-valid.xhtml'
Then no errors or warnings are reported
Scenario: Report use of `style` attribute with invalid css syntax
When checking document 'style-attr-syntax-error.xhtml'
Then error CSS-008 is reported
And no other errors or warnings are reported
#### SVG
Scenario: Verify that an SVG image can be referenced from `img`, `object` and `iframe` elements
When checking EPUB 'content-xhtml-svg-reference-valid'
And no errors or warnings are reported
Scenario: Verify that `svg:switch` doesn't trigger the package document `switch` property check
When checking EPUB 'content-xhtml-svg-switch-valid'
Then no errors or warnings are reported
Scenario: Verify that `svgView` fragments are allowed when associated to SVG documents
When checking EPUB 'content-xhtml-svg-fragment-svgview-valid'
Then no errors or warnings are reported
#### Tables
Scenario: Verify `border` attribute allowed on tables
When checking document 'table-border-valid.xhtml'
Then no errors or warnings are reported
Scenario: Report `table` with invalid `border` attribute value
When checking document 'table-border-error.xhtml'
Then error RSC-005 is reported
And the message contains 'value of attribute "border" is invalid'
And no other errors or warnings are reported
#### Time
Scenario: Verify various `datetime` values (incl. issue 341)
When checking document 'time-valid.xhtml'
Then no errors or warnings are reported
Scenario: Report various invalid `datetime` formats
When checking document 'time-error.xhtml'
Then error RSC-005 is reported 25 times
And the message contains 'value of attribute "datetime" is invalid'
And no other errors or warnings are reported
Scenario: Report a `time` element nested inside another
When checking document 'time-nested-error.xhtml'
Then error RSC-005 is reported
And the message contains 'element "time" not allowed here'
And no other errors or warnings are reported
#### URLs
@spec @xref:sec-container-iri
Scenario: Verify valid URLs
When checking document 'url-valid.xhtml'
Then no errors or warnings are reported
@spec @xref:sec-container-iri
Scenario: Report non-conforming URLs
When checking document 'url-invalid-error.xhtml'
Then error RSC-020 is reported 2 times
And no other errors or warnings are reported
@spec @xref:sec-container-iri
Scenario: Report a URL host that cannot be parsed
When checking document 'url-host-unparseable-warning.xhtml'
# Some apparently invalid host parse OK with Galimatias. To be investigated.
And error RSC-020 is reported 2 times
And no other errors or warnings are reported
@spec @xref:sec-container-iri
Scenario: Report unregistered URL scheme
When checking document 'url-unregistered-scheme-warning.xhtml'
And warning HTM-025 is reported
And no other errors or warnings are reported
#### video
Scenario: Report a `poster` attribute that references an invalid media type
When checking EPUB 'content-xhtml-video-poster-media-type-error'
Then error MED-001 is reported
And no other errors or warnings are reported
#### XML Support
Scenario: Report an XML 1.1 version declaration
When checking document 'xml11-error.xhtml'
Then error HTM-001 is reported
And no other errors or warnings are reported
### 6.1.3 HTML Extensions
#### 6.1.3.1 Structural semantics
Scenario: Verify `epub:type` attribute with valid semantic
When checking document 'epubtype-valid.xhtml'
Then no errors or warnings are reported
Scenario: Verify `epub:type` attribute in document header
When checking document 'epubtype-in-head-valid.xhtml'
Then no errors or warnings are reported
Scenario: Verify `epub:type` attribute with reserved vocabulary
When checking document 'epubtype-reserved-vocab-valid.xhtml'
Then no errors or warnings are reported
@spec @xref:sec-prefix-attr
Scenario: Verify `epub:type` attribute with author-declared vocabulary
When checking document 'epubtype-declared-vocab-valid.xhtml'
Then no errors or warnings are reported
Scenario: Verify `epub:type` attribute with unknown semantic
Given the reporting level set to usage
When checking document 'epubtype-unknown-usage.xhtml'
Then usage OPF-088 is reported
And no other errors or warnings are reported
Scenario: Verify `epub:type` attribute with deprecated semantic
Given the reporting level set to usage
When checking document 'epubtype-deprecated-usage.xhtml'
Then usage OPF-086b is reported 10 times
And no other errors or warnings are reported
Scenario: Verify `epub:type` attribute that does not follow usage suggestions
Given the reporting level set to usage
When checking document 'epubtype-disallowed-usage.xhtml'
Then usage OPF-087 is reported 7 times
And no other errors or warnings are reported
@spec @xref:sec-prefix-attr
Scenario: Report `epub:type` attribute with a semantic from an undeclared vocabulary
When checking document 'epubtype-prefix-undeclared-error.xhtml'
Then error OPF-028 is reported
And no other errors or warnings are reported
#### 6.1.3.2 RDFa
@spec @xref:sec-xhtml-rdfa
Scenario: Verify RDFa attributes are allowed on HTML elements
When checking document 'rdfa-valid.xhtml'
Then no errors or warnings are reported
#### 6.1.3.3 Content Switching (Deprecated)
Scenario: Report `epub:switch` is deprecated
When checking document 'switch-deprecated-warning.xhtml'
Then warning RSC-017 is reported
And the message contains 'The "epub:switch" element is deprecated'
And no other errors or warnings are reported
Scenario: Report `epub:switch` with invalid mathml
When checking document 'switch-mathml-error.xhtml'
Then error RSC-005 is reported
And the message contains 'element "math" not allowed here'
And warning RSC-017 is reported
And the message contains 'The "epub:switch" element is deprecated'
And no other errors or warnings are reported
Scenario: Report an `epub:switch` with a `default` before any `case` elements
When checking document 'switch-default-before-case-error.xhtml'
Then error RSC-005 is reported
And the message contains 'element "epub:default" not allowed yet'
And error RSC-005 is reported
And the message contains 'element "epub:case" not allowed here'
And warning RSC-017 is reported
And the message contains 'The "epub:switch" element is deprecated'
And no other errors or warnings are reported
Scenario: Report an `epub:switch` with multiple `default` elements
When checking document 'switch-multiple-default-error.xhtml'
Then error RSC-005 is reported
And the message contains 'element "epub:default" not allowed here'
And warning RSC-017 is reported
And the message contains 'The "epub:switch" element is deprecated'
And no other errors or warnings are reported
Scenario: Report `epub:switch` without any `case` elements
When checking document 'switch-no-case-error.xhtml'
Then error RSC-005 is reported
And the message contains 'element "epub:default" not allowed yet'
And warning RSC-017 is reported
And the message contains 'The "epub:switch" element is deprecated'
And no other errors or warnings are reported
Scenario: Report `epub:switch` element without a `default`
When checking document 'switch-no-default-error.xhtml'
Then error RSC-005 is reported
And the message contains 'element "epub:switch" incomplete'
And warning RSC-017 is reported
And the message contains 'The "epub:switch" element is deprecated'
And no other errors or warnings are reported
Scenario: Report `epub:case` without a `required-namespace` attribute
When checking document 'switch-no-case-namespace-error.xhtml'
Then error RSC-005 is reported
And the message contains 'element "epub:case" missing required attribute "required-namespace"'
And warning RSC-017 is reported
And the message contains 'The "epub:switch" element is deprecated'
And no other errors or warnings are reported
#### 6.1.3.4 The epub:trigger Element (Deprecated)
Scenario: Report `epub:trigger` is deprecated
When checking document 'trigger-deprecated-warning.xhtml'
Then warning RSC-017 is reported
And the message contains 'The "epub:trigger" element is deprecated'
And no other errors or warnings are reported
Scenario: Report `epub:trigger` that references non-existent IDs
When checking document 'trigger-badrefs-error.xhtml'
Then error RSC-005 is reported
And the message contains 'The ref attribute must refer to an element in the same document'
And error RSC-005 is reported
And the message contains 'The ev:observer attribute must refer to an element in the same document'
And warning RSC-017 is reported 2 times
And the message contains 'The "epub:trigger" element is deprecated'
And no other errors or warnings are reported
#### 6.1.3.5 Custom Attributes
@spec @xref:sec-xhtml-custom-attributes
Scenario: Verify attributes in custom namespaces are ignored
When checking document 'attrs-custom-ns-valid.xhtml'
Then no errors or warnings are reported
@spec @xref:sec-xhtml-custom-attributes
Scenario: Report custom attributes using reserved strings in their namespace
When checking document 'attrs-custom-ns-reserved-error.xhtml'
Then error HTM-054 is reported 2 times
And no other errors or warnings are reported
Scenario: Verify SSML attributes are allowed
When checking document 'ssml-valid.xhtml'
Then no errors or warnings are reported
Scenario: Report SSML `ph` attribute without a value
When checking document 'ssml-empty-ph-warning.xhtml'
Then warning HTM-007 is reported 2 times
And no other errors or warnings are reported
### 6.1.4 HTML deviations and constraints
#### 6.1.4.1 Embedded MathML
Scenario: Verify MathML markup with prefixed elements
When checking document 'mathml-prefixed-valid.xhtml'
Then no errors or warnings are reported
Scenario: Verify MathML markup with unprefixed elements
When checking document 'mathml-unprefixed-valid.xhtml'
Then no errors or warnings are reported
Scenario: Verify MathML markup without alternative text
Given the reporting level set to usage
When checking document 'mathml-noalt-usage.xhtml'
Then usage ACC-009 is reported
And no other errors or warnings are reported
@spec @xref:sec-xhtml-deviations
Scenario: Report MathML markup with only content MathML
When checking document 'mathml-contentmathml-error.xhtml'
Then error RSC-005 is reported
And the message contains 'element "apply" not allowed here'
And error RSC-005 is reported
And the message contains 'element "cn" not allowed here'
And no other errors or warnings are reported
Scenario: Verify MathML with tex annotation
When checking document 'mathml-anno-tex-valid.xhtml'
Then no errors or warnings are reported
@spec @xref:sec-xhtml-deviations
Scenario: Verify MathML with content MathML annotation
When checking document 'mathml-anno-contentmathml-valid.xhtml'
Then no errors or warnings are reported
@spec @xref:sec-xhtml-deviations
Scenario: Verify MathML with presentation MathML annotation
When checking document 'mathml-anno-presmathml-valid.xhtml'
Then no errors or warnings are reported
Scenario: Verify MathML with descendant MathML markup in an XHTML annotation
When checking document 'mathml-anno-xhtml-with-mathml-valid.xhtml'
Then no errors or warnings are reported
Scenario: Report Content MathML annotation without a `name` attribute
When checking document 'mathml-anno-noname-error.xhtml'
Then error RSC-005 is reported
And the message contains 'element "annotation-xml" missing required attribute "name"'
And no other errors or warnings are reported
Scenario: Report MathML annotation with an invalid `name` attribute
When checking document 'mathml-anno-name-error.xhtml'
Then error RSC-005 is reported
And the message contains 'value of attribute "name" is invalid'
And no other errors or warnings are reported
@spec @xref:sec-xhtml-deviations
Scenario: Report MathML annotation with an invalid `encoding` attribute
When checking document 'mathml-anno-encoding-error.xhtml'
Then error RSC-005 is reported
And the message contains 'element "apply" not allowed here'
And no other errors or warnings are reported
Scenario: Verify MathML markup with an XHTML annotation
When checking document 'mathml-anno-xhtml-valid.xhtml'
Then no errors or warnings are reported
Scenario: Verify MathML markup with XHTML annotation missing name attribute
When checking document 'mathml-anno-xhtml-noname-valid.xhtml'
Then no errors or warnings are reported
@spec @xref:sec-xhtml-deviations
Scenario: Verify MathML markup with `annotation-xml` `name` attribute set to `contentequiv`
When checking document 'mathml-anno-xhtml-contentequiv-valid.xhtml'
Then no errors or warnings are reported
Scenario: Verify MathML markup with an HTML encoded annotation
When checking document 'mathml-anno-xhtml-html-encoding-valid.xhtml'
Then no errors or warnings are reported
Scenario: Verify MathML markup with an SVG annotation
When checking document 'mathml-anno-svg-valid.xhtml'
Then no errors or warnings are reported
Scenario: Report a MathML annotation with the XHTML encoding reversed (application/xml+xhtml)
When checking document 'mathml-anno-xhtml-encoding-error.xhtml'
Then error RSC-005 is reported
And the message contains 'value of attribute "encoding" is invalid; must be equal to'
And no other errors or warnings are reported
#### 6.1.4.2 Embedded SVG
@spec @xref:sec-xhtml-svg
Scenario: Verify inclusion of SVG markup
When checking document 'svg-valid.xhtml'
Then no errors or warnings are reported
Scenario: Verify conforming SVG markup does not create false-positives
When checking document 'svg-regression-valid.xhtml'
Then no errors or warnings are reported
Scenario: Verify the SVG IDs can be any valid HTML ID
When checking document 'svg-id-valid.xhtml'
Then no errors or warnings are reported
@spec @xref:sec-xhtml-svg @xref:sec-svg-req
Scenario: Verify that `epub:type` attribute can be used on SVG
When checking document 'svg-with-epubtype-valid.xhtml'
Then no errors or warnings are reported
Scenario: Verify that SVG validation erors are reported as USAGE
Given the reporting level set to usage
When checking document 'svg-invalid-usage.xhtml'
Then usage RSC-025 is reported
And the message contains 'element "foo" not allowed here'
And no other errors or warnings are reported
#TODO review if this warning is relevant
Scenario: Report an SVG link without a recommended title
When checking document 'svg-links-no-title-warning.xhtml'
Then warning ACC-011 is reported
And no other errors or warnings are reported
Scenario: Verify unprefixed HTML elements allowed inside prefixed `foreignObject`
When checking document 'svg-foreignObject-valid.xhtml'
Then no errors or warnings are reported
Scenario: Verify that the `requiredExtensions` attribute can have any value
When checking document 'svg-foreignObject-requiredExtensions-valid.xhtml'
And no other errors or warnings are reported
Scenario: Report `foreignObject` with a body element
When checking document 'svg-foreignObject-with-body-error.xhtml'
Then error RSC-005 is reported
And the message contains 'element "body" not allowed here'
And no other errors or warnings are reported
Scenario: Report HTML validation errors within `foreignObject` content
When checking document 'svg-foreignObject-html-invalid-error.xhtml'
Then error RSC-005 is reported
And the message contains 'attribute "href" not allowed here'
And no other errors or warnings are reported
Scenario: Report `foreignObject` without flow content
When checking document 'svg-foreignObject-not-flow-content-error.xhtml'
Then error RSC-005 is reported
And the message contains 'element "title" not allowed here'
And no other errors or warnings are reported
Scenario: Verify `title` can contain text
When checking document 'svg-title-text-valid.xhtml'
Then no errors or warnings are reported
Scenario: Verify `title` can contain HTML phrasing content