Permalink
Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
127 lines (125 sloc) 3.46 KB
#
# 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: EXPERIMENTAL
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: EXPERIMENTAL
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: "input-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: EXPERIMENTAL
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: EXPERIMENTAL
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"
}
}