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

Required component for amp-form not detected when invalid <amp-form> is removed from wrapped <form> element #4511

Closed
westonruter opened this issue Apr 2, 2020 · 2 comments · Fixed by #4512
Assignees
Labels
Bug Something isn't working Sanitizers Validation
Projects
Milestone

Comments

@westonruter
Copy link
Member

Bug Description

Given this invalid AMP markup:

<amp-form>
	<form method="GET" id="a_string" class="a_string" action="https://example.com" target="_blank">
		<input type=text value="test" name="hello">
	</form>
</amp-form>

The amp-form is invalid and gets removed, being replaced with its children:

<form method="GET" id="a_string" class="a_string" action="https://example.com" target="_blank">
	<input type="text" value="test" name="hello">
</form>

However, as part of this process the amp-form component script is not being detected as being required for the page.

Originally reported at https://wordpress.org/support/topic/custom-element-scripts-being-removed/

Expected Behaviour

When amp-form > form is on the page, the amp-form component script should be added.

Additional context

  • WordPress version: 5.4
  • Plugin version: 1.5.1

Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

Implementation brief

QA testing instructions

Demo

Changelog entry

@westonruter westonruter added Bug Something isn't working Validation Sanitizers labels Apr 2, 2020
@westonruter westonruter added this to To Do in Ongoing Apr 2, 2020
@westonruter westonruter self-assigned this Apr 2, 2020
@westonruter westonruter moved this from To Do to In Progress in Ongoing Apr 2, 2020
@westonruter westonruter added this to the v1.5.2 milestone Apr 2, 2020
@westonruter westonruter moved this from In Progress to Ready for Review in Ongoing Apr 2, 2020
@westonruter westonruter moved this from Ready for Review to Ready for QA in Ongoing Apr 3, 2020
@amedina
Copy link
Member

amedina commented Apr 3, 2020

QA:

  • Invalid tag amp-form being removed by the plugin

Screen Shot 2020-04-03 at 9 47 18 AM

  • amp-form-0.1.js script added

Screen Shot 2020-04-03 at 9 47 59 AM

  • AMP compatibility preserved

Screen Shot 2020-04-03 at 9 49 02 AM

@amedina amedina moved this from Ready for QA to Done in Ongoing Apr 3, 2020
@westonruter
Copy link
Member Author

Build for testing: amp.zip (v1.5.2-RC1-20200403T193031Z-3102c5dea)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Sanitizers Validation
Projects
Ongoing
  
Done
3 participants