Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the new boilerplate (spec file change + also_requires feature). #1345

Merged
merged 1 commit into from
Jan 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions validator/testdata/feature_tests/amp_identification_missing.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!--
Copyright 2015 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:
The only thing that's wrong with this AMP doc is that it is not identifying
itself as AMP.
-->
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link rel="canonical" href="./regular-html-version.html" />
<meta name="viewport" content="width=device-width,minimum-scale=1">
<style>body {opacity: 0}</style><noscript><style>body {opacity: 1}</style></noscript>
<script async src="https://cdn.ampproject.org/v0.js"></script>
</head>
<body>
Hello, world.
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FAIL
feature_tests/amp_identification_missing.html:22:0 MANDATORY_ATTR_MISSING ⚡ (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#ampd)
feature_tests/amp_identification_missing.html:33:7 MANDATORY_TAG_MISSING html ⚡ for top-level html (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#ampd)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FAIL
feature_tests/duplicate_unique_tags_and_wrong_parents.html:31:2 DUPLICATE_UNIQUE_TAG author stylesheet (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#stylesheets)
feature_tests/duplicate_unique_tags_and_wrong_parents.html:35:0 DISALLOWED_ATTR amp-custom (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#opacity)
feature_tests/duplicate_unique_tags_and_wrong_parents.html:35:0 WRONG_PARENT_TAG body > style (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#opacity)
feature_tests/duplicate_unique_tags_and_wrong_parents.html:35:0 DISALLOWED_ATTR amp-custom (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#boilerplate)
feature_tests/duplicate_unique_tags_and_wrong_parents.html:35:0 WRONG_PARENT_TAG body > style (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#boilerplate)
6 changes: 3 additions & 3 deletions validator/testdata/feature_tests/empty.out
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ feature_tests/empty.html:1:0 MANDATORY_TAG_MISSING html ⚡ for top-level html (
feature_tests/empty.html:1:0 MANDATORY_TAG_MISSING head (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#crps)
feature_tests/empty.html:1:0 MANDATORY_TAG_MISSING charset utf-8 declaration (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#chrs)
feature_tests/empty.html:1:0 MANDATORY_TAG_MISSING viewport declaration (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#vprt)
feature_tests/empty.html:1:0 MANDATORY_TAG_MISSING mandatory style (js enabled) opacity 0 (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#opacity)
feature_tests/empty.html:1:0 MANDATORY_TAG_MISSING mandatory style (noscript) opacity 1 (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#opacity)
feature_tests/empty.html:1:0 MANDATORY_TAG_MISSING noscript enclosure for mandatory style (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#opacity)
feature_tests/empty.html:1:0 MANDATORY_TAG_MISSING noscript enclosure for mandatory style (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#boilerplate)
feature_tests/empty.html:1:0 MANDATORY_TAG_MISSING body (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#crps)
feature_tests/empty.html:1:0 MANDATORY_TAG_MISSING amphtml engine v0.js script (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#scrpt)
feature_tests/empty.html:1:0 MANDATORY_TAG_MISSING mandatory boilerplate (js enabled) (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#boilerplate)
feature_tests/empty.html:1:0 MANDATORY_TAG_MISSING mandatory boilerplate (noscript) (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#boilerplate)
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FAIL
feature_tests/incorrect_mandatory_style.html:28:2 MANDATORY_CDATA_MISSING_OR_INCORRECT mandatory style (js enabled) opacity 0 (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#opacity)
feature_tests/incorrect_mandatory_style.html:28:74 MANDATORY_CDATA_MISSING_OR_INCORRECT mandatory style (noscript) opacity 1 (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#opacity)
feature_tests/incorrect_mandatory_style.html:28:2 MANDATORY_CDATA_MISSING_OR_INCORRECT mandatory boilerplate (js enabled) - old variant (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#boilerplate)
feature_tests/incorrect_mandatory_style.html:28:74 MANDATORY_CDATA_MISSING_OR_INCORRECT mandatory boilerplate (noscript) - old variant (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#boilerplate)
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!--
Copyright 2015 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:
This test contains the new boilerplate in the javascript-enabled version
but the old, opacity-based one inside noscript. This is not allowed.
-->
<!doctype html>
<html ⚡>
<head>
<meta charset="utf-8">
<link rel="canonical" href="./regular-html-version.html" />
<meta name="viewport" content="width=device-width,minimum-scale=1">
<style amp-boilerplate>body{-webkit-animation:-amp-start 1s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 1s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 1s steps(1,end) 0s 1 normal both;animation:-amp-start 1s 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>body {opacity: 1}</style></noscript>
<script async src="https://cdn.ampproject.org/v0.js"></script>
</head>
<body>
Hello, world.
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FAIL
feature_tests/new_and_old_boilerplate_mixed.html:34:7 MANDATORY_TAG_MISSING mandatory boilerplate (noscript) required by mandatory boilerplate (js enabled) (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#boilerplate)
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!--
Copyright 2015 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:
This test contains the old, opacity-based boilerplate in the
javascript-enabled version, but the new one inside noscript. This is
not allowed.
-->
<!doctype html>
<html ⚡>
<head>
<meta charset="utf-8">
<link rel="canonical" href="./regular-html-version.html" />
<meta name="viewport" content="width=device-width,minimum-scale=1">
<style>body {opacity: 0}</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>
</head>
<body>
Hello, world.
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FAIL
feature_tests/new_and_old_boilerplate_mixed2.html:35:7 MANDATORY_TAG_MISSING mandatory boilerplate (js enabled) required by mandatory boilerplate (noscript) (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#boilerplate)
34 changes: 34 additions & 0 deletions validator/testdata/feature_tests/new_boilerplate.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!--
Copyright 2015 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:
This is the minimum valid AMP document; it includes all of the required
fields from the spec, but nothing else. This test exercises the new
amp boilerplate.
-->
<!doctype html>
<html ⚡>
<head>
<meta charset="utf-8">
<link rel="canonical" href="./regular-html-version.html" />
<meta name="viewport" content="width=device-width,minimum-scale=1">
<style amp-boilerplate>body{-webkit-animation:-amp-start 1s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 1s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 1s steps(1,end) 0s 1 normal both;animation:-amp-start 1s 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>
</head>
<body>
Hello, world.
</body>
</html>
1 change: 1 addition & 0 deletions validator/testdata/feature_tests/new_boilerplate.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PASS
2 changes: 1 addition & 1 deletion validator/testdata/feature_tests/regexps.out
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FAIL
feature_tests/regexps.html:27:2 MANDATORY_CDATA_MISSING_OR_INCORRECT mandatory style (js enabled) opacity 0 (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#opacity)
feature_tests/regexps.html:27:2 MANDATORY_CDATA_MISSING_OR_INCORRECT mandatory boilerplate (js enabled) - old variant (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#boilerplate)
feature_tests/regexps.html:37:2 INVALID_ATTR_VALUE rel=stylesheet (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#canon)
feature_tests/regexps.html:47:2 INVALID_ATTR_VALUE rel=foo (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#canon)
feature_tests/regexps.html:48:2 INVALID_ATTR_VALUE rel=accessibility foo (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#canon)
Expand Down
Loading