Re: Expected behaviour of quotation marks

On 06/04/2016 19:48, ishida@w3.org wrote:
> This is a question about how quotation marks should behave in
> multilingual text.


I created some tests for the q element in HTML, with results for major 
browsers. See

https://www.w3.org/International/tests/repo/results/the-q-element


SUMMARY

[1] all major desktop browsers put quote marks around content using the 
q element

[2] they all use two different quotation marks for nested quotations, 
but they don't rotate the usage - they just use the secondary quote 
marks for third and more nested qs

[3] Chrome, Opera, Safari and Edge all change quote marks as the 
language changes.  Firefox doesn't.

[4] The browsers that are language-sensitive follow the recommendations 
in the HTML5 spec (taken from CLDR) wrt which quotes are used by which 
language, except that Safari doesn't do the whole list, and occasionally 
inverts the primary and secondary quote marks.

[5] Only in Firefox however do the quote marks match the HTML5 
recommendation when no language is specified.

[6] Browsers that are language-sensitive use the CSS rules defined in 
the HTML5 spec for the default presentation.  This means that the quote 
marks used around a quotation are based on the language of the quotation 
itself - even at the top level.

This means that in an English paragraph our example

<p>But Lucy replies: <q lang="fr-CA">Embrassez George de ma part - 
seulement une fois. Dites-lui, <q>Embrouille.</q></q>.</p>

will produce:

But Lucy replies: «Embrassez George de ma part - seulement une fois. 
Dites-lui, ‹Embrouille.› ».

instead of what people on this thread expect, which is

But Lucy replies: “Embrassez George de ma part - seulement une fois. 
Dites-lui, ‘Embrouille.’”.


A FLY IN THE OINTMENT

Florian's CSS

:lang(fr-CA) > *:not(q *) { quotes: "« " " »" "‹ " " ›" }
:lang(en)    > *:not(q *) { quotes: "“" "”" "‘" "’" }

produces what's needed for the example as written above. However, there 
is one situation where it fails, and where afaict, there's not actually 
a way to produce the desired result.

If we change our markup slightly, changing the first q into a span, we 
introduce the change in surrounding language before the q element is 
encountered.

<p>But Lucy replies: <span lang="fr-CA">Embrassez George de ma part - 
seulement une fois. Dites-lui, <q>Embrouille.</q></span>.</p>

In this case, the quotation is displayed with the quote marks 
appropriate for the surrounding language, but the surrounding language 
is not the language of the reader (ie. that of the paragraph, ie. en). 
The result is:

But Lucy replies: Embrassez George de ma part - seulement une fois. 
Dites-lui, « Embrouille. ».

ie. we now have French quotes around the word Embrouille.  As failures 
go, i could imagine far worse.  It's still possible to argue that 
there's some logic in having the French quotes here, even if it's not 
really what we want, so it's not a complete disaster.

I can't really see a way around it, other than to *only* set the default 
quote marks on the basis of the language declared on the html tag. (The 
user would have to replicate that using CSS for elements lower down the 
hierarchy if they have a multilingual document.)

Thoughts?

ri

Received on Friday, 15 April 2016 13:31:42 UTC