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

Unnecessary <footer> tag within <article> section of note.tpl.php #4989

Open
alanmels opened this issue Mar 10, 2021 · 5 comments
Open

Unnecessary <footer> tag within <article> section of note.tpl.php #4989

alanmels opened this issue Mar 10, 2021 · 5 comments

Comments

@alanmels
Copy link

alanmels commented Mar 10, 2021

Description of the bug

Enabled user pictures, created a node and inspecting the HTML-source near the output author's user picture, I noticed the <footer> tag as shown below:

<article id="node-186" class="node node-issue view-mode-full clearfix" role="article">
      <footer>
  <div class="user-picture">
    <a href="/user/username" title="View user profile."><img src="http://some.docksal.site/files/pictures/default_image.png" alt="username's picture" title="username's picture"></a>  </div>
      <p class="submitted">Mon, 02/15/2021 - 6:40am by username</p>
    </footer>
</article>

Per HTML standards https://html.spec.whatwg.org/multipage/sections.html#the-footer-element:

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.

When the footer element contains entire sections, they represent appendices, indexes, long colophons, verbose license agreements, and other such content.

However, in our case nothing like that is found in between the opening and closing <footer> tags. Moreover, the use of <footer> tag in the <article> section here could be semantically and logically justified if it also had corresponding <header> and other sections. It looks strange that the <footer> tag appears just after section starts.

And with the main <footer> tag further down (near </body>) this one could cause conflicts when styling. So I suggest to just remove the tag.

@alanmels alanmels changed the title Unnecessary <footer> tag within <article> section Unnecessary <footer> tag within <article> section of note.tpl.php Mar 10, 2021
alanmels added a commit to alanmels/backdrop that referenced this issue Mar 10, 2021
@ghost
Copy link

ghost commented Mar 10, 2021

I disagree. <footer> is a valid tag within an <article>.

I was initially thrown off-course by the presentational name of the element; ... – it’s information about its section, containing author name, links to related documents (comments) and the like. There’s no reason that you can’t have more than one footer on page; the spec’s description says "the footer element represents a footer for the section it applies to" and a page may have any number of sections. The spec also says "Footers don’t necessarily have to appear at the end of a section, ...

Source: https://www.brucelawson.co.uk/2009/marking-up-a-blog-with-html-5-part-2/

@ghost
Copy link

ghost commented Mar 10, 2021

A footer typically contains information about its section such as who wrote it, links to related documents, copyright data, and the like.

However, in our case nothing like that is found in between the opening and closing

Uh, that's exactly what is found there - the submitted info (author name/photo, date, etc.).

And with the main <footer> tag further down (near </body>) this one could cause conflicts when styling.

Then that's a bug with the styling, not the markup. There can be multiple footer's per page, so assuming only one when styling is wrong.

@alanmels
Copy link
Author

I agree with your finding, Peter, and that's why I used "unnecessary", not "invalid" in the title. If the <article> section had other corresponding sections like, for example, <header> then the <footer> section would look just in it's place. However, we don't have any other sub-sections like that in the <article> section and the use of <footer> tag doesn't display any information

containing author name, links to related documents (comments) and the like

and also it doesn't seem to carry any other meaningful purpose here.

@ghost
Copy link

ghost commented Mar 10, 2021

Going to mark this as a question until we can get some concensus that this is indeed a 'bug'...

@alanmels
Copy link
Author

alanmels commented Mar 10, 2021

Uh, that's exactly what is found there - the submitted info (author name/photo, date, etc.).

I think we interpret the description for the section's purpose differently.

Imagine a large scientific work with multiple contributors and lot's of references to other sources, so then using multiple <footer> sections indicating author name, links to related documents and the like would be just in place.

However, in this case we are talking about the picture of the person who created the node, but not even necessarily the author of the entry. Also if it's the single user picture for the page excluding the possibility to use multiple <footer> tags to also display other authors.

The official HTML Standard documentation on https://html.spec.whatwg.org/multipage/sections.html#the-footer-element says:

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. When the footer element contains entire sections, they represent appendices, indexes, long colophons, verbose license agreements, and other such content.

which, in my opinion, implies that for consistency purposes we should then provide the <footer> tag for other sections too. But maybe you are right and we should just leave it in place. Not really sure of this.

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

No branches or pull requests

1 participant