Skip to content
This repository has been archived by the owner on Jul 30, 2019. It is now read-only.

multiple <figcaption> elements must not be placed within <figure> element #1540

Closed
mtrootyy opened this issue Jul 21, 2018 · 1 comment
Closed
Assignees
Milestone

Comments

@mtrootyy
Copy link

mtrootyy commented Jul 21, 2018

When multiple <figcaption> elements are placed within <figure> element, "The W3C Markup Validation Service" output an error.
But this thing is not clearly stipulated in HTML5.3 specification.

Therefore, two fixes are necessary.

https://w3c.github.io/html/grouping-content.html#the-figure-element

Content model:

  • Flow content optionally including a figcaption child element.


The above should be fixed following;

Content model:

  • Flow content optionally including only one figcaption child element.

https://w3c.github.io/html/grouping-content.html#the-figcaption-element

Contexts in which this element can be used:

  • As a child of a figure element.


The above should be fixed following;

Contexts in which this element can be used:

  • As a child of a figure element, but with no other figcaption elements within the figure element.
@mtrootyy
Copy link
Author

At the same time, the following should be fixed.

https://w3c.github.io/html/grouping-content.html#the-figure-element

The figcaption descendant of figure, if any, represents the caption of the figure element’s contents. If there is no child figcaption element, then there is no caption.


The above should be fixed following;

The figcaption child of figure, if any, represents the caption of the figure element’s contents. If there is no child figcaption element, then there is no caption.

@scottaohara scottaohara self-assigned this Jul 24, 2018
scottaohara added a commit that referenced this issue Jul 26, 2018
Fixes #1540

Addresses point to clarif content model for `figure` element.

Mention in the prose of the `figcaption` section that there should be no more than one child `figcaption`  to a single parent `figure`.

Additionally pull over prose from `table` section, about how a `figcaption` should be used instead of a `caption` if a `table` is the primary content of a `figure`.

Further, added new example showing how 2 `figcaption` elements should be avoided and instead coded as a single `figcaption` to a `figure` showcasing a code snippet.

Includes other file cleanup.
@scottaohara scottaohara added this to the HTML5.3 WD5 milestone Jul 26, 2018
chaals pushed a commit that referenced this issue Jul 28, 2018
Fixes #1540

Clarify content model for `figure` element.

* Mention in the prose of the `figcaption` section that there should be no more than one child `figcaption`  to a single parent `figure`.
* Pull over prose from `table` section, about how a `figcaption` should be used instead of a `caption` if a `table` is the primary content of a `figure`.
* Added new example showing how 2 `figcaption` elements should be avoided and instead coded as a single `figcaption` to a `figure` showcasing a code snippet.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants