]> code.delx.au - gnu-emacs-elpa/blob - embed.rnc
27b3ab63e5ddcaef2495fcfeead6b779d3ac394e
[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 common.data.sandbox-allow-list
470 } & v5only
471 iframe.attrs.allowfullscreen =
472 attribute allowfullscreen {
473 w:string "allowfullscreen" | w:string ""
474 } & v5only
475 iframe.inner =
476 ( ( text & HTMLonly ) | empty )
477
478 common.elem.phrasing |= iframe.elem
479
480 #######################################################################
481 ## Image Maps
482
483 ## Map Definition: <map>
484
485 map.elem.flow =
486 element map { map.inner.flow & map.attrs }
487 map.elem.phrasing =
488 element map { map.inner.phrasing & map.attrs }
489 map.attrs =
490 ( common.attrs
491 & map.attrs.name
492 & ( common.attrs.aria.role.presentation
493 | common.attrs.aria.role.menuitem
494 )?
495 ) # REVISIT make id required in Schematron
496 map.attrs.name =
497 attribute name {
498 common.data.name
499 }
500 map.inner.flow =
501 ( common.inner.transparent.flow )
502 map.inner.phrasing =
503 ( common.inner.phrasing )
504
505 common.elem.flow |= map.elem.flow
506 common.elem.phrasing |= map.elem.phrasing
507
508 ## Map Area Definition: <area>
509
510 area.elem =
511 element area { area.inner & area.attrs }
512 area.attrs =
513 ( common.attrs.basic
514 & common.attrs.i18n
515 & common.attrs.present
516 & common.attrs.other
517 & shared-hyperlink.attrs.download?
518 & ( area.attrs.alt
519 & shared-hyperlink.attrs.href
520 )?
521 & shared-hyperlink.attrs.target?
522 & shared-hyperlink.attrs.ping?
523 & shared-hyperlink.attrs.rel?
524 & shared-hyperlink.attrs.hreflang?
525 & shared-hyperlink.attrs.type?
526 & area.attrs.shape?
527 & ( common.attrs.aria.role.link
528 | common.attrs.aria.role.presentation
529 | common.attrs.aria.role.menuitem
530 )?
531 )
532 area.attrs.alt =
533 attribute alt {
534 text
535 }
536 area.attrs.shape =
537 ( ( area.attrs.shape.rect? & area.attrs.coords.rect )
538 | ( area.attrs.shape.circle & area.attrs.coords.circle )
539 | ( area.attrs.shape.poly & area.attrs.coords.poly )
540 | ( area.attrs.shape.default )
541 )
542 area.attrs.shape.rect =
543 attribute shape {
544 w:string "rect"
545 }
546 area.attrs.coords.rect =
547 attribute coords {
548 w:rectangle
549 # xsd:token {
550 # pattern = "-?[0-9]+,-?[0-9]+,-?[0-9]+,-?[0-9]+"
551 # }
552 }
553 area.attrs.shape.circle =
554 attribute shape {
555 w:string "circle"
556 }
557 area.attrs.coords.circle =
558 attribute coords {
559 w:circle
560 # xsd:token {
561 # pattern = "-?[0-9]+,-?[0-9]+,[0-9]+"
562 # }
563 }
564 area.attrs.shape.poly =
565 attribute shape {
566 w:string "poly"
567 }
568 area.attrs.coords.poly =
569 attribute coords {
570 w:polyline
571 # xsd:token {
572 # pattern = "-?[0-9]+,-?[0-9]+,-?[0-9]+,-?[0-9]+,-?[0-9]+,-?[0-9]+(,-?[0-9]+,-?[0-9]+)*"
573 # }
574 }
575 area.attrs.shape.default =
576 attribute shape {
577 w:string "default"
578 }
579 area.inner =
580 ( empty )
581
582 common.elem.phrasing |= area.elem
583
584 ## Attributes Common to Embedded Content
585
586 embedded.content.attrs.crossorigin =
587 attribute crossorigin {
588 w:string "anonymous" | w:string "use-credentials" | w:string ""
589 } & v5only