Skip to content

Unexpected validation error parent element when invalid elements are nested #1493

@amedina

Description

@amedina

The <details> HTML tag is not allowed by AMP's specification yet. It will likely be added soon but its current status allows us to see an seemingly unexpected behavior in validation handling. This tag is used as follows:

<details>
  <summary>Copyright 1999-2018.</summary>
   <p>- by Awesome Author. All Rights Reserved.</p>
   <p>All content and graphics on this web site are the property of the author.</p>
</details>

Which results in the following view in the non-AMP version:

screen shot 2018-10-07 at 1 15 09 pm

On the AMP side the following takes place:

  • The plugin correctly flags the HTML error and points out to the <details> tag as the offending markup.

screen shot 2018-10-07 at 1 15 36 pm

screen shot 2018-10-07 at 1 15 45 pm

  • Upon accepting the error, the plugin is effectively instructed to remove the details tag
  • Upon updating the post, the plugin removes the details tag and flags a new error associated with the <summary> tag

screen shot 2018-10-07 at 1 16 24 pm

screen shot 2018-10-07 at 1 16 34 pm

Expected behavior:

  • Since the summary tag is a child of the Details tag, the expected behavior is that removing the details tag should also remove the summary tag and therefore no error should be flagged for the latter once the former has been accepted

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions