Skip to content

Commit

Permalink
Validator rollup (#35882)
Browse files Browse the repository at this point in the history
* cl/392962279 Allow style in noscript.

* cl/393187930 Make no-js case valid.

* cl/393885470 Remove notice from CSS/Doc length tests.

Co-authored-by: Greg Grothaus <greggrothaus@google.com>
Co-authored-by: honeybadgerdontcare <sedano@google.com>
  • Loading branch information
3 people committed Aug 31, 2021
1 parent 15e6718 commit 733b0b8
Show file tree
Hide file tree
Showing 50 changed files with 462 additions and 480 deletions.
2 changes: 1 addition & 1 deletion validator/js/engine/validator.js
Expand Up @@ -3827,7 +3827,7 @@ function getLayoutSizeDefinedClass() {
* @return {string}
*/
function getLayoutAwaitingSizeClass() {
return "i-amphtml-layout-awaiting-size";
return 'i-amphtml-layout-awaiting-size';
}

/**
Expand Down
54 changes: 27 additions & 27 deletions validator/js/engine/validator_test.js

Large diffs are not rendered by default.

15 changes: 0 additions & 15 deletions validator/testdata/amp4ads_feature_tests/css_length.html
@@ -1,18 +1,3 @@
<!--
Copyright 2020 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 testcase isn't run verbatim. The template string below is replaced by
Expand Down
15 changes: 0 additions & 15 deletions validator/testdata/amp4ads_feature_tests/css_length.out
@@ -1,20 +1,5 @@
PASS
| <!--
| Copyright 2020 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 testcase isn't run verbatim. The template string below is replaced by
| the test harnesses with various lengths of valid CSS stylesheets. We use
Expand Down
15 changes: 0 additions & 15 deletions validator/testdata/amp4ads_feature_tests/style-amp-custom.html
@@ -1,18 +1,3 @@
<!--
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 tests CSS style rules specific to A4A which differ from AMP.
Expand Down
35 changes: 10 additions & 25 deletions validator/testdata/amp4ads_feature_tests/style-amp-custom.out
@@ -1,20 +1,5 @@
FAIL
| <!--
| 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 tests CSS style rules specific to A4A which differ from AMP.
| -->
Expand Down Expand Up @@ -56,7 +41,7 @@ FAIL
| .amp-animate .box {
| transition: background-color 2s;
>> ^~~~~~~~~
amp4ads_feature_tests/style-amp-custom.html:56:6 CSS syntax error in tag 'style amp-custom' - the property 'transition' is set to the disallowed value 'background-color'. Allowed values: ['opacity', 'transform'].
amp4ads_feature_tests/style-amp-custom.html:41:6 CSS syntax error in tag 'style amp-custom' - the property 'transition' is set to the disallowed value 'background-color'. Allowed values: ['opacity', 'transform'].
| }
|
| /* Valid. */
Expand All @@ -75,19 +60,19 @@ amp4ads_feature_tests/style-amp-custom.html:56:6 CSS syntax error in tag 'style
| from {
| margin-left:100%;
>> ^~~~~~~~~
amp4ads_feature_tests/style-amp-custom.html:73:8 CSS syntax error in tag 'style amp-custom' - the property 'margin-left' is disallowed within @keyframes. Allowed properties: ['animation-timing-function', 'opacity', 'transform'].
amp4ads_feature_tests/style-amp-custom.html:58:8 CSS syntax error in tag 'style amp-custom' - the property 'margin-left' is disallowed within @keyframes. Allowed properties: ['animation-timing-function', 'opacity', 'transform'].
| width:300%
>> ^~~~~~~~~
amp4ads_feature_tests/style-amp-custom.html:74:8 CSS syntax error in tag 'style amp-custom' - the property 'width' is disallowed within @keyframes. Allowed properties: ['animation-timing-function', 'opacity', 'transform'].
amp4ads_feature_tests/style-amp-custom.html:59:8 CSS syntax error in tag 'style amp-custom' - the property 'width' is disallowed within @keyframes. Allowed properties: ['animation-timing-function', 'opacity', 'transform'].
| }
|
| to {
| margin-left:0%;
>> ^~~~~~~~~
amp4ads_feature_tests/style-amp-custom.html:78:8 CSS syntax error in tag 'style amp-custom' - the property 'margin-left' is disallowed within @keyframes. Allowed properties: ['animation-timing-function', 'opacity', 'transform'].
amp4ads_feature_tests/style-amp-custom.html:63:8 CSS syntax error in tag 'style amp-custom' - the property 'margin-left' is disallowed within @keyframes. Allowed properties: ['animation-timing-function', 'opacity', 'transform'].
| width:100%;
>> ^~~~~~~~~
amp4ads_feature_tests/style-amp-custom.html:79:8 CSS syntax error in tag 'style amp-custom' - the property 'width' is disallowed within @keyframes. Allowed properties: ['animation-timing-function', 'opacity', 'transform'].
amp4ads_feature_tests/style-amp-custom.html:64:8 CSS syntax error in tag 'style amp-custom' - the property 'width' is disallowed within @keyframes. Allowed properties: ['animation-timing-function', 'opacity', 'transform'].
| }
| }
|
Expand Down Expand Up @@ -122,7 +107,7 @@ amp4ads_feature_tests/style-amp-custom.html:79:8 CSS syntax error in tag 'style
| .amp-animate .box {
| -moz-transition: background-color 2s;
>> ^~~~~~~~~
amp4ads_feature_tests/style-amp-custom.html:112:6 CSS syntax error in tag 'style amp-custom' - the property 'transition' is set to the disallowed value 'background-color'. Allowed values: ['opacity', 'transform'].
amp4ads_feature_tests/style-amp-custom.html:97:6 CSS syntax error in tag 'style amp-custom' - the property 'transition' is set to the disallowed value 'background-color'. Allowed values: ['opacity', 'transform'].
| }
|
| /* Valid. */
Expand All @@ -141,19 +126,19 @@ amp4ads_feature_tests/style-amp-custom.html:112:6 CSS syntax error in tag 'style
| from {
| margin-left:100%;
>> ^~~~~~~~~
amp4ads_feature_tests/style-amp-custom.html:129:8 CSS syntax error in tag 'style amp-custom' - the property 'margin-left' is disallowed within @-o-keyframes. Allowed properties: ['animation-timing-function', 'opacity', 'transform'].
amp4ads_feature_tests/style-amp-custom.html:114:8 CSS syntax error in tag 'style amp-custom' - the property 'margin-left' is disallowed within @-o-keyframes. Allowed properties: ['animation-timing-function', 'opacity', 'transform'].
| width:300%
>> ^~~~~~~~~
amp4ads_feature_tests/style-amp-custom.html:130:8 CSS syntax error in tag 'style amp-custom' - the property 'width' is disallowed within @-o-keyframes. Allowed properties: ['animation-timing-function', 'opacity', 'transform'].
amp4ads_feature_tests/style-amp-custom.html:115:8 CSS syntax error in tag 'style amp-custom' - the property 'width' is disallowed within @-o-keyframes. Allowed properties: ['animation-timing-function', 'opacity', 'transform'].
| }
|
| to {
| margin-left:0%;
>> ^~~~~~~~~
amp4ads_feature_tests/style-amp-custom.html:134:8 CSS syntax error in tag 'style amp-custom' - the property 'margin-left' is disallowed within @-o-keyframes. Allowed properties: ['animation-timing-function', 'opacity', 'transform'].
amp4ads_feature_tests/style-amp-custom.html:119:8 CSS syntax error in tag 'style amp-custom' - the property 'margin-left' is disallowed within @-o-keyframes. Allowed properties: ['animation-timing-function', 'opacity', 'transform'].
| width:100%;
>> ^~~~~~~~~
amp4ads_feature_tests/style-amp-custom.html:135:8 CSS syntax error in tag 'style amp-custom' - the property 'width' is disallowed within @-o-keyframes. Allowed properties: ['animation-timing-function', 'opacity', 'transform'].
amp4ads_feature_tests/style-amp-custom.html:120:8 CSS syntax error in tag 'style amp-custom' - the property 'width' is disallowed within @-o-keyframes. Allowed properties: ['animation-timing-function', 'opacity', 'transform'].
| }
| }
| </style>
Expand Down
15 changes: 0 additions & 15 deletions validator/testdata/amp4email_feature_tests/css_length.html
@@ -1,18 +1,3 @@
<!--
Copyright 2020 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 testcase isn't run verbatim. The template string below is replaced by
Expand Down
17 changes: 1 addition & 16 deletions validator/testdata/amp4email_feature_tests/css_length.out
@@ -1,20 +1,5 @@
PASS
| <!--
| Copyright 2020 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 testcase isn't run verbatim. The template string below is replaced by
| the test harnesses with various lengths of valid CSS stylesheets. We use
Expand All @@ -23,7 +8,7 @@ PASS
| <!doctype html>
| <html ⚡4email>
>> ^~~~~~~~~
amp4email_feature_tests/css_length.html:23:0 Tag 'html' marked with attribute 'amp4email' is missing the corresponding attribute 'data-css-strict' for enabling strict CSS validation. This may become an error in the future. (see https://github.com/ampproject/amphtml/issues/32587)
amp4email_feature_tests/css_length.html:8:0 Tag 'html' marked with attribute 'amp4email' is missing the corresponding attribute 'data-css-strict' for enabling strict CSS validation. This may become an error in the future. (see https://github.com/ampproject/amphtml/issues/32587)
| <head>
| <meta charset="utf-8">
| <style amp4email-boilerplate>body{visibility:hidden}</style>
Expand Down
15 changes: 0 additions & 15 deletions validator/testdata/amp4email_feature_tests/css_length_strict.html
@@ -1,18 +1,3 @@
<!--
Copyright 2020 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 testcase isn't run verbatim. The template string below is replaced by
Expand Down
15 changes: 0 additions & 15 deletions validator/testdata/amp4email_feature_tests/css_length_strict.out
@@ -1,20 +1,5 @@
PASS
| <!--
| Copyright 2020 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 testcase isn't run verbatim. The template string below is replaced by
| the test harnesses with various lengths of valid CSS stylesheets. We use
Expand Down
16 changes: 1 addition & 15 deletions validator/testdata/amp4email_feature_tests/doc_size.html
@@ -1,23 +1,9 @@
<!--
Copyright 2020 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 testcase isn't run verbatim. The template string below is replaced by
the test harnesses with various lengths of valid body content. We use
this test to verify the max_document_byte_length rules for AMP4EMAIL.
(buf:013)
-->
<!doctype html>
<html ⚡4email data-css-strict>
Expand Down
16 changes: 1 addition & 15 deletions validator/testdata/amp4email_feature_tests/doc_size.out
@@ -1,24 +1,10 @@
PASS
| <!--
| Copyright 2020 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 testcase isn't run verbatim. The template string below is replaced by
| the test harnesses with various lengths of valid body content. We use
| this test to verify the max_document_byte_length rules for AMP4EMAIL.
| (buf:013)
| -->
| <!doctype html>
| <html ⚡4email data-css-strict>
Expand Down
15 changes: 0 additions & 15 deletions validator/testdata/feature_tests/css_length.html
@@ -1,18 +1,3 @@
<!--
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 testcase isn't run verbatim. The template string below is replaced by
Expand Down
15 changes: 0 additions & 15 deletions validator/testdata/feature_tests/css_length.out
@@ -1,20 +1,5 @@
PASS
| <!--
| 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 testcase isn't run verbatim. The template string below is replaced by
| the test harnesses with various lengths of valid CSS stylesheets. We use
Expand Down
15 changes: 0 additions & 15 deletions validator/testdata/feature_tests/css_lengthcheck.html
@@ -1,18 +1,3 @@
<!--
Copyright 2019 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:
Demonstrates the use of <style amp-custom-length-check> which can be
Expand Down
17 changes: 1 addition & 16 deletions validator/testdata/feature_tests/css_lengthcheck.out
@@ -1,20 +1,5 @@
FAIL
| <!--
| Copyright 2019 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:
| Demonstrates the use of <style amp-custom-length-check> which can be
| used if you want to see how many bytes are present in your style tag
Expand All @@ -29,7 +14,7 @@ FAIL
| <script async src="https://cdn.ampproject.org/v0.js"></script>
| <style amp-custom-length-check>0123456789</style>
>> ^~~~~~~~~
feature_tests/css_lengthcheck.html:29:2 The author stylesheet specified in tag 'style amp-custom-length-check' is too long - document contains 10 bytes whereas the limit is -1 bytes.
feature_tests/css_lengthcheck.html:14:2 The author stylesheet specified in tag 'style amp-custom-length-check' is too long - document contains 10 bytes whereas the limit is -1 bytes.
| <link rel="canonical" href="./regular-html-version.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>
Expand Down

0 comments on commit 733b0b8

Please sign in to comment.