This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 22907 - decide what to do with cite="" attribute
Summary: decide what to do with cite="" attribute
Status: RESOLVED WORKSFORME
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: PC All
: P2 enhancement
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-09 15:15 UTC by Michael[tm] Smith
Modified: 2014-09-26 15:43 UTC (History)
2 users (show)

See Also:


Attachments
patch (1.87 KB, patch)
2013-08-09 15:15 UTC, Michael[tm] Smith
Details

Description Michael[tm] Smith 2013-08-09 15:15:33 UTC
Created attachment 1385 [details]
patch

In the source for the spec, there are some instances of <blockquote> and <q> elements that have "cite" attributes. They're not serving any useful purpose and currently cause the validator to emit warnings so I propose they please just be dropped.
Comment 1 Ian 'Hixie' Hickson 2013-08-09 19:58:59 UTC
They provide the purpose of saying where the text is quoted from. Why would it be better for that to be in a comment that in an attribute?
Comment 2 Michael[tm] Smith 2013-08-11 12:50:15 UTC
(In reply to comment #1)
> They provide the purpose of saying where the text is quoted from.

Right, but only to somebody who looks at the HTML source of the spec. There are no UAs I'm aware of that actually expose that information in the browser UI.

> Why would
> it be better for that to be in a comment than in an attribute?

It'd be better in that it wouldn't cause the validator to emit a warning :-) But I don't feel strongly about this bug, so feel free to wont-fix it. It may be that the better fix is to drop the warning from the validator sources.
Comment 3 Ian 'Hixie' Hickson 2013-08-12 21:30:33 UTC
The ideal fix is probably for browsers to expose the citations somehow, but yeah, I dunno. I agree this isn't an idea situation. Leaving this bug open to figure out what to do with cite="" in general.

