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

Bento: Validate Facebook components #35395

Merged
merged 14 commits into from Aug 4, 2021
@@ -0,0 +1,39 @@
<!--
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.
-->
<!--
Test Description:
Tests support for the amp-facebook-comments tag.
-->
<!doctype html>
<html ⚡ lang="en">
<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 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>
<!-- Invalid: amp-facebook 0.1 does not suffice for amp-facebook-comments -->
<script async custom-element="amp-facebook" src="https://cdn.ampproject.org/v0/amp-facebook-0.1.js"></script>
</head>
<body>
<amp-facebook-comments
width=486
height=657
layout="responsive"
data-href="http://www.directlyrics.com/adele-25-complete-album-lyrics-news.html">
</amp-facebook>
</body>
</html>
@@ -0,0 +1,42 @@
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.
| -->
| <!--
| Test Description:
| Tests support for the amp-facebook-comments tag.
| -->
| <!doctype html>
| <html ⚡ lang="en">
| <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 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>
| <!-- Invalid: amp-facebook 0.1 does not suffice for amp-facebook-comments -->
| <script async custom-element="amp-facebook" src="https://cdn.ampproject.org/v0/amp-facebook-0.1.js"></script>
| </head>
| <body>
| <amp-facebook-comments
| width=486
| height=657
| layout="responsive"
| data-href="http://www.directlyrics.com/adele-25-complete-album-lyrics-news.html">
| </amp-facebook>
| </body>
| </html>
>> ^~~~~~~~~
amp-facebook-comments/0.1/test/validator-amp-facebook-comments-invalid.html:39:6 The tag 'amp-facebook 1.0' is missing or incorrect, but required by 'amp-facebook-comments'. (see https://amp.dev/documentation/components/amp-facebook)
Expand Up @@ -34,6 +34,6 @@
height=657
layout="responsive"
data-href="http://www.directlyrics.com/adele-25-complete-album-lyrics-news.html">
</amp-facebook>
</amp-facebook-comments>
</body>
</html>
Expand Up @@ -35,6 +35,6 @@ PASS
| height=657
| layout="responsive"
| data-href="http://www.directlyrics.com/adele-25-complete-album-lyrics-news.html">
| </amp-facebook>
| </amp-facebook-comments>
| </body>
| </html>
Expand Up @@ -17,6 +17,8 @@
tags: { # amp-facebook-comments
html_format: AMP
tag_name: "SCRIPT"
satisfies: "amp-facebook-comments 0.1"
excludes: "amp-facebook 1.0"
extension_spec: {
name: "amp-facebook-comments"
version: "0.1"
Expand All @@ -28,11 +30,9 @@ tags: { # <amp-facebook-comments>
html_format: AMP
tag_name: "AMP-FACEBOOK-COMMENTS"
requires_extension: "amp-facebook-comments"
# data-* is generally allowed, but it's not generally mandatory.
attrs: {
name: "data-href"
mandatory: true
}
requires: "amp-facebook-comments 0.1"
# The amp-facebook attr_list is defined in the amp-facebook protoascii
attr_lists: "amp-facebook"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest leaving a comment for the reader on where to find this list, since it's in a different file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

attr_lists: "extended-amp-global"
amp_layout: {
supported_layouts: FILL
Expand Down
@@ -0,0 +1,41 @@
<!--
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.
-->
<!--
Test Description:
Tests support for the amp-facebook-like tag.
-->
<!doctype html>
<html ⚡ lang="en">
<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 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>
<!-- Invalid: amp-facebook 0.1 does not suffice for amp-facebook-like -->
<script async custom-element="amp-facebook" src="https://cdn.ampproject.org/v0/amp-facebook-0.1.js"></script>
</head>
<body>
<amp-facebook-like width=225 height=80
layout="fixed"
title="Like Button"
data-layout="standard"
data-size="large"
data-show-faces="true"
data-href="https://www.facebook.com/testesmegadivertidos/">
</amp-facebook-like>
</body>
</html>
@@ -0,0 +1,44 @@
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.
| -->
| <!--
| Test Description:
| Tests support for the amp-facebook-like tag.
| -->
| <!doctype html>
| <html ⚡ lang="en">
| <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 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>
| <!-- Invalid: amp-facebook 0.1 does not suffice for amp-facebook-like -->
| <script async custom-element="amp-facebook" src="https://cdn.ampproject.org/v0/amp-facebook-0.1.js"></script>
| </head>
| <body>
| <amp-facebook-like width=225 height=80
| layout="fixed"
| title="Like Button"
| data-layout="standard"
| data-size="large"
| data-show-faces="true"
| data-href="https://www.facebook.com/testesmegadivertidos/">
| </amp-facebook-like>
| </body>
| </html>
>> ^~~~~~~~~
amp-facebook-like/0.1/test/validator-amp-facebook-like-invalid.html:41:6 The tag 'amp-facebook 1.0' is missing or incorrect, but required by 'amp-facebook-like'. (see https://amp.dev/documentation/components/amp-facebook)
Expand Up @@ -17,6 +17,8 @@
tags: { # amp-facebook-like
html_format: AMP
tag_name: "SCRIPT"
satisfies: "amp-facebook-like 0.1"
excludes: "amp-facebook 1.0"
extension_spec: {
name: "amp-facebook-like"
version: "0.1"
Expand All @@ -28,16 +30,9 @@ tags: { # <amp-facebook-like>
html_format: AMP
tag_name: "AMP-FACEBOOK-LIKE"
requires_extension: "amp-facebook-like"
# data-* is generally allowed, but it's not generally mandatory.
attrs: {
name: "data-href"
mandatory: true
value_url: {
protocol: "http"
protocol: "https"
allow_relative: false
}
}
requires: "amp-facebook-like 0.1"
# The amp-facebook-strict attr_list is defined in the amp-facebook protoascii
attr_lists: "amp-facebook-strict"
attr_lists: "extended-amp-global"
amp_layout: {
supported_layouts: FILL
Expand Down
@@ -0,0 +1,38 @@
<!--
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.
-->
<!--
Test Description:
Tests support for the amp-facebook-page tag.
-->
<!doctype html>
<html ⚡ lang="en">
<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 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>
<!-- Invalid: amp-facebook 0.1 does not suffice for amp-facebook-page -->
<script async custom-element="amp-facebook" src="https://cdn.ampproject.org/v0/amp-facebook-0.1.js"></script>
</head>
<body>
<amp-facebook-page width=552 height=310
layout="responsive"
data-tabs="timeline"
data-href="https://www.facebook.com/barackobama/">
</amp-facebook-page>
</body>
</html>
@@ -0,0 +1,41 @@
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.
| -->
| <!--
| Test Description:
| Tests support for the amp-facebook-page tag.
| -->
| <!doctype html>
| <html ⚡ lang="en">
| <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 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>
| <!-- Invalid: amp-facebook 0.1 does not suffice for amp-facebook-page -->
| <script async custom-element="amp-facebook" src="https://cdn.ampproject.org/v0/amp-facebook-0.1.js"></script>
| </head>
| <body>
| <amp-facebook-page width=552 height=310
| layout="responsive"
| data-tabs="timeline"
| data-href="https://www.facebook.com/barackobama/">
| </amp-facebook-page>
| </body>
| </html>
>> ^~~~~~~~~
amp-facebook-page/0.1/test/validator-amp-facebook-page-invalid.html:38:6 The tag 'amp-facebook 1.0' is missing or incorrect, but required by 'amp-facebook-page'. (see https://amp.dev/documentation/components/amp-facebook)
Expand Up @@ -17,6 +17,8 @@
tags: { # amp-facebook-page
html_format: AMP
tag_name: "SCRIPT"
satisfies: "amp-facebook-page 0.1"
excludes: "amp-facebook 1.0"
extension_spec: {
name: "amp-facebook-page"
version: "0.1"
Expand All @@ -28,16 +30,9 @@ tags: { # <amp-facebook-page>
html_format: AMP
tag_name: "AMP-FACEBOOK-PAGE"
requires_extension: "amp-facebook-page"
# data-* is generally allowed, but it's not generally mandatory.
attrs: {
name: "data-href"
mandatory: true
value_url: {
protocol: "http"
protocol: "https"
allow_relative: false
}
}
requires: "amp-facebook-page 0.1"
# The amp-facebook-strict attr_list is defined in the amp-facebook protoascii
attr_lists: "amp-facebook-strict"
attr_lists: "extended-amp-global"
amp_layout: {
supported_layouts: FILL
Expand Down
@@ -0,0 +1,46 @@
<!--
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.
-->
<!--
Test Description:
Tests support for the amp-facebook-comments tag.
-->
<!doctype html>
<html ⚡ lang="en">
<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 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-facebook" src="https://cdn.ampproject.org/v0/amp-facebook-1.0.js"></script>
</head>
<body>
<!-- Example of a valid amp-facebook (embedded post) -->
<amp-facebook
width=486
height=657
layout="responsive"
data-href="https://www.facebook.com/zuck/posts/10102593740125791">
</amp-facebook>
<!-- Example of a valid amp-facebook-comments -->
<amp-facebook-comments
width=486
height=657
layout="responsive"
data-href="http://www.directlyrics.com/adele-25-complete-album-lyrics-news.html">
</amp-facebook-comments>
</body>
</html>