-
Notifications
You must be signed in to change notification settings - Fork 3.9k
/
validator-amp-selector.protoascii
126 lines (125 loc) · 3.44 KB
/
validator-amp-selector.protoascii
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#
# Copyright 2016 The AMP HTML Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS-IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the license.
#
tags: {
html_format: AMP
html_format: ACTIONS
tag_name: "SCRIPT"
extension_spec: {
name: "amp-selector"
version: "0.1"
version: "latest"
requires_usage: GRANDFATHERED
}
attr_lists: "common-extension-attrs"
}
tags: {
html_format: AMP4EMAIL
tag_name: "SCRIPT"
spec_name: "SCRIPT[custom-element=amp-selector] (AMP4EMAIL)"
extension_spec: {
name: "amp-selector"
version: "0.1"
version: "latest"
requires_usage: GRANDFATHERED
}
attr_lists: "common-extension-attrs"
}
tags: { # <amp-selector> for AMP (autoplay attribute allowed)
html_format: AMP
html_format: AMP4EMAIL
html_format: ACTIONS
tag_name: "AMP-SELECTOR"
disallowed_ancestor: "AMP-SELECTOR"
requires_extension: "amp-selector"
attrs: {
name: "disabled"
value: ""
}
attrs: { name: "form" }
attrs: {
name: "keyboard-select-mode"
value_casei: "focus"
value_casei: "none"
value_casei: "select"
}
attrs: {
name: "multiple"
value: ""
}
# <amp-bind>
attrs: { name: "[disabled]" }
attrs: { name: "[selected]" }
reference_points: {
tag_spec_name: "AMP-SELECTOR option"
}
reference_points: {
tag_spec_name: "AMP-SELECTOR child"
}
attr_lists: "extended-amp-global"
attr_lists: "name-attr"
amp_layout {
supported_layouts: FILL
supported_layouts: FIXED
supported_layouts: FIXED_HEIGHT
supported_layouts: NODISPLAY
supported_layouts: RESPONSIVE
supported_layouts: CONTAINER
}
}
# Reference Points apply only to direct children, and all direct children must
# match exactly one reference point. These two criteria don't fit naturally
# with <amp-selector> rules which apply to all descendant tags and don't
# require that all tags match the rule.
# Our appraoch here is two define two reference points. One is a child which
# has no additional requirements, so it always can match. The other is a child
# which has the amp-selector option attributes. The first of these can
# recursively contain either reference point beneath it.
# One small drawback here is that order matters. The list of reference points
# must first match against 'option' before 'child'. Since 'child' will
# always match, we want to prefer 'option' when both of them match.
tags: {
html_format: AMP
html_format: AMP4EMAIL
html_format: ACTIONS
tag_name: "$REFERENCE_POINT"
spec_name: "AMP-SELECTOR option"
attrs: {
name: "disabled"
value: ""
}
attrs: {
name: "option"
mandatory: true
}
attrs: {
name: "selected"
value: ""
}
spec_url: "https://www.ampproject.org/docs/reference/components/amp-selector"
}
tags: {
html_format: AMP
html_format: AMP4EMAIL
html_format: ACTIONS
tag_name: "$REFERENCE_POINT"
spec_name: "AMP-SELECTOR child"
reference_points: {
tag_spec_name: "AMP-SELECTOR option"
}
reference_points: {
tag_spec_name: "AMP-SELECTOR child"
}
}