-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✅ Validator rules for amp-video-iframe 1.0 (#34200)
- Loading branch information
1 parent
0c63a01
commit 4847034
Showing
3 changed files
with
211 additions
and
0 deletions.
There are no files selected for viewing
95 changes: 95 additions & 0 deletions
95
extensions/amp-video-iframe/1.0/test/validator-amp-video-iframe.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
<!-- | ||
Copyright 2021 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. | ||
--> | ||
<!-- | ||
Tests for amp-video-iframe tag version 1.0 | ||
--> | ||
<!DOCTYPE html> | ||
<html ⚡> | ||
<!-- prettier-ignore --> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>amp-video-iframe 1.0</title> | ||
<link rel="canonical" href="./"> | ||
<meta name="viewport" content="width=device-width,minimum-scale=1"> | ||
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript> | ||
<script async src="https://cdn.ampproject.org/v0.js"></script> | ||
<script async custom-element="amp-video-iframe" src="https://cdn.ampproject.org/v0/amp-video-iframe-1.0.js"></script> | ||
</head> | ||
<body> | ||
<!-- Valid --> | ||
<amp-video-iframe | ||
width="640" | ||
height="360" | ||
layout="responsive" | ||
src="https://foo.com" | ||
> | ||
</amp-video-iframe> | ||
|
||
<!-- Valid --> | ||
<amp-video-iframe | ||
width="640" | ||
height="360" | ||
layout="responsive" | ||
src="https://foo.com" | ||
poster="images/kitten-playing.png" | ||
> | ||
</amp-video-iframe> | ||
|
||
<!-- Invalid: Incorrect attribute value for autoplay --> | ||
<amp-video-iframe | ||
autoplay="true" | ||
layout="fill" | ||
width="300" | ||
height="500" | ||
src="https://foo.com" | ||
poster="images/kitten-playing.png" | ||
> | ||
</amp-video-iframe> | ||
|
||
<!-- Valid: correct attribute value for autoplay --> | ||
<amp-video-iframe | ||
autoplay | ||
layout="fill" | ||
width="300" | ||
height="500" | ||
src="https://foo.com" | ||
poster="images/kitten-playing.png" | ||
> | ||
</amp-video-iframe> | ||
|
||
<!-- Valid: Correct attribute value for rotate-to-fullscreen --> | ||
<amp-video-iframe | ||
rotate-to-fullscreen | ||
layout="fill" | ||
width="300" | ||
height="500" | ||
src="https://foo.com" | ||
poster="images/kitten-playing.png" | ||
> | ||
</amp-video-iframe> | ||
|
||
<!-- Invalid: Incorrect attribute value for rotate-to-fullscreen --> | ||
<amp-video-iframe | ||
rotate-to-fullscreen="true" | ||
layout="fill" | ||
width="300" | ||
height="500" | ||
src="https://foo.com" | ||
poster="images/kitten-playing.png" | ||
> | ||
</amp-video-iframe> | ||
</body> | ||
</html> |
100 changes: 100 additions & 0 deletions
100
extensions/amp-video-iframe/1.0/test/validator-amp-video-iframe.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
FAIL | ||
| <!-- | ||
| Copyright 2021 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. | ||
| --> | ||
| <!-- | ||
| Tests for amp-video-iframe tag version 1.0 | ||
| --> | ||
| <!DOCTYPE html> | ||
| <html ⚡> | ||
| <!-- prettier-ignore --> | ||
| <head> | ||
| <meta charset="utf-8"> | ||
| <title>amp-video-iframe 1.0</title> | ||
| <link rel="canonical" href="./"> | ||
| <meta name="viewport" content="width=device-width,minimum-scale=1"> | ||
| <style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript> | ||
| <script async src="https://cdn.ampproject.org/v0.js"></script> | ||
| <script async custom-element="amp-video-iframe" src="https://cdn.ampproject.org/v0/amp-video-iframe-1.0.js"></script> | ||
| </head> | ||
| <body> | ||
| <!-- Valid --> | ||
| <amp-video-iframe | ||
| width="640" | ||
| height="360" | ||
| layout="responsive" | ||
| src="https://foo.com" | ||
| > | ||
| </amp-video-iframe> | ||
| | ||
| <!-- Valid --> | ||
| <amp-video-iframe | ||
| width="640" | ||
| height="360" | ||
| layout="responsive" | ||
| src="https://foo.com" | ||
| poster="images/kitten-playing.png" | ||
| > | ||
| </amp-video-iframe> | ||
| | ||
| <!-- Invalid: Incorrect attribute value for autoplay --> | ||
| <amp-video-iframe | ||
>> ^~~~~~~~~ | ||
amp-video-iframe/1.0/test/validator-amp-video-iframe.html:52:4 The attribute 'autoplay' in tag 'amp-video-iframe' is set to the invalid value 'true'. (see https://amp.dev/documentation/components/amp-video-iframe/) | ||
| autoplay="true" | ||
| layout="fill" | ||
| width="300" | ||
| height="500" | ||
| src="https://foo.com" | ||
| poster="images/kitten-playing.png" | ||
| > | ||
| </amp-video-iframe> | ||
| | ||
| <!-- Valid: correct attribute value for autoplay --> | ||
| <amp-video-iframe | ||
| autoplay | ||
| layout="fill" | ||
| width="300" | ||
| height="500" | ||
| src="https://foo.com" | ||
| poster="images/kitten-playing.png" | ||
| > | ||
| </amp-video-iframe> | ||
| | ||
| <!-- Valid: Correct attribute value for rotate-to-fullscreen --> | ||
| <amp-video-iframe | ||
| rotate-to-fullscreen | ||
| layout="fill" | ||
| width="300" | ||
| height="500" | ||
| src="https://foo.com" | ||
| poster="images/kitten-playing.png" | ||
| > | ||
| </amp-video-iframe> | ||
| | ||
| <!-- Invalid: Incorrect attribute value for rotate-to-fullscreen --> | ||
| <amp-video-iframe | ||
>> ^~~~~~~~~ | ||
amp-video-iframe/1.0/test/validator-amp-video-iframe.html:85:4 The attribute 'rotate-to-fullscreen' in tag 'amp-video-iframe' is set to the invalid value 'true'. (see https://amp.dev/documentation/components/amp-video-iframe/) | ||
| rotate-to-fullscreen="true" | ||
| layout="fill" | ||
| width="300" | ||
| height="500" | ||
| src="https://foo.com" | ||
| poster="images/kitten-playing.png" | ||
| > | ||
| </amp-video-iframe> | ||
| </body> | ||
| </html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters