OCaml HTML5 parser/serialiser based on Python's JustHTML
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 34 lines 1.2 kB view raw
1(*--------------------------------------------------------------------------- 2 Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved. 3 SPDX-License-Identifier: MIT 4 ---------------------------------------------------------------------------*) 5 6(** Source element context validation checker. 7 8 This checker validates that [<source>] element attributes are appropriate 9 for the parent context. The allowed attributes differ based on whether 10 the source is inside [<picture>], [<video>], or [<audio>]. 11 12 {2 Context-Dependent Rules} 13 14 In [<picture>] context: 15 - [srcset] is required 16 - [src] is not allowed 17 - [media] and [type] are allowed 18 19 In [<video>] or [<audio>] context: 20 - [src] is required 21 - [srcset] and [sizes] are not allowed 22 - [type] is allowed for MIME type hints 23 24 {2 Error Messages} 25 26 - Missing required attributes for the context 27 - Attributes not allowed in the current context 28 29 @see <https://html.spec.whatwg.org/multipage/embedded-content.html#the-source-element> 30 HTML Standard: The source element 31*) 32 33val checker : Checker.t 34(** The source element context checker instance. *)