]> code.delx.au - gnu-emacs-elpa/blob - packages/html5-schema/embed.rnc
Merge commit '0cda39255827f283e7578cd469ae42daad9556a2' from js2-mode
[gnu-emacs-elpa] / packages / html5-schema / 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 | onautocomplete
173 | onautocompleteerror
174 | onblur
175 | oncancel
176 | oncanplay
177 | oncanplaythrough
178 | onchange
179 | onclick
180 | onclose
181 | oncontextmenu
182 | oncuechange
183 | ondblclick
184 | ondrag
185 | ondragend
186 | ondragenter
187 | ondragexit
188 | ondragleave
189 | ondragover
190 | ondragstart
191 | ondrop
192 | ondurationchange
193 | onemptied
194 | onended
195 | onerror
196 | onfocus
197 | oninput
198 | oninvalid
199 | onkeydown
200 | onkeypress
201 | onkeyup
202 | onload
203 | onloadeddata
204 | onloadedmetadata
205 | onloadstart
206 | onmousedown
207 | onmouseenter
208 | onmouseleave
209 | onmousemove
210 | onmouseout
211 | onmouseover
212 | onmouseup
213 | onwheel
214 | onpause
215 | onplay
216 | onplaying
217 | onprogress
218 | onratechange
219 | onreset
220 | onresize
221 | onscroll
222 | onseeked
223 | onseeking
224 | onselect
225 | onshow
226 | onsort
227 | onstalled
228 | onsubmit
229 | onsuspend
230 | ontimeupdate
231 | ontoggle
232 | onvolumechange
233 | onwaiting
234 | role
235 | aria-atomic
236 | aria-busy
237 | aria-controls
238 | aria-describedby
239 | aria-disabled
240 | aria-dropeffect
241 | aria-expanded
242 | aria-flowto
243 | aria-grabbed
244 | aria-haspopup
245 | aria-hidden
246 | aria-invalid
247 | aria-label
248 | aria-labelledby
249 | aria-live
250 | aria-owns
251 | aria-relevant
252 | aria-required
253 | spellcheck
254 | accesskey
255 | itemref
256 | itemprop
257 | itemscope
258 | itemtype
259 | itemid
260 | name
261 | align
262 | about
263 | prefix
264 | property
265 | typeof
266 | vocab
267 | content
268 | datatype
269 | href
270 | rel
271 | resource
272 | rev
273 | inlist
274 | its-loc-note
275 | its-loc-note-type
276 | its-loc-note-ref
277 | its-term-info-ref
278 | its-term
279 | its-term-confidence
280 | its-within-text
281 | its-domain-mapping
282 | its-ta-confidence
283 | its-ta-class-ref
284 | its-ta-ident
285 | its-ta-ident-ref
286 | its-ta-source
287 | its-locale-filter-list
288 | its-locale-filter-type
289 | its-person
290 | its-person-ref
291 | its-org
292 | its-org-ref
293 | its-tool
294 | its-tool-ref
295 | its-rev-person
296 | its-rev-person-ref
297 | its-rev-org
298 | its-rev-org-ref
299 | its-rev-tool
300 | its-rev-tool-ref
301 | its-prov-ref
302 | its-provenance-records-ref
303 | its-loc-quality-issues-ref
304 | its-loc-quality-issue-type
305 | its-loc-quality-issue-comment
306 | its-loc-quality-issue-severity
307 | its-loc-quality-issue-profile-ref
308 | its-loc-quality-issue-enabled
309 | its-loc-quality-rating-score
310 | its-loc-quality-rating-vote
311 | its-loc-quality-rating-score-threshold
312 | its-loc-quality-rating-vote-threshold
313 | its-loc-quality-rating-profile-ref
314 | its-mt-confidence
315 | its-allowed-characters
316 | its-storage-size
317 | its-storage-encoding
318 | its-line-break-type
319 | its-annotators-ref
320 )
321 {
322 string
323 }
324 embed.inner =
325 empty
326
327 common.elem.phrasing |= embed.elem
328
329 ## Generic Objects: <object>
330
331 object.elem.flow =
332 element object { object.inner.flow & object.attrs }
333 object.elem.phrasing =
334 element object { object.inner.phrasing & object.attrs }
335 object.attrs =
336 ( common.attrs
337 & ( ( object.attrs.data
338 & object.attrs.type?
339 )
340 | object.attrs.type
341 )
342 & object.attrs.typemustmatch?
343 # & object.attrs.classid?
344 # & object.attrs.codebase?
345 # & object.attrs.codetype?
346 & object.attrs.height?
347 & object.attrs.width?
348 & object.attrs.usemap?
349 & object.attrs.name?
350 & common-form.attrs.form?
351 & ( common.attrs.aria.landmark.application
352 | common.attrs.aria.landmark.document
353 | common.attrs.aria.role.img
354 | common.attrs.aria.role.presentation
355 )?
356 )
357 object.attrs.data =
358 attribute data {
359 common.data.uri.non-empty
360 }
361 object.attrs.type =
362 attribute type {
363 common.data.mimetype
364 }
365 object.attrs.typemustmatch =
366 attribute typemustmatch {
367 w:string "typemustmatch" | w:string ""
368 } & v5only
369 object.attrs.height =
370 attribute height {
371 common.data.integer.non-negative
372 }
373 object.attrs.width =
374 attribute width {
375 common.data.integer.non-negative
376 }
377 object.attrs.usemap =
378 attribute usemap {
379 common.data.hash-name
380 }
381 object.attrs.name =
382 attribute name {
383 common.data.browsing-context
384 }
385 object.inner.flow =
386 ( param.elem*
387 , common.inner.transparent.flow
388 )
389 object.inner.phrasing =
390 ( param.elem*
391 , common.inner.phrasing
392 )
393
394 common.elem.flow |= object.elem.flow
395 common.elem.phrasing |= object.elem.phrasing
396
397 ## Initialization Parameters: <param>
398
399 param.elem =
400 element param { param.inner & param.attrs }
401 param.attrs =
402 ( common.attrs
403 & param.attrs.name
404 & param.attrs.value
405 & ( common.attrs.aria.role.presentation
406 | common.attrs.aria.role.menuitem
407 )?
408 )
409 param.attrs.name =
410 attribute name {
411 string
412 }
413 param.attrs.value =
414 attribute value {
415 string
416 }
417 param.inner =
418 ( empty )
419
420 ## Inline Frame: <iframe>
421
422 iframe.elem =
423 element iframe { iframe.inner & iframe.attrs }
424 iframe.attrs =
425 ( common.attrs
426 & iframe.attrs.src?
427 & iframe.attrs.srcdoc?
428 & iframe.attrs.name?
429 & iframe.attrs.width?
430 & iframe.attrs.height?
431 & iframe.attrs.sandbox?
432 & iframe.attrs.seamless?
433 & iframe.attrs.allowfullscreen?
434 & ( common.attrs.aria.landmark.application
435 | common.attrs.aria.landmark.document
436 | common.attrs.aria.role.img
437 | common.attrs.aria.role.presentation
438 )?
439 )
440 iframe.attrs.src =
441 attribute src {
442 common.data.uri.non-empty
443 }
444 iframe.attrs.srcdoc =
445 attribute srcdoc {
446 string #FIXME
447 }
448 iframe.attrs.name =
449 attribute name {
450 common.data.browsing-context
451 }
452 iframe.attrs.height =
453 attribute height {
454 common.data.integer.non-negative
455 }
456 iframe.attrs.width =
457 attribute width {
458 common.data.integer.non-negative
459 }
460 iframe.attrs.seamless =
461 attribute seamless {
462 w:string "seamless" | w:string ""
463 } & v5only
464 iframe.attrs.sandbox =
465 attribute sandbox {
466 common.data.sandbox-allow-list
467 } & v5only
468 iframe.attrs.allowfullscreen =
469 attribute allowfullscreen {
470 w:string "allowfullscreen" | w:string ""
471 } & v5only
472 iframe.inner =
473 ( ( text & HTMLonly ) | empty )
474
475 common.elem.phrasing |= iframe.elem
476
477 #######################################################################
478 ## Image Maps
479
480 ## Map Definition: <map>
481
482 map.elem.flow =
483 element map { map.inner.flow & map.attrs }
484 map.elem.phrasing =
485 element map { map.inner.phrasing & map.attrs }
486 map.attrs =
487 ( common.attrs
488 & map.attrs.name
489 & ( common.attrs.aria.role.presentation
490 | common.attrs.aria.role.menuitem
491 )?
492 ) # REVISIT make id required in Schematron
493 map.attrs.name =
494 attribute name {
495 common.data.name
496 }
497 map.inner.flow =
498 ( common.inner.transparent.flow )
499 map.inner.phrasing =
500 ( common.inner.phrasing )
501
502 common.elem.flow |= map.elem.flow
503 common.elem.phrasing |= map.elem.phrasing
504
505 ## Map Area Definition: <area>
506
507 area.elem =
508 element area { area.inner & area.attrs }
509 area.attrs =
510 ( common.attrs.basic
511 & common.attrs.i18n
512 & common.attrs.present
513 & common.attrs.other
514 & shared-hyperlink.attrs.download?
515 & ( area.attrs.alt
516 & shared-hyperlink.attrs.href
517 )?
518 & shared-hyperlink.attrs.target?
519 & shared-hyperlink.attrs.ping?
520 & shared-hyperlink.attrs.rel?
521 & shared-hyperlink.attrs.hreflang?
522 & shared-hyperlink.attrs.type?
523 & area.attrs.shape?
524 & ( common.attrs.aria.role.link
525 | common.attrs.aria.role.presentation
526 | common.attrs.aria.role.menuitem
527 )?
528 )
529 area.attrs.alt =
530 attribute alt {
531 text
532 }
533 area.attrs.shape =
534 ( ( area.attrs.shape.rect? & area.attrs.coords.rect )
535 | ( area.attrs.shape.circle & area.attrs.coords.circle )
536 | ( area.attrs.shape.poly & area.attrs.coords.poly )
537 | ( area.attrs.shape.default )
538 )
539 area.attrs.shape.rect =
540 attribute shape {
541 w:string "rect"
542 }
543 area.attrs.coords.rect =
544 attribute coords {
545 w:rectangle
546 # xsd:token {
547 # pattern = "-?[0-9]+,-?[0-9]+,-?[0-9]+,-?[0-9]+"
548 # }
549 }
550 area.attrs.shape.circle =
551 attribute shape {
552 w:string "circle"
553 }
554 area.attrs.coords.circle =
555 attribute coords {
556 w:circle
557 # xsd:token {
558 # pattern = "-?[0-9]+,-?[0-9]+,[0-9]+"
559 # }
560 }
561 area.attrs.shape.poly =
562 attribute shape {
563 w:string "poly"
564 }
565 area.attrs.coords.poly =
566 attribute coords {
567 w:polyline
568 # xsd:token {
569 # pattern = "-?[0-9]+,-?[0-9]+,-?[0-9]+,-?[0-9]+,-?[0-9]+,-?[0-9]+(,-?[0-9]+,-?[0-9]+)*"
570 # }
571 }
572 area.attrs.shape.default =
573 attribute shape {
574 w:string "default"
575 }
576 area.inner =
577 ( empty )
578
579 common.elem.phrasing |= area.elem
580
581 ## Attributes Common to Embedded Content
582
583 embedded.content.attrs.crossorigin =
584 attribute crossorigin {
585 w:string "anonymous" | w:string "use-credentials" | w:string ""
586 } & v5only