If it's in the language, it makes sense for the spec to use it. If it doesn't make sense for the spec to use it, it probably shouldn't be in the language.
Comment 4 Ian 'Hixie' Hickson 2013-12-05 19:02:40 UTC
I'm starting to lean towards just dropping cite="". Which isn't super great, but if nobody cares enough to implement it...
Comment 5 Ian 'Hixie' Hickson 2013-12-05 19:27:14 UTC
Another option would be to introduce a new element <credit>, which would go either in <blockquote> or <figcaption> elements, inside of which an <a href=""> would implicitly be the citation reference. This would also solve some other problems at the same time...
Comment 6 Michael[tm] Smith 2013-12-06 08:17:01 UTC
(In reply to Ian 'Hixie' Hickson from comment #4)
> I'm starting to lean towards just dropping cite="". Which isn't super great,

I wouldn't lose any sleep if it were dropped. But assuming you mean that it'd become non-conforming, I guess the next problem I'd personally have is people filing bug reports complaining that the validator is telling them that all their documents containing cite="" are now invalid.

The original proposal in my bug report was just to have the HTML spec source drop the instance of cite="" that the spec source contains. I'd still be happy if I just got that :)

> but if nobody cares enough to implement it...

As far as I can see, most authors using cite="" now don't care that it's not implemented in browsers. They're not clamoring for it to be implemented. They're just using it for their own reasons (maybe bad ones but maybe good ones) and they don't care that browsers don't do anything with it, and their users don't care that browsers don't do anything with it.

That said, I guess it's possible that some authors who are using it now may just rely on some custom JS code or some JS library that implements support for exposing cite="" to users. So they do implement support for it in their documents, and they would like for cite="" to remain conforming, and so it might be reasonable for us to keep it conforming.

Anyway, FWIW, I think the reason nobody cares enough to implement it is that it's not actually solving any real problem that users and authors want solved. Right now if authors want to let users know where a particular quotation came from, they  can (and do) do that trivially just by wrapping some part (or all) the text of the quotation or its attribution in an <a> element.

cite="" seems to me like that a classic case of a spec writer having written up a solution for a non-problem that authors and users never had, and so never asked anybody to solve for them.

Sadly though, now that cite="" exists I'm sure there are authors who consider it a sacred part of HTML that we shouldn't mess around with and who would complain loudly about us dropping it. 

(In reply to Ian 'Hixie' Hickson from comment #5)
> Another option would be to introduce a new element <credit>, which would go
> either in <blockquote> or <figcaption> elements, inside of which an <a
> href=""> would implicitly be the citation reference.

See what I said above about there not being any real problem to solve here, as far as I can see :) But even if there were, I don't see how adding a new element like <credit> would solve it any better than cite="". And I don't see that implementers would care any more about implementing <credit> than they do (don't) about cite="". 

> This would also solve
> some other problems at the same time...

I'm curious about what other problems you think it'd solve (but not that curious...)

(In reply to Ian 'Hixie' Hickson from comment #3)
> The ideal fix is probably for browsers to expose the citations somehow, but
> yeah, I dunno. I agree this isn't an idea situation. Leaving this bug open
> to figure out what to do with cite="" in general.
> 
> If it's in the language, it makes sense for the spec to use it. If it
> doesn't make sense for the spec to use it, it probably shouldn't be in the
> language.

(In reply to Ian 'Hixie' Hickson from comment #3)
> The ideal fix is probably for browsers to expose the citations somehow,

I think that's not actually the ideal fix. Browsers already can expose the citations when the authors simply add a plain-old user-visible hyperlink in their markup, which is essentially no more work for them to do than adding cite="" (or <credit>). And just adding a hyperlink is what most authors do already now. And users don't seem to feel it's a hardship that they currently lack some other means for having the URL for a cited source exposed to them.

I'm actually pretty glad that implementers have so far had the good sense so far not to implement cite="". Because the code and the UI for it would just be one more thing that'd need to be tested, and one more thing to maintain and fix bugs in, without bringing any significant new benefit to users.

> If it's in the language, it makes sense for the spec to use it.

I don't think the source of spec has to try to use every possible feature of the language. The language has plenty of other features that are of marginal value that the spec is already also not using (e.g., hreflang="" or any number of other things). I don't see what makes cite="" so special that you're compelled to actually use it.

Maybe if the spec itself provided some way (through JS) to expose its cite="" contents to users (similar to the way the <dfn> links are exposed), then it would make sense for the spec source to use it. But given that you can already expose the ULRs for cited sources to users just with a simple <a> element, I personally wouldn't see much point in trying to do it some other way.

> If it
> doesn't make sense for the spec to use it, it probably shouldn't be in the
> language.

In a perfect world, yeah. But in the actual imperfect world we find ourselves in, I think there's not much harm caused by keeping cite="" in the language even though browsers don't (won't) implement it. I think there's some harm that could be caused by dropping it outright -- in that as I mentioned above, some authors may have documents that provide some custom JS thing that exposes cite="" contents to users, and so for them it would be bad for us to just unilaterally now make cite="" invalid.

I still think the best solution is just for the spec to not use cite="" -- in the same way the spec also doesn't use hreflang="" or whatever.
Comment 7 Ian 'Hixie' Hickson 2013-12-06 18:51:10 UTC
(In reply to Michael[tm] Smith from comment #6)
> 
> As far as I can see, most authors using cite="" now don't care that it's not
> implemented in browsers. They're not clamoring for it to be implemented.
> They're just using it for their own reasons (maybe bad ones but maybe good
> ones) and they don't care that browsers don't do anything with it, and their
> users don't care that browsers don't do anything with it.

Right. That's basically the case with the way the spec uses it. It's a way for me to note where those quotes came from, mostly for my own purposes when editing the spec.


> I'm curious about what other problems you think it'd solve (but not that
> curious...)

For example, it would be a much saner solution to the problem that's caused the W3C HTML spec to fork in its definition of <blockquote> than the actual solution the W3C HTML spec currently has.


> I still think the best solution is just for the spec to not use cite="" --
> in the same way the spec also doesn't use hreflang="" or whatever.

The spec doesn't use cite="" for the sake of it, it's using it exactly as specified because it's appropriate in that context. If there was some reason hreflang="" was appropriate for the spec (e.g. to link to translations), it would do so too.
Comment 8 Michael[tm] Smith 2014-01-26 14:00:45 UTC
I notice that the spec actually clearly says that the "cite" attribute is "primarily intended for private use (e.g. by server-side scripts collecting statistics about a site's use of quotations), not for readers".

So, given that along with the rest of the comments in this bug, I don't feel strongly about there being a big need to have native browser support for "cite" in order to justify keeping it in the spec. (Nor do I think it's appropriate any longer for the validator to emit a warning about cite not being supported in browsers, so I've removed that warning from the validator).
Comment 9 Ian 'Hixie' Hickson 2014-09-25 23:04:37 UTC
I think I'm just going to leave it. There's little value in keeping it, but even less in removing it, so...
Comment 10 Michael[tm] Smith 2014-09-26 15:43:38 UTC
(In reply to Ian 'Hixie' Hickson from comment #9)
> I think I'm just going to leave it. There's little value in keeping it, but
> even less in removing it, so...

Yeah, sounds like the right call