Skip to content

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

@westonruter

Description

@westonruter

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

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions