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
|
<?php
namespace AmpProject;
/** * Interface with constants for the different types of tags. * * @package ampproject/common */ interface Tag {
const A = 'a'; const AREA = 'area'; const BASE = 'base'; const BASEFONT = 'basefont'; const BGSOUND = 'bgsound'; const BODY = 'body'; const BR = 'br'; const COL = 'col'; const EMBED = 'embed'; const FIGCAPTION = 'figcaption'; const FIGURE = 'figure'; const FORM = 'form'; const FRAME = 'frame'; const HEAD = 'head'; const HR = 'hr'; const HTML = 'html'; const IMG = 'img'; const INPUT = 'input'; const KEYGEN = 'keygen'; const LINK = 'link'; const META = 'meta'; const NOSCRIPT = 'noscript'; const PARAM = 'param'; const SCRIPT = 'script'; const SOURCE = 'source'; const STYLE = 'style'; const TEMPLATE = 'template'; const TITLE = 'title'; const TRACK = 'track'; const WBR = 'wbr';
/** * HTML elements that are self-closing. * * @link https://www.w3.org/TR/html5/syntax.html#serializing-html-fragments * * @var string[] */ const SELF_CLOSING_TAGS = [ self::AREA, self::BASE, self::BASEFONT, self::BGSOUND, self::BR, self::COL, self::EMBED, self::FRAME, self::HR, self::IMG, self::INPUT, self::KEYGEN, self::LINK, self::META, self::PARAM, self::SOURCE, self::TRACK, self::WBR, ];
/** * List of elements allowed in head. * * @link https://github.com/ampproject/amphtml/blob/445d6e3be8a5063e2738c6f90fdcd57f2b6208be/validator/engine/htmlparser.js#L83-L100 * @link https://www.w3.org/TR/html5/document-metadata.html * * @var string[] */ const ELEMENTS_ALLOWED_IN_HEAD = [ self::TITLE, self::BASE, self::LINK, self::META, self::STYLE, self::NOSCRIPT, self::SCRIPT, ]; }
|