]> code.delx.au - gnu-emacs-elpa/blob - embed.rnc
Refine some ARIA checking to sync w/ current spec
[gnu-emacs-elpa] / embed.rnc
1 datatypes w = "http://whattf.org/datatype-draft"
2 namespace local = ""
3
4 # #####################################################################
5 ## RELAX NG Schema for HTML 5: Embedded Content #
6 # #####################################################################
7
8 #######################################################################
9 ## Replaced Content
10
11 ## Images: <img>
12
13 img.elem =
14 element img { img.inner & img.attrs }
15 img.attrs =
16 ( common.attrs
17 & img.attrs.src
18 & img.attrs.srcset?
19 & img.attrs.sizes?
20 & img.attrs.alt? # ARIA: if alt empty, only allowed role value is "presentation"; check in assertions
21 & img.attrs.height?
22 & img.attrs.width?
23 & img.attrs.usemap?
24 & img.attrs.ismap?
25 & img.attrs.border? # obsolete
26 & embedded.content.attrs.crossorigin?
27 & ( common.attrs.aria.implicit.img
28 | common.attrs.aria
29 )?
30 )
31 img.attrs.src =
32 attribute src {
33 common.data.uri.non-empty
34 }
35 img.attrs.srcset =
36 attribute srcset {
37 string
38 } & v5only
39 img.attrs.sizes =
40 attribute sizes {
41 common.data.source.size.list
42 } & v5only
43 img.attrs.alt =
44 attribute alt {
45 text
46 }
47 img.attrs.height =
48 attribute height {
49 common.data.integer.non-negative
50 }
51 img.attrs.width =
52 attribute width {
53 common.data.integer.non-negative
54 }
55 img.attrs.usemap =
56 attribute usemap {
57 common.data.hash-name
58 }
59 img.attrs.ismap =
60 attribute ismap {
61 w:string "ismap" | w:string ""
62 }
63 img.attrs.border =
64 attribute border {
65 common.data.zero
66 }
67 img.inner =
68 empty
69
70 common.elem.phrasing |= img.elem
71
72 ## Image with multiple sources: <picture>
73
74 picture.elem =
75 element picture { picture.inner & picture.attrs }
76 & v5only
77 picture.attrs =
78 ( common.attrs )
79 picture.inner =
80 ( ( source.picture.elem*
81 & common.elem.script-supporting*
82 ),
83 ( img.elem
84 & common.elem.script-supporting*
85 )
86 )
87
88 common.elem.phrasing |= picture.elem
89
90 ## Picture source: <source srcset>
91
92 source.picture.elem =
93 element source { source.picture.inner & source.picture.attrs }
94 source.picture.attrs =
95 ( common.attrs
96 & source.picture.attrs.media?
97 & source.picture.attrs.srcset
98 & source.picture.attrs.sizes?
99 & source.picture.attrs.type?
100 )
101 source.picture.attrs.media =
102 attribute media {
103 common.data.mediaquery
104 }
105 source.picture.attrs.srcset =
106 attribute srcset {
107 string
108 }
109 source.picture.attrs.sizes =
110 attribute sizes {
111 common.data.source.size.list
112 }
113 source.picture.attrs.type =
114 attribute type {
115 common.data.mimetype
116 }
117 source.picture.inner =
118 ( empty )
119
120 ## Plug-ins: <embed>
121
122 embed.elem =
123 element embed { embed.inner & embed.attrs }
124 embed.attrs =
125 ( common.attrs
126 & embed.attrs.src?
127 & embed.attrs.type?
128 & embed.attrs.height?
129 & embed.attrs.width?
130 & embed.attrs.other*
131 & ( common.attrs.aria.landmark.application
132 | common.attrs.aria.landmark.document
133 | common.attrs.aria.role.img
134 | common.attrs.aria.role.presentation
135 )?
136 )
137 embed.attrs.src =
138 attribute src {
139 common.data.uri.non-empty
140 }
141 embed.attrs.type =
142 attribute type {
143 common.data.mimetype
144 }
145 embed.attrs.height =
146 attribute height {
147 common.data.integer.non-negative
148 }
149 embed.attrs.width =
150 attribute width {
151 common.data.integer.non-negative
152 }
153 embed.attrs.other = # REVISIT common.attrs
154 attribute local:* - ( src
155 | type
156 | height
157 | width
158 | id
159 | class
160 | title
161 | dir
162 | lang
163 | translate
164 | style
165 | tabindex
166 | contextmenu
167 | contenteditable
168 | draggable
169 | dropzone
170 | hidden
171 | onabort
172 | onblur
173 | oncanplay
174 | oncanplaythrough
175 | onchange
176 | onclick
177 | onclose
178 | oncontextmenu
179 | ondblclick
180 | ondrag
181 | ondragend
182 | ondragenter
183 | ondragleave
184 | ondragover
185 | ondragstart
186 | ondrop
187 | ondurationchange
188 | onemptied
189 | onended
190 | onerror
191 | onfocus
192 | oninput
193 | oninvalid
194 | onkeydown
195 | onkeypress
196 | onkeyup
197 | onload
198 | onloadeddata
199 | onloadedmetadata
200 | onloadstart
201 | onmousedown
202 | onmousemove
203 | onmouseout
204 | onmouseover
205 | onmouseup
206 | onmousewheel
207 | onpause
208 | onplay
209 | onplaying
210 | onprogress
211 | onratechange
212 | onreset
213 | onscroll
214 | onseeked
215 | onseeking
216 | onselect
217 | onshow
218 | onstalled
219 | onsubmit
220 | onsuspend
221 | ontimeupdate
222 | onvolumechange
223 | onwaiting
224 | onafterprint
225 | onbeforeprint
226 | onbeforeunload
227 | onhashchange
228 | onmessage
229 | onoffline
230 | ononline
231 | onpopstate
232 | onredo
233 | onresize
234 | onstorage
235 | onundo
236 | onunload
237 | role
238 | aria-atomic
239 | aria-busy
240 | aria-controls
241 | aria-describedby
242 | aria-disabled
243 | aria-dropeffect
244 | aria-expanded
245 | aria-flowto
246 | aria-grabbed
247 | aria-haspopup
248 | aria-hidden
249 | aria-invalid
250 | aria-label
251 | aria-labelledby
252 | aria-live
253 | aria-owns
254 | aria-relevant
255 | aria-required
256 | spellcheck
257 | accesskey
258 | itemref
259 | itemprop
260 | itemscope
261 | itemtype
262 | itemid
263 | name
264 | align
265 | about
266 | prefix
267 | property
268 | typeof
269 | vocab
270 | content
271 | datatype
272 | href
273 | rel
274 | resource
275 | rev
276 | inlist
277 | its-loc-note
278 | its-loc-note-type
279 | its-loc-note-ref
280 | its-term-info-ref
281 | its-term
282 | its-term-confidence
283 | its-within-text
284 | its-domain-mapping
285 | its-ta-confidence
286 | its-ta-class-ref
287 | its-ta-ident
288 | its-ta-ident-ref
289 | its-ta-source
290 | its-locale-filter-list
291 | its-locale-filter-type
292 | its-person
293 | its-person-ref
294 | its-org
295 | its-org-ref
296 | its-tool
297 | its-tool-ref
298 | its-rev-person
299 | its-rev-person-ref
300 | its-rev-org
301 | its-rev-org-ref
302 | its-rev-tool
303 | its-rev-tool-ref
304 | its-prov-ref
305 | its-provenance-records-ref
306 | its-loc-quality-issues-ref
307 | its-loc-quality-issue-type
308 | its-loc-quality-issue-comment
309 | its-loc-quality-issue-severity
310 | its-loc-quality-issue-profile-ref
311 | its-loc-quality-issue-enabled
312 | its-loc-quality-rating-score
313 | its-loc-quality-rating-vote
314 | its-loc-quality-rating-score-threshold
315 | its-loc-quality-rating-vote-threshold
316 | its-loc-quality-rating-profile-ref
317 | its-mt-confidence
318 | its-allowed-characters
319 | its-storage-size
320 | its-storage-encoding
321 | its-line-break-type
322 | its-annotators-ref
323 )
324 {
325 string
326 }
327 embed.inner =
328 empty
329
330 common.elem.phrasing |= embed.elem
331
332 ## Generic Objects: <object>
333
334 object.elem.flow =
335 element object { object.inner.flow & object.attrs }
336 object.elem.phrasing =
337 element object { object.inner.phrasing & object.attrs }
338 object.attrs =
339 ( common.attrs
340 & ( ( object.attrs.data
341 & object.attrs.type?
342 )
343 | object.attrs.type
344 )
345 & object.attrs.typemustmatch?
346 # & object.attrs.classid?
347 # & object.attrs.codebase?
348 # & object.attrs.codetype?
349 & object.attrs.height?
350 & object.attrs.width?
351 & object.attrs.usemap?
352 & object.attrs.name?
353 & common-form.attrs.form?
354 & ( common.attrs.aria.landmark.application
355 | common.attrs.aria.landmark.document
356 | common.attrs.aria.role.img
357 | common.attrs.aria.role.presentation
358 )?
359 )
360 object.attrs.data =
361 attribute data {
362 common.data.uri.non-empty
363 }
364 object.attrs.type =
365 attribute type {
366 common.data.mimetype
367 }
368 object.attrs.typemustmatch =
369 attribute typemustmatch {
370 w:string "typemustmatch" | w:string ""
371 } & v5only
372 object.attrs.height =
373 attribute height {
374 common.data.integer.non-negative
375 }
376 object.attrs.width =
377 attribute width {
378 common.data.integer.non-negative
379 }
380 object.attrs.usemap =
381 attribute usemap {
382 common.data.hash-name
383 }
384 object.attrs.name =
385 attribute name {
386 common.data.browsing-context
387 }
388 object.inner.flow =
389 ( param.elem*
390 , common.inner.transparent.flow
391 )
392 object.inner.phrasing =
393 ( param.elem*
394 , common.inner.phrasing
395 )
396
397 common.elem.flow |= object.elem.flow
398 common.elem.phrasing |= object.elem.phrasing
399
400 ## Initialization Parameters: <param>
401
402 param.elem =
403 element param { param.inner & param.attrs }
404 param.attrs =
405 ( common.attrs
406 & param.attrs.name
407 & param.attrs.value
408 & ( common.attrs.aria.role.presentation
409 | common.attrs.aria.role.menuitem
410 )?
411 )
412 param.attrs.name =
413 attribute name {
414 string
415 }
416 param.attrs.value =
417 attribute value {
418 string
419 }
420 param.inner =
421 ( empty )
422
423 ## Inline Frame: <iframe>
424
425 iframe.elem =
426 element iframe { iframe.inner & iframe.attrs }
427 iframe.attrs =
428 ( common.attrs
429 & iframe.attrs.src?
430 & iframe.attrs.srcdoc?
431 & iframe.attrs.name?
432 & iframe.attrs.width?
433 & iframe.attrs.height?
434 & iframe.attrs.sandbox?
435 & iframe.attrs.seamless?
436 & iframe.attrs.allowfullscreen?
437 & ( common.attrs.aria.landmark.application
438 | common.attrs.aria.landmark.document
439 | common.attrs.aria.role.img
440 | common.attrs.aria.role.presentation
441 )?
442 )
443 iframe.attrs.src =
444 attribute src {
445 common.data.uri.non-empty
446 }
447 iframe.attrs.srcdoc =
448 attribute srcdoc {
449 string #FIXME
450 }
451 iframe.attrs.name =
452 attribute name {
453 common.data.browsing-context
454 }
455 iframe.attrs.height =
456 attribute height {
457 common.data.integer.non-negative
458 }
459 iframe.attrs.width =
460 attribute width {
461 common.data.integer.non-negative
462 }
463 iframe.attrs.seamless =
464 attribute seamless {
465 w:string "seamless" | w:string ""
466 } & v5only
467 iframe.attrs.sandbox =
468 attribute sandbox
469 { list
470 { ( w:string "allow-top-navigation" )?
471 , ( w:string "allow-same-origin" )?
472 , ( w:string "allow-forms" )?
473 , ( w:string "allow-scripts" )?
474 }
475 | list
476 { ( w:string "allow-top-navigation" )?
477 , ( w:string "allow-same-origin" )?
478 , ( w:string "allow-scripts" )?
479 , ( w:string "allow-forms" )?
480 }
481 | list
482 { ( w:string "allow-top-navigation" )?
483 , ( w:string "allow-forms" )?
484 , ( w:string "allow-same-origin" )?
485 , ( w:string "allow-scripts" )?
486 }
487 | list
488 { ( w:string "allow-top-navigation" )?
489 , ( w:string "allow-forms" )?
490 , ( w:string "allow-scripts" )?
491 , ( w:string "allow-same-origin" )?
492 }
493 | list
494 { ( w:string "allow-top-navigation" )?
495 , ( w:string "allow-scripts" )?
496 , ( w:string "allow-same-origin" )?
497 , ( w:string "allow-forms" )?
498 }
499 | list
500 { ( w:string "allow-top-navigation" )?
501 , ( w:string "allow-scripts" )?
502 , ( w:string "allow-forms" )?
503 , ( w:string "allow-same-origin" )?
504 }
505 | list
506 { ( w:string "allow-same-origin" )?
507 , ( w:string "allow-top-navigation" )?
508 , ( w:string "allow-forms" )?
509 , ( w:string "allow-scripts" )?
510 }
511 | list
512 { ( w:string "allow-same-origin" )?
513 , ( w:string "allow-top-navigation" )?
514 , ( w:string "allow-scripts" )?
515 , ( w:string "allow-forms" )?
516 }
517 | list
518 { ( w:string "allow-forms" )?
519 , ( w:string "allow-top-navigation" )?
520 , ( w:string "allow-same-origin" )?
521 , ( w:string "allow-scripts" )?
522 }
523 | list
524 { ( w:string "allow-forms" )?
525 , ( w:string "allow-top-navigation" )?
526 , ( w:string "allow-scripts" )?
527 , ( w:string "allow-same-origin" )?
528 }
529 | list
530 { ( w:string "allow-scripts" )?
531 , ( w:string "allow-top-navigation" )?
532 , ( w:string "allow-same-origin" )?
533 , ( w:string "allow-forms" )?
534 }
535 | list
536 { ( w:string "allow-scripts" )?
537 , ( w:string "allow-top-navigation" )?
538 , ( w:string "allow-forms" )?
539 , ( w:string "allow-same-origin" )?
540 }
541 | list
542 { ( w:string "allow-same-origin" )?
543 , ( w:string "allow-forms" )?
544 , ( w:string "allow-top-navigation" )?
545 , ( w:string "allow-scripts" )?
546 }
547 | list
548 { ( w:string "allow-same-origin" )?
549 , ( w:string "allow-scripts" )?
550 , ( w:string "allow-top-navigation" )?
551 , ( w:string "allow-forms" )?
552 }
553 | list
554 { ( w:string "allow-forms" )?
555 , ( w:string "allow-same-origin" )?
556 , ( w:string "allow-top-navigation" )?
557 , ( w:string "allow-scripts" )?
558 }
559 | list
560 { ( w:string "allow-forms" )?
561 , ( w:string "allow-scripts" )?
562 , ( w:string "allow-top-navigation" )?
563 , ( w:string "allow-same-origin" )?
564 }
565 | list
566 { ( w:string "allow-scripts" )?
567 , ( w:string "allow-same-origin" )?
568 , ( w:string "allow-top-navigation" )?
569 , ( w:string "allow-forms" )?
570 }
571 | list
572 { ( w:string "allow-scripts" )?
573 , ( w:string "allow-forms" )?
574 , ( w:string "allow-top-navigation" )?
575 , ( w:string "allow-same-origin" )?
576 }
577 | list
578 { ( w:string "allow-same-origin" )?
579 , ( w:string "allow-forms" )?
580 , ( w:string "allow-scripts" )?
581 , ( w:string "allow-top-navigation" )?
582 }
583 | list
584 { ( w:string "allow-same-origin" )?
585 , ( w:string "allow-scripts" )?
586 , ( w:string "allow-forms" )?
587 , ( w:string "allow-top-navigation" )?
588 }
589 | list
590 { ( w:string "allow-forms" )?
591 , ( w:string "allow-same-origin" )?
592 , ( w:string "allow-scripts" )?
593 , ( w:string "allow-top-navigation" )?
594 }
595 | list
596 { ( w:string "allow-forms" )?
597 , ( w:string "allow-scripts" )?
598 , ( w:string "allow-same-origin" )?
599 , ( w:string "allow-top-navigation" )?
600 }
601 | list
602 { ( w:string "allow-scripts" )?
603 , ( w:string "allow-same-origin" )?
604 , ( w:string "allow-forms" )?
605 , ( w:string "allow-top-navigation" )?
606 }
607 | list
608 { ( w:string "allow-scripts" )?
609 , ( w:string "allow-forms" )?
610 , ( w:string "allow-same-origin" )?
611 , ( w:string "allow-top-navigation" )?
612 }
613 } & v5only
614 iframe.attrs.allowfullscreen =
615 attribute allowfullscreen {
616 w:string "allowfullscreen" | w:string ""
617 } & v5only
618 iframe.inner =
619 ( ( text & HTMLonly ) | empty )
620
621 common.elem.phrasing |= iframe.elem
622
623 #######################################################################
624 ## Image Maps
625
626 ## Map Definition: <map>
627
628 map.elem.flow =
629 element map { map.inner.flow & map.attrs }
630 map.elem.phrasing =
631 element map { map.inner.phrasing & map.attrs }
632 map.attrs =
633 ( common.attrs
634 & map.attrs.name
635 & ( common.attrs.aria.role.presentation
636 | common.attrs.aria.role.menuitem
637 )?
638 ) # REVISIT make id required in Schematron
639 map.attrs.name =
640 attribute name {
641 common.data.name
642 }
643 map.inner.flow =
644 ( common.inner.transparent.flow )
645 map.inner.phrasing =
646 ( common.inner.phrasing )
647
648 common.elem.flow |= map.elem.flow
649 common.elem.phrasing |= map.elem.phrasing
650
651 ## Map Area Definition: <area>
652
653 area.elem =
654 element area { area.inner & area.attrs }
655 area.attrs =
656 ( common.attrs.basic
657 & common.attrs.i18n
658 & common.attrs.present
659 & common.attrs.other
660 & shared-hyperlink.attrs.download?
661 & ( area.attrs.alt
662 & shared-hyperlink.attrs.href
663 )?
664 & shared-hyperlink.attrs.target?
665 & shared-hyperlink.attrs.ping?
666 & shared-hyperlink.attrs.rel?
667 & shared-hyperlink.attrs.hreflang?
668 & shared-hyperlink.attrs.type?
669 & area.attrs.shape?
670 & ( common.attrs.aria.role.link
671 | common.attrs.aria.role.presentation
672 | common.attrs.aria.role.menuitem
673 )?
674 )
675 area.attrs.alt =
676 attribute alt {
677 text
678 }
679 area.attrs.shape =
680 ( ( area.attrs.shape.rect? & area.attrs.coords.rect )
681 | ( area.attrs.shape.circle & area.attrs.coords.circle )
682 | ( area.attrs.shape.poly & area.attrs.coords.poly )
683 | ( area.attrs.shape.default )
684 )
685 area.attrs.shape.rect =
686 attribute shape {
687 w:string "rect"
688 }
689 area.attrs.coords.rect =
690 attribute coords {
691 w:rectangle
692 # xsd:token {
693 # pattern = "-?[0-9]+,-?[0-9]+,-?[0-9]+,-?[0-9]+"
694 # }
695 }
696 area.attrs.shape.circle =
697 attribute shape {
698 w:string "circle"
699 }
700 area.attrs.coords.circle =
701 attribute coords {
702 w:circle
703 # xsd:token {
704 # pattern = "-?[0-9]+,-?[0-9]+,[0-9]+"
705 # }
706 }
707 area.attrs.shape.poly =
708 attribute shape {
709 w:string "poly"
710 }
711 area.attrs.coords.poly =
712 attribute coords {
713 w:polyline
714 # xsd:token {
715 # pattern = "-?[0-9]+,-?[0-9]+,-?[0-9]+,-?[0-9]+,-?[0-9]+,-?[0-9]+(,-?[0-9]+,-?[0-9]+)*"
716 # }
717 }
718 area.attrs.shape.default =
719 attribute shape {
720 w:string "default"
721 }
722 area.inner =
723 ( empty )
724
725 common.elem.phrasing |= area.elem
726
727 ## Attributes Common to Embedded Content
728
729 embedded.content.attrs.crossorigin =
730 attribute crossorigin {
731 w:string "anonymous" | w:string "use-credentials" | w:string ""
732 } & v5only