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

match the W3C in preferring footers instead of figcaptions to give attribution for blockquotes in figures #1650

Closed
zamfofex opened this issue Aug 10, 2016 · 16 comments

Comments

@zamfofex
Copy link
Contributor

Currently, there is a major difference between the two specs on how to add attribution to blockquote elements. Ignoring the fact that the W3C allows the attribution to be inside the blockquote and the WHATWG doesn’t, the two specs allow the figure element to be used as a way to give attribution, but differ in how.

The WHATWG recommends the usage of the figcaption element to give the attribution:
https://html.spec.whatwg.org/multipage/semantics.html#the-blockquote-element

Here a blockquote element is used in conjunction with a figure element and its figcaption to clearly relate a quote to its attribution.

The W3C explicitly abolishes this:
https://www.w3.org/TR/html/grouping-content.html#the-blockquote-element

In the example above, the citation is contained within the <footer> of a <figure> element, this groups and associates the information, about the quote, with the quote. The <figcaption> element was not used, in this case, as a container for the citation as it is not a caption.

I believe that the W3C has the best interpretation of the figcaption element; it should be used to describe the figure, which an attribution is clearly not doing. A footer, however, should be used to contain data about it’s containing section (such as an attribution). Both specs clearly state that “the footer element represents a footer for its nearest ancestor sectioning content or sectioning root element. A footer typically contains information about its section such as who wrote it, links to related documents, copyright data, and the like”.

If continuing to allow the figcaption element to be used to give attribution is highly preferred by the WHATWG, then I believe it should at least be noted in the spec that using a footer is also accepted; so to allow authors to write HTML documents that conform to both specifications.

@domenic
Copy link
Member

domenic commented Aug 10, 2016

Can you make your arguments without reference to the fork? I.e., do they stand on their own merits, independent of what another group has done?

It's a fact of life that after forking our work the W3C has changed the document conformance requirements in ways that make it hard to write documents that conform to both. But that's not something that's under our control, or something we intend to use as input to our decisions. Anyone can make up requirements that contradict the HTML Standard, and we're not interested in changing the HTML Standard to be compatible with such requirements.

@domenic
Copy link
Member

domenic commented Aug 10, 2016

In fact, I believe this needs to be closed, since we have no intention of associating footers with figures. They are part of the sectioning model, and as such are associated with their section, not with any figure.

If you put a footer inside a figure element, what you are stating is that the footer itself is the figure contents, and figcaption (if any) is used to caption the footer. This will not be changing.

@zamfofex
Copy link
Contributor Author

zamfofex commented Aug 10, 2016

@domenic

Can you make your arguments without reference to the fork? I.e., do they stand on their own merits, independent of what another group has done?

Yes, as I said, the caption of a figure should describe it, which an attribution is clearly not doing.

In fact, I believe this needs to be closed, since we have no intention of associating footers with figures.

They already are associated with figures:

The footer element represents a footer for its nearest ancestor sectioning content or sectioning root element.

It’s important to note that figures are sectioning roots.

@domenic
Copy link
Member

domenic commented Aug 10, 2016

Yes, as I said, the caption of a figure should describe it, which an attribution is clearly not doing.

Great. In the future, your bug reports could be as short as this :).

However, that is not what a figcaption represents. "The figcaption element represents a caption or legend for the rest of the contents of the figcaption element's parent figure element, if any." There's no restriction on what an author might want to put in their caption or legend; attribution is a very legitimate thing to put in there. I imagine you could find many figures in textbooks, papers, or books that are captioned with attribution information.

Note how the blockquote section you cite gives the figure/figcaption method of showing attribution as one of many possibilities. In that case, the author clearly thought that making a figure out of the quotation, and captioning it with attribution information, was a good way of representing their intended semantics. But in the other examples, the author thought differently.

It’s important to note that figures are sectioning roots.

Thanks, I clearly missed that!

@zamfofex
Copy link
Contributor Author

Great. In the future, your bug reports could be as short as this :).

Haha, fair enough 😝. I just wanted to give some context, though 😄.

There's no restriction on what an author might want to put in their caption or legend

I can’t argue against this, it seems to be a matter of opinion. I believe it’s best to use figcaptions only to describe the figure and use more semantical elements (such as footer) to associate other kinds of information with the figure. As I said, I think it’d be best to at least mention the usage of footer as legitimate way to give attribution.

@domenic
Copy link
Member

domenic commented Aug 10, 2016

I'm not sure exactly what using a footer inside a figure means what you think it means. I could use some help from other editors (or anyone, really) on this. Given:

<figure>
  <img src="foo.jpg" alt="Foo">
  <footer>Posted two days ago</footer>
</figure>

It seems like there are two contradictory things going on:

  • The non-figcaption flow content of a figure element is the self-contained content that the figure represents, and which can be referred to from the main flow of the document. So from this perspective, such a markup pattern is you saying that the footer itself is the content being presented by the figure (which you could potentially give a caption to).
  • The figure element is a sectioning root, and so the description of a footer as representing a footer for the nearest sectioning content applies.

I guess part of the problem is the lack of examples of using footer where the nearest ancestor sectioning content or sectioning root is a sectioning root, but is not sectioning content. I am not sure what that scenario is supposed to mean.

@tabatkins
Copy link
Collaborator

Given the high amount of real-world insertion of attribution into figure captions, I agree that trying to draw a distinction between "stuff that goes in FIGCAPTION" and "stuff that goes in a FOOTER inside of FIGURE" is mostly going to be semantic wankery. Those sorts of hair-thin distinctions don't tend to serve authors well, and instead promote confusion among people who care deeply about accessible standardized markup, and get ignored by people just trying to get pages written.

The important question to ask is "is the distinction between A and B actually important for machines (and people who are viewing the page with the aid of machines, like screen-readers) to understand"? I think the answer here is "no, or at least pretty low value".

@zamfofex
Copy link
Contributor Author

@domenic

So, what you’re saying is that the footer, according to the spec, would be both the container for information for the figure and part of the content of the figure?

@tabatkins

It doesn’t feel like a “hair‐thin” distinction to me. For me, it’s pretty clear: the caption of a figure should describe the figure. If it doesn’t describe the figure, then it shouldn’t be inside figcaption.

@domenic
Copy link
Member

domenic commented Aug 10, 2016

@Zambonifofex I believe so, but I'm not sure.

I tend to agree with @tabatkins that trying to tell people what content they are allowed to put in figcaptions (beyond just "a caption for the figure") will cause more harm than good.

@tabatkins
Copy link
Collaborator

@Zambonifofex You're not providing a reason to separate them. Semantics for semantics sake is "semantics wankery", as I rudely alluded to; it doesn't help anybody and just produces confusion. You get the best bang for your buck (well-authored pages that people actually bother to write) by having a small, maximally useful set of expressible semantics.

Which semantics you choose to expose should be based on what is useful in practice to expose: if you're using a page via a screen reader, how much does it help to have your screen reader distinguish between "text describing the image" vs "attribution for the image"? If this is a useful distinction, why haven't books made such a distinction today, in ways that are parsable visually? (In general, if something isn't typically visually distinguishable, it's usually not a sufficiently useful semantic to be worth encoding; if it's not worthwhile to convey to sighted readers, it's probably not useful to convey to machine-assisted readers.)

(For example, the attempt to slice the semantics of italics up very finely is mostly a failure; people still use mostly <i> for everything, or (unfortunately) use <em> for everything. The meaning of italics is typically clear from context; we don't visually indicate the difference between a french word and a ship name and a Latin species name and some emphasized text - they're all just italicized, and we understand what that style is indicating in each instance. It can be argued that <em> is still useful to slice out from the other uses of <i>, both because emphasis is sometimes communicated in ways other than italics, and because emphasis is spoken differently than the other uses, but that's about the most I think that can be reasonably argued for.)

So, back to figures. What benefit do readers - sighted, screen-reading, search-engine, etc - gain from separating the description from the attribution, and why is that benefit not sufficiently worthwhile for print books to make the separation visually obvious?

@domenic
Copy link
Member

domenic commented Aug 11, 2016

I think @Zambonifofex has conceded that his preference against using figcaption for attribution captions is just a personal preference. What remains is the confusion about what putting a footer inside a figure even means. (Or more generally, what putting a footer inside any element that is a sectioning root but is not sectioning content.) It might be worth straightening that out, to see if his preferred alternate pattern of using a footer makes any sense.

@zamfofex
Copy link
Contributor Author

@tabatkins

I think what bothers me most is that the normative definition of figure and figcaption of both standards are effectively the same. What makes both standards differ is the non‐normative examples. I think that this comes from the fact that the definition of figcaption is really vague. It simply says that “the figcaption element represents a caption or legend for the rest of the contents of the figcaption element's parent figure element, if any” without ever defining what “a caption or legend” is supposed to be.

I’m simply suggesting saying that it’s supposed to describe its respective figure because it’s to my understanding closer to the W3C’s interpretation. It’s also what makes more semantical sense to me.

@domenic
Copy link
Member

domenic commented Aug 15, 2016

Closing since there doesn't appear to be an action item here.

@domenic domenic closed this as completed Aug 15, 2016
@zamfofex
Copy link
Contributor Author

@domenic

Sorry for asking so plainly, but is it, then, conforming to use a footer to represent attribution for a blockquote in a figure?

@domenic
Copy link
Member

domenic commented Aug 15, 2016

It's certainly conforming. Whether it conveys the semantics to those reading your code in a way that others will understand is unclear; if I was reading that code, I would be thinking that you were trying to display a figure with no caption, but whose contents were a footer.

@myfonj
Copy link

myfonj commented Jul 24, 2023

2023 Remarks:

  • neither <figure> nor <blockquote> seem to be "sectioning root" any more (there seems to be no such thing currently in the spec), so IIUC putting <footer> inside either blockquote or figure means that the footer still belongs to the closest article, aside, nav, or section (i.e. element constituting "sectioning content"), so it is not related to (closely) enclosing figure or blockquote. Right?
  • There seems to be some confusion which structure is currently more appropriate for marking up even the simplest block quotations:

Whether to stick to blockquote > footer ("Old" ("W3C" (?)) structure that currently works with all user agents (but is not valid in a sense that, as was pointed out, the blockquote is not the scoping element):

<blockquote>
  <p>Words.</p>
  <footer>Said the Author in <cite>The Work</cite>.</footer>
</blockquote>

…or figure > blockquote + figcaption ("new" ("WHATWG"(?)) structure, that is reportedly slightly broken in certain UAs).

<figure>
 <blockquote>
   <p>Words.</p>
 </blockquote>
 <figcaption>Said the Author in <cite>The Work</cite>.</figcaption>
</figure>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants