[Proposal] new author element HTML


#21

As has been said elsewhere (eg, by @liamquin) the term “author” would be ambiguous, and incorporating each and every possible variation into HTML as separate elements would be confusing. However… the original specification of the role attribute (see https://www.w3.org/TR/role-attribute/) was meant, afaik, exactly for these cases: give an easy and simple ways to add simple semantics to an element. Ie, something like:

<p><span role='author'>Sergei Smirnov</span>...</p>

would be fine, and the possible values of role could be defined and registered separately from the core HTML spec. Which means that its deployment would be easy, much easier than the introduction of a new element.

The problem is that, as of today, the values of role are defined exclusively for the purpose of ARIA (https://www.w3.org/TR/wai-aria-1.1/), ie, for accessibility purposes, which may make it a bit difficult to add new values. Maybe we should look at the role (sic!) of the role attribute HTML5 again and possibly extend its usage for the purpose of such ‘light’ semantics, too, beyond its usage in ARIA.

(I realize that there is a problem with the cite element. But just adding yet another confusing element does not make it right imho…)


#22

I think we will (probably) get there eventually, but I think we are a ways off from it. Tagging in @alice to who might be able to say more/link.


#23

If you think these elements were mistakes, suggesting another element of the same taste seems like a bad idea. I think we shouldn’t make more errors just so that we can say we were consistent and managed to introduce a complete set of mistakes.


#24

so let’s remove <cite> element from HTML specification and everything should be all right


#25

There is no reason to deprecate the citation element. The web was engineered for sharing documents. Citations on those are super important and still very relevant. Simply because specifically marking up an author isn’t going to happen with an element doesn’t mean something as relevant and useful as citations should be removed.

If you want author markup today, <a rel="author">name<\a> pretty much gives it to you. Bonus, you can add an href and link to their content.


#26

@Garbee you are wrong. if you didn’t know <cite> element is not citation element. <cite> element represents a a creative work. https://www.w3.org/TR/html/textlevel-semantics.html#the-cite-element

True citation element - <q> element. The <q> element represents some phrasing content quoted from another source. https://www.w3.org/TR/html/textlevel-semantics.html#the-q-element Yes real citation <q> element still relevant. But <cite> element is not for citation, what you are talking about. Probably some peoples like you still use <cite> element like <q> element but it is wrong. And your case name is not for my case, it is for hyperlinks. Also could be said <a href="link to citation">go to citation</a> or instead wrong for citation <cite> element use <q>some citation</q> or <blockquote>Block of citation</blockquote>


#27

@programmer3000 please don’t make assumptions about what other people do, or know.

The english term “citation” often - perhaps most typically - refers to a mention of a creative work, for example in an academic paper referring to other works. The cite element is an appropriate HTML element for doing so.

The q element is for direct quotation, as you mention.

I think @garbee is correct that a straightforward way to refer to an author today is with a link using rel="author". There are various other possible approaches, such as using RDFa or microdata with a vocabulary like Schema.org or Dublin Core.

The idea of using cite to refer to a person is that in some cases there is no “work”, or none that is known to the person writing. For example, I believe that Oliver Wendell Holmes said or wrote “I like paying taxes. With them I buy civilisation”, or words to that effect. But I do not know when or where, and common spoken or written usage would therefore be to refer to Justice Holmes, as the source of the citation.


#28

@chaals it’s a joke? have you seen my post above bad semanics of <cite> element without <author> element? And you write about correct case when rel="author" - though this case for hyperlinks and my not for hyperlink and <cite> also not for hyperlink. Also you could use just only <a href="">refers to a mention of a creative work</a> instead <cite>. So <cite> element also could use various other possible approaches like RDFa or Schema.org.
And for case about Oliver Wendell Holmes “I like paying taxes. With them I buy civilisation” there are ways without <cite> element - is <q>, <blockquote>, <i>, <b>, <strong>, RDFa, Schema.org and so on, at the discretion of site builder. And for author’s name of “I like paying taxes. With them I buy civilisation” - new element <author>. So it will clear semantic. Or remove <cite> element from HTML specification and then no need for new <author> element and problem fixed.


#29

The rel="author" attribute assumes you have a link destination, which may not be applicable in the case of only wanting to define an author’s name. Also, rel attributes does not map to ARIA roles, <author> could be useful as it would allow screen-readers to distinguish an authors name from what may sound like jibberish if a name is unknown to you.

@programmer3000

You should relax a bit.


#30

How so? Anchor elements do not require an href be provided. You can use it as a generic inline semantics node. <a rel="author">Jonathan Garbee</a> for example is perfectly valid.

Is there a current role for determining content that is an authors name? I am having trouble locating it searching around a bit. If there is, then perhaps focusing on the referenced wcg/aria issue is the path forward. Improve the existing system without adding more stuff to cover a case that can already be handled well. Or, if the role does exist, just add it onto the anchor as well and you get full support now without any delay.


#31

<a rel="author">Jonathan Garbee</a> for example is perfectly valid.

You’re right. #32

Is there a current role for determining content that is an authors name?

The closest (and probably sufficient) property (see allowed ARIA roles/properties/states) would be roledescription, e.g:

 <article>
   <span aria-roledescription="author">John doe</span>
   ...
 </article>

#32

Anchor elements do not require an href be provided. You can use it as a generic inline semantics node. <a rel="author">Jonathan Garbee</a> for example is perfectly valid.

Your first sentence is correct, but the following two are not. According to both W3C and WHATWG …

The target, download, ping, rel, hreflang, type, and referrerpolicy attributes must be omitted if the href attribute is not present.


#33

Hmm, the spec claims it must be omitted, but I wonder if anyone taking advantage of rel in this kind of case actually cares to also check for the href? That’s a thing for someone with more time to look into the inner workings to figure out. My feeling is though, since rel is intended to provide context to the href that browsers would end up ignoring it.

Either way, I think @Malvoz nailed it with <span aria-roledescription="author">John doe</span>.


#34

@Garbee

Either way, I think @Malvoz nailed it with <span aria-roledescription="author">John doe</span>.

The downside is that authors (the web authors that is) may use different naming conventions. For example devs might do aria-roledescription="author|writer|person|...".

Other than that, it should be perfectly understandable from a screen-reader users perspective.

The problem with having different web authors labelling things differently makes for an inconsistent web experience for disabled users (e.g. labelling site navigation differently <nav> type attribute proposal).

:confused:


#35

The aria-roledescription would be ignored by screen readers, because according to https://www.w3.org/TR/wai-aria-1.1/#aria-roledescription

User agents MUST NOT expose the aria-roledescription property if any of the following conditions exist:

  1. The element to which aria-roledescription is applied does not have a valid WAI-ARIA role or does not have an implicit WAI-ARIA role semantic.

#36

@prlbr

Ouch, even if there was an element with an implicit ARIA role that would somewhat fit, e.g. <aside> with the implicit role="complementary":

 <article>
   <header>
     <h1>My article</h1>
     <aside aria-roledescription="Author">
       John Doe
     </aside>
   </header>
 ...
 </article>

it seems overly complex, and restrictive to try and simply markup an authors name.

Question is, how important is it to distinguish the name of the author from the rest of the content? IMO, there is value in the <author> element because of accessibility concerns. Or as mentioned before, this is something that should be brought up in ARIA itself.


#37

Schema.org is a pretty common vocabulary. In RDFa you can say e.g.

<div vocab="https://schema.org/" typeof="CreativeWork">
<p>blablabla</p>
<p property="author">Jo Donne</p>
</div>

This is simple enough that you can also use microdata, something like

<div itemscope itemtype="https://schema.org/CreativeWork">
<p>blablabla</p>
<p itemprop="author">Jo Donne</p>
</div>

Existing use of this approach for the specific author property is millions of distinct domains.


#38

@chaals your case have bad style. Use <div>, which is apply at the worst case, use schema.org - is not native HTML. As I talked also you could use schema instead <cite> element. You don’t see main problem what <cite> element can’t exist without new <author> element. Without <author> element <cite> element have break semantic. It’s like <td> without <tr>


#39

Why does this have to be a native element? What low-level browser capability is this providing that can’t be achieved using existing markup techniques and JavaScript? You’re asking that browser vendors spend many hours adding in an element that’s too specific and doesn’t have clear results to web developers. This goes against the extensible web manifest that is trying to be followed.

If metadata markup will do exactly what you want, then build a custom element for it and share it around. Encourage developers to use it to improve their sites. If it gets enough traction and is used widely enough, then maybe browser vendors could build a native element for it.

You keep saying “it must be native”, well why must it be? Stop repeating how “they must go together or it means nothing”. That’s deflecting from the real issue. Explain what this element needs the browser to do internally to improve the web.

FTR though, I’m in alignment with what others have already said. Author as the name is way too specific. It is not “uncategorized”, author is defined as someone who writes a literary work. Your example of “Mazda” authoring a new engine is incorrect. New engines are design, engineered, and manufactured.


#40

@Garbee Why does this have to be a native element? - because <cite> element is native. And element can’t exist without new <author> element. So let’s remove <cite> element and everything will be good and will not be needed in new <author> element. For browser vendors it will not take many hours because it is semantic element like <cite> and it is very easy for implementation. I didn’t say that they must go together or it means nothing though in most often cases it really so. I say <cite> element was made some time ago and today it is real problem because the creators of the cite element did not consider that <cite> element can not exist without a new <author> element. And today, Colleagues, we must correct what our past editors have overlooked. You say that is deflecting from the real issue. But it’s don’t. My issues - real issues about problem of HTML standard. And I show problem cases. For improve the web new element <author> will made clear semantic (examples look above) which overlook last editors of element. For improve the web we should made HTML specification without bugs. <cite> (native element) is semantic element and when semantic element themself have break semantic - it’s too bad for web. Also new <author> element could use with filter. For example too often news, articles or some text of site have creative work (<cite> element) and author of creative work (new element). And browser colud help assistive and non assistive peoples by added internal filter or site builders could add filter for <cite> and <author> element. For example if someone site-builder made article about something invention device (<cite> element) and author of invention device (creative work) for example <author>Microsoft</author>. Filter could help find important information in site. Creative work and author of creative work too often used in site pages like it’s news, notes and anything. My friend, why do you think that author is who write a literary work? Author of creative work can produce any work. And if you right understand <author> element exactly Mazda is author of creative work in case above. “bird 3000” is creative work. And who author of creative work? - “Mazda”