Skip to content

Commit

Permalink
cl/262149003 Allow double-spaces in <a rel> and <link rel>.
Browse files Browse the repository at this point in the history
  • Loading branch information
twifkak authored and Greg Grothaus committed Aug 7, 2019
1 parent 076c3e4 commit d97c0d9
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 3 deletions.
33 changes: 33 additions & 0 deletions validator/testdata/feature_tests/a_rel_double_space.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:
This is the minimum valid AMP document; it includes all of the required
fields from the spec, but nothing else.
-->
<!doctype html>
<html >
<head>
<meta charset="utf-8">
<link rel="canonical" href="./regular-html-version.html">
<meta name="viewport" content="width=device-width">
<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>
</head>
<body>
Hello, <a rel="attachment noopener noreferrer">world</a>.
</body>
</html>
34 changes: 34 additions & 0 deletions validator/testdata/feature_tests/a_rel_double_space.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
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 is the minimum valid AMP document; it includes all of the required
| fields from the spec, but nothing else.
| -->
| <!doctype html>
| <html ⚡>
| <head>
| <meta charset="utf-8">
| <link rel="canonical" href="./regular-html-version.html">
| <meta name="viewport" content="width=device-width">
| <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>
| </head>
| <body>
| Hello, <a rel="attachment noopener noreferrer">world</a>.
| </body>
| </html>
6 changes: 3 additions & 3 deletions validator/validator-main.protoascii
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ min_validator_revision_required: 375
# newer versions of the spec file. This is currently a Google internal
# mechanism, validator.js does not use this facility. However, any
# change to this file (validator-main.js) requires updating this revision id.
spec_file_revision: 924
spec_file_revision: 925

styles_spec_url: "https://amp.dev/documentation/guides-and-tutorials/develop/style_and_layout/style_pages"
script_spec_url: "https://amp.dev/documentation/guides-and-tutorials/learn/spec/amphtml#html-tags"
Expand Down Expand Up @@ -222,7 +222,7 @@ tags: {
"preload|" # Handled separately below, has specific requirements.
"serviceworker|"
"stylesheet|" # Handled separately below, has specific requirements.
"subresource|"
"subresource"
")(\\s|$)"
# It is worth noting that user-authored tags for dns-prefectch, preconnect,
# prefetch, and prerender will be disabled by the transformations applied
Expand Down Expand Up @@ -1905,7 +1905,7 @@ tags: {
"prerender|"
"serviceworker|"
"stylesheet|" # Only allowed for link tags, specific req's for AMP.
"subresource|"
"subresource"
")(\\s|$)"
}
attrs: {
Expand Down

0 comments on commit d97c0d9

Please sign in to comment.