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

Validator rollup #26845

Merged
merged 5 commits into from
Feb 18, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
cl/294931948 Allow input type=button.
  • Loading branch information
Greg Grothaus authored and honeybadgerdontcare committed Feb 18, 2020
commit 01aa7039406b93415eab43fa966d2195667936ce
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@

<!-- Invalid: amp-autocomplete with invalid input types -->
<amp-autocomplete widht="100" filter="prefix">
<input type="button" />
<input type="file" />
<script type="application/json">
{}
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -510,9 +510,9 @@ amp-autocomplete/0.1/test/validator-amp-autocomplete.html:495:4 The specified la
| <amp-autocomplete widht="100" filter="prefix">
>> ^~~~~~~~~
amp-autocomplete/0.1/test/validator-amp-autocomplete.html:503:4 The attribute 'widht' may not appear in tag 'amp-autocomplete'. (see https://amp.dev/documentation/components/amp-autocomplete)
| <input type="button" />
| <input type="file" />
>> ^~~~~~~~~
amp-autocomplete/0.1/test/validator-amp-autocomplete.html:504:6 The attribute 'type' in tag 'input' is set to the invalid value 'button'. (see https://amp.dev/documentation/components/amp-form)
amp-autocomplete/0.1/test/validator-amp-autocomplete.html:504:6 The tag 'INPUT [type=file]' may only appear as a descendant of tag 'form [method=post]'. (see https://amp.dev/documentation/components/amp-form)
| <script type="application/json">
| {}
| </script>
Expand Down
4 changes: 2 additions & 2 deletions validator/testdata/amp4ads_feature_tests/amp_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@
<span>Your email</span>
<input type="email" name="email" required>
</label>
<input type="button" name="button">
<input type="submit" value="Subscribe">
</fieldset>
</form>
<!-- Invalid: input can not be type="button|image". -->
<!-- Invalid: input can not be type="image". -->
<form method="post" action-xhr="https://example.com/subscribe" target="_blank">
<input type="button" name="button">
<input type="image" name="image">
</form>
<!-- Invalid: input can not be type="file|password". -->
Expand Down
6 changes: 2 additions & 4 deletions validator/testdata/amp4ads_feature_tests/amp_form.out
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,12 @@ FAIL
| <span>Your email</span>
| <input type="email" name="email" required>
| </label>
| <input type="button" name="button">
| <input type="submit" value="Subscribe">
| </fieldset>
| </form>
| <!-- Invalid: input can not be type="button|image". -->
| <!-- Invalid: input can not be type="image". -->
| <form method="post" action-xhr="https://example.com/subscribe" target="_blank">
| <input type="button" name="button">
>> ^~~~~~~~~
amp4ads_feature_tests/amp_form.html:50:4 The attribute 'type' in tag 'input' is set to the invalid value 'button'. (see https://amp.dev/documentation/components/amp-form)
| <input type="image" name="image">
>> ^~~~~~~~~
amp4ads_feature_tests/amp_form.html:51:4 The attribute 'type' in tag 'input' is set to the invalid value 'image'. (see https://amp.dev/documentation/components/amp-form)
Expand Down
4 changes: 2 additions & 2 deletions validator/testdata/amp4email_feature_tests/amp_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
<span>Your email</span>
<input type="email" name="email" required>
</label>
<input type="button" name="button">
<input type="submit" value="Subscribe">
</fieldset>
<div submit-success>
Expand Down Expand Up @@ -99,9 +100,8 @@
</div>
<input type="submit" value="OK">
</form>
<!-- Invalid: input can not be type="button|file|image". -->
<!-- Invalid: input can not be type="file|image". -->
<form method="post" action-xhr="https://example.com/subscribe">
<input type="button" name="button">
<input type="image" name="image">
</form>
<!-- Invalid: input can not be type="password" -->
Expand Down
16 changes: 7 additions & 9 deletions validator/testdata/amp4email_feature_tests/amp_form.out
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ FAIL
| <span>Your email</span>
| <input type="email" name="email" required>
| </label>
| <input type="button" name="button">
| <input type="submit" value="Subscribe">
| </fieldset>
| <div submit-success>
Expand Down Expand Up @@ -80,41 +81,38 @@ FAIL
| <!-- Invalid: only https protocol is supported. -->
| <form method="GET" action-xhr="http://someserver.com/endpoint">
>> ^~~~~~~~~
amp4email_feature_tests/amp_form.html:80:2 Invalid URL protocol 'http:' for attribute 'action-xhr' in tag 'FORM [method=GET] (AMP4EMAIL)'. (see https://amp.dev/documentation/components/amp-form)
amp4email_feature_tests/amp_form.html:81:2 Invalid URL protocol 'http:' for attribute 'action-xhr' in tag 'FORM [method=GET] (AMP4EMAIL)'. (see https://amp.dev/documentation/components/amp-form)
| <input name="googlesearch">
| <input type="submit" value="OK">
| </form>
| <!-- Invalid: only absolute URL is allowed. -->
| <form method="GET" action-xhr="endpoint">
>> ^~~~~~~~~
amp4email_feature_tests/amp_form.html:85:2 The relative URL 'endpoint' for attribute 'action-xhr' in tag 'FORM [method=GET] (AMP4EMAIL)' is disallowed. (see https://amp.dev/documentation/components/amp-form)
amp4email_feature_tests/amp_form.html:86:2 The relative URL 'endpoint' for attribute 'action-xhr' in tag 'FORM [method=GET] (AMP4EMAIL)' is disallowed. (see https://amp.dev/documentation/components/amp-form)
| <input name="googlesearch">
| <input type="submit" value="OK">
| </form>
| <form method="POST" action-xhr="endpoint">
>> ^~~~~~~~~
amp4email_feature_tests/amp_form.html:89:2 The relative URL 'endpoint' for attribute 'action-xhr' in tag 'FORM [method=POST] (AMP4EMAIL)' is disallowed. (see https://amp.dev/documentation/components/amp-form)
amp4email_feature_tests/amp_form.html:90:2 The relative URL 'endpoint' for attribute 'action-xhr' in tag 'FORM [method=POST] (AMP4EMAIL)' is disallowed. (see https://amp.dev/documentation/components/amp-form)
| <input name="googlesearch">
| <input type="submit" value="OK">
| </form>
| <!-- Invalid: the action and target attributes are disallowed. -->
| <form method="GET"
>> ^~~~~~~~~
amp4email_feature_tests/amp_form.html:94:2 The attribute 'action' may not appear in tag 'FORM [method=GET] (AMP4EMAIL)'. (see https://amp.dev/documentation/components/amp-form)
amp4email_feature_tests/amp_form.html:95:2 The attribute 'action' may not appear in tag 'FORM [method=GET] (AMP4EMAIL)'. (see https://amp.dev/documentation/components/amp-form)
>> ^~~~~~~~~
amp4email_feature_tests/amp_form.html:94:2 The attribute 'target' may not appear in tag 'FORM [method=GET] (AMP4EMAIL)'. (see https://amp.dev/documentation/components/amp-form)
amp4email_feature_tests/amp_form.html:95:2 The attribute 'target' may not appear in tag 'FORM [method=GET] (AMP4EMAIL)'. (see https://amp.dev/documentation/components/amp-form)
| action="/components/amp-form/submit-form"
| target="_top">
| <div>
| <input name="googlesearch">
| </div>
| <input type="submit" value="OK">
| </form>
| <!-- Invalid: input can not be type="button|file|image". -->
| <!-- Invalid: input can not be type="file|image". -->
| <form method="post" action-xhr="https://example.com/subscribe">
| <input type="button" name="button">
>> ^~~~~~~~~
amp4email_feature_tests/amp_form.html:104:4 The attribute 'type' in tag 'input' is set to the invalid value 'button'. (see https://amp.dev/documentation/components/amp-form)
| <input type="image" name="image">
>> ^~~~~~~~~
amp4email_feature_tests/amp_form.html:105:4 The attribute 'type' in tag 'input' is set to the invalid value 'image'. (see https://amp.dev/documentation/components/amp-form)
Expand Down
4 changes: 2 additions & 2 deletions validator/testdata/feature_tests/forms.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
<span>Your email</span>
<input type="email" name="email" required>
</label>
<input type="button" name="button">
<input type="submit" value="Subscribe">
</fieldset>
<div>
Expand Down Expand Up @@ -130,9 +131,8 @@
<option value="1">English</option>
</select>
<textarea name="comment"></textarea>
<!-- Invalid: input can not be type="button|image". -->
<!-- Invalid: input can not be type="image". -->
<form method="post" action-xhr="https://example.com/subscribe" target="_blank">
<input type="button" name="button">
<input type="image" name="image">
</form>
<!-- Valid: input can be type="password" or type="file" in a post xhr form. -->
Expand Down
10 changes: 4 additions & 6 deletions validator/testdata/feature_tests/forms.out
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ FAIL
| <span>Your email</span>
| <input type="email" name="email" required>
| </label>
| <input type="button" name="button">
| <input type="submit" value="Subscribe">
| </fieldset>
| <div>
Expand Down Expand Up @@ -104,7 +105,7 @@ FAIL
| <!-- Invalid: form action must be https. -->
| <form method="post" action-xhr="http://example.com/subscribe" target="_blank">
>> ^~~~~~~~~
feature_tests/forms.html:104:2 Invalid URL protocol 'http:' for attribute 'action-xhr' in tag 'FORM [method=POST]'. (see https://amp.dev/documentation/components/amp-form)
feature_tests/forms.html:105:2 Invalid URL protocol 'http:' for attribute 'action-xhr' in tag 'FORM [method=POST]'. (see https://amp.dev/documentation/components/amp-form)
| <input type="submit" value="Subscribe">
| </form>
| <!-- Invalid: form action must be a non-cdn link. -->
Expand All @@ -126,7 +127,7 @@ feature_tests/forms.html:104:2 Invalid URL protocol 'http:' for attribute 'actio
| <!-- Invalid: form target must be _blank or _top -->
| <form method="post" action-xhr="https://example/subscribe" target="_new">
>> ^~~~~~~~~
feature_tests/forms.html:124:2 The attribute 'target' in tag 'FORM [method=POST]' is set to the invalid value '_new'. (see https://amp.dev/documentation/components/amp-form)
feature_tests/forms.html:125:2 The attribute 'target' in tag 'FORM [method=POST]' is set to the invalid value '_new'. (see https://amp.dev/documentation/components/amp-form)
| <input type="submit" value="Subscribe">
| </form>
| <!-- Invalid: input, select, option and textarea must be children of form. -->
Expand All @@ -135,11 +136,8 @@ feature_tests/forms.html:124:2 The attribute 'target' in tag 'FORM [method=POST]
| <option value="1">English</option>
| </select>
| <textarea name="comment"></textarea>
| <!-- Invalid: input can not be type="button|image". -->
| <!-- Invalid: input can not be type="image". -->
| <form method="post" action-xhr="https://example.com/subscribe" target="_blank">
| <input type="button" name="button">
>> ^~~~~~~~~
feature_tests/forms.html:135:4 The attribute 'type' in tag 'input' is set to the invalid value 'button'. (see https://amp.dev/documentation/components/amp-form)
| <input type="image" name="image">
>> ^~~~~~~~~
feature_tests/forms.html:136:4 The attribute 'type' in tag 'input' is set to the invalid value 'image'. (see https://amp.dev/documentation/components/amp-form)
Expand Down
3 changes: 1 addition & 2 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: 1005
spec_file_revision: 1006

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 @@ -4519,7 +4519,6 @@ tags: {
attrs: {
name: "type"
blacklisted_value_regex: "(^|\\s)(" # Values are space separated.
"button|"
"file|"
"image|"
"password|"
Expand Down