-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Recommend against using the <q> element (or fix its behavior) #10216
Comments
Aside: the Compatibility Standard is not a good final home. Like the Quirks Mode Standard, it defines some aspects of reality that for one reason or another couldn't be defined closer to the algorithms they are amending in the moment, but ultimately they should be defined as part of those algorithms. (Example: As for the topic at hand: I would be inclined to wait for the generated content issues to be addressed. Making |
Thanks for the point about the Compatibility Standard. I've Do you think there's space to add a warning for authors, even if we don't declare it non-conforming? It'll be easy enough to remove the warning again if and when the generated content issues are fixed. I see that https://drafts.csswg.org/css-ui/#propdef-user-select includes (inside a note) "To the extent possible, authors should avoid using generated content for non-decorative purposes, and should prefer including all the content in the DOM.". We could help authors follow that suggestion by mentioning the possibility of using |
That sounds very reasonable to me. Thanks for thinking of it! |
See whatwg/html#10216 for rationale. Co-authored-by: Jeffrey Yasskin <jyasskin@gmail.com>
See whatwg/html#10216 for rationale. Co-authored-by: Jeffrey Yasskin <jyasskin@gmail.com>
@jyasskin@hachyderm.io I thought I agreed, but here are some concerns I have:
|
I would like to emphasize this issue: using @jyasskin you said:
I'm not sure about this affirmation: it's really hard to find a content website using it, maybe you could give some examples, they will highlight how the Ideally, I would like to see this part of the standard removed:
It will allow us to clear the quotation marks rendered by the browser, and add them inside the q::before {
content: "";
}
q::after {
content: "";
} |
This change would make use of the I would also advice against assuming CSS support. A browser that doesn't recognize your CSS (because the browser can't or doesn't want to, e.g. because it offers its readers a standardized, book-like "reader view" of webpages) would display nested quotes then, yours inside the |
@prlbr You have a point. However, the
|
What problem are you trying to solve?
The
<q>
element adds language- and nesting-appropriate quotation marks around its contents and provides a place for the markup to include a URL for the source of the quotation. However, these benefits are undermined by UA behavior around<q>
elements. In particular:If you try to copy This sentence includes This is a quotation
in Chrome andIf you try to copy "This sentence includes "This is a quotation""
(note the extra closing quotes that weren't in the copied text) in Firefox. It would be possible to fix this, but [css-content] Provide a way to generate copyable content w3c/csswg-drafts#8046 hasn't seen movement in the last 1.5 years.copy "this
and notice the lack of search results. This is confusing when you're a user. This would, again, be possible to fix, but [css-pseudo-4] The browser cannot search the content, is it intentional? w3c/csswg-drafts#6222 also hasn't seen movement. (Firefox can find the quote by itself, but not with any context around it.)cite
attribute is a usability footgun for authors: it makes authors think they've cited their source, but UAs don't actually show it to users, so users can't see the citation. The spec alludes to this, saying "User agents may allow users to follow such citation links, but they are primarily intended for private use (e.g., by server-side scripts collecting statistics about a site's use of quotations), not for readers.", but this was added in 2012 in e0e4b51 becausecite
hadn't been adopted by UAs and Hixie didn't want to remove the uses inside HTML, not because Hixie presented evidence people were actually running server-side scripts on it. This seems like an inversion of the priority of constituencies, valuing theoretical purity over users.To avoid the
<q>
element, authors can insert their own quotation marks, and add a citation link that users can actually see. This may be slightly more difficult, since the curly quotes that<q>
inserts aren't on most keyboards, but many editing tools can infer those, and the benefit to users as described above seems to win over the pain to authors. There probably isn't a significant localization loss in inserting quotation marks manually since the author has to translate the text itself too.Since
<q>
is widely used across the web, it's probably impossible for browsers to actually drop support for it; the only change this issue asks for is for the spec to discourage authors from using it.If people are especially enthusiastic, perhaps we could move it to Compat.What solutions exist today?
Authors can follow "The use of q elements to mark up quotations is entirely optional; using explicit quotation punctuation without q elements is just as correct.", but just saying it's "optional" doesn't focus well enough on the harm to users that comes from using this element.
How would you solve it?
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: