Skip to content

Commit

Permalink
Story supports-landscape attribute validation. (ampproject#19872)
Browse files Browse the repository at this point in the history
* Story supports-landscape attribute validation.

* A-Z
  • Loading branch information
gmajoulet authored and cathyxz committed Dec 17, 2018
1 parent 1ca16d2 commit 9557315
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!--
Copyright 2018 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.
-->
<!--
Test Description:
Tests for the supports-landscape attribute.
-->
<!doctype html>
<html >
<head>
<meta charset="utf-8">
<script async src="https://cdn.ampproject.org/v0.js"></script>
<script async custom-element="amp-story" src="https://cdn.ampproject.org/v0/amp-story-1.0.js"></script>
<title>My Story</title>
<meta name="description" content="Get started with amp-story">
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<link rel="canonical" href="grid-layer-templates.html">
<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>
</head>
<body>
<amp-story standalone title="Foo" publisher="AMP" publisher-logo-src="http://example.com/foo.png" poster-portrait-src="http://example.com/foo.png" supports-landscape>
<amp-story-page id="cover">
<amp-story-grid-layer template="vertical">
<h1>Story!</h1>
</amp-story-grid-layer>
</amp-story-page>

<amp-story-page id="page1">
<amp-story-grid-layer template="fill">
<h1>Oh hi!</h1>
</amp-story-grid-layer>
</amp-story-page>
</amp-story>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
PASS
| <!--
| Copyright 2018 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.
| -->
| <!--
| Test Description:
| Tests for the supports-landscape attribute.
| -->
| <!doctype html>
| <html ⚡>
| <head>
| <meta charset="utf-8">
| <script async src="https://cdn.ampproject.org/v0.js"></script>
| <script async custom-element="amp-story" src="https://cdn.ampproject.org/v0/amp-story-1.0.js"></script>
| <title>My Story</title>
| <meta name="description" content="Get started with amp-story">
| <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
| <link rel="canonical" href="grid-layer-templates.html">
| <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>
| </head>
| <body>
| <amp-story standalone title="Foo" publisher="AMP" publisher-logo-src="http://example.com/foo.png" poster-portrait-src="http://example.com/foo.png" supports-landscape>
| <amp-story-page id="cover">
| <amp-story-grid-layer template="vertical">
| <h1>Story!</h1>
| </amp-story-grid-layer>
| </amp-story-page>
|
| <amp-story-page id="page1">
| <amp-story-grid-layer template="fill">
| <h1>Oh hi!</h1>
| </amp-story-grid-layer>
| </amp-story-page>
| </amp-story>
| </body>
| </html>
4 changes: 4 additions & 0 deletions extensions/amp-story/validator-amp-story.protoascii
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ tags: { # <amp-story>
mandatory: true
value: ""
}
attrs: {
name: "supports-landscape"
value: ""
}
attrs: {
name: "title"
mandatory: true
Expand Down

0 comments on commit 9557315

Please sign in to comment.