Test case: figcaption element

The HTML specification states that the contexts in which the <figcaption> element can be used are:

"As the first or last child of a figure element."

HTML issue 177 questions whether restricting <figcaption> to the first/last child of <figure> is necessary.

Case 1: <figcaption> as last child of <figure>

This case conforms to the current HTML definition for <figcaption>.

Example

Lorem ipsum dolor sit amet...

Fig.1 Latin text

Code


<figure>
	<p>Lorem ipsum dolor sit amet...</p>
	<figcaption>Fig.1 Latin text</figcaption>
</figure>

Case 2: <figcaption> as grandchild of <figure>

This case does not conform with the current HTML definition for <figcaption>.

Example

Lorem Ipsum dolor sit amet...
Fig.2 Latin text

Code


<figure>
	<div>
		Lorem Ipsum dolor sit amet...
		<figcaption>Fig.2 Latin text</figcaption>
	</div>
</figure>

Test criteria

Results

Results for Case 2
Chrome Edge Firefox IE Opera Safari Yandex
Correct visual rendering Pass Pass Pass Pass ? Pass Pass
Accessible name calculation Pass Pass Pass N/A ? Pass Pass

Notes

According to CanIUse, the <figure> and <figcaption> elements have ample implementation support.