Bug 235591 - q element produces incorrect quotation marks when language changes
Summary: q element produces incorrect quotation marks when language changes
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: Safari 15
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Keywords: InRadar
Depends on:
Reported: 2022-01-25 08:28 PST by r12a
Modified: 2022-02-01 08:29 PST (History)
5 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description r12a 2022-01-25 08:28:15 PST
This issue is common across all languages that use the q element.

When an English page contains a quotation in another language, the quotation marks used around that quotation (and inside it for embedded quotes) should be the English ones – not those of the language of the quotation. The same applies for other languages.

Currently, if the language of the quotation is declared on the q tag in HTML and that tag has a lang attribute, browsers instead set the quotation marks based on the language of the quote.

Quotations work fine in a sentence that is all in the same language. For example, the markup for this Georgian text:

<span lang="ka">ერთი <q>ორი <q>სამი</q></q></span>

will result in:

ერთი „ორი «სამი»“

However, if the quote is in English and lang="en" is added to the first q tag, the result becomes:

ერთი “two ‘three’”

whereas it should be:

ერთი „two «three»“

This incorrect behaviour was initially dictated by the HTML specification. issue 3636 (https://github.com/whatwg/html/issues/3636#issuecomment-384340053) was raised to change the spec. In the end the entire section was removed from the HTML spec, and HTML now relies on CSS for this behaviour.

css-content (https://drafts.csswg.org/css-content/#quotes-property) says that "If a quotation is in a different language than the surrounding text, it is customary to quote the text with the quote marks of the language of the surrounding text, not the language of the quotation itself.", however it is non-normative text.

Issue 5478 (https://github.com/w3c/csswg-drafts/issues/5478), requests that this be made normative, and has been agreed by the CSS WG.

Tests & results:
Interactive test, When an embedded quote is in a different language, the quotation marks should be those of the main body, even if the language of the quote is declared using a lang attribute.
Gecko: ❌ If a lang attribute is used, the quotation marks are those associated with the quotation rather than those associated with the surrounding text. Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:94.0) Gecko/20100101 Firefox/94.0
Blink: ❌ Same. Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36
Webkit: ❌ Same. Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Safari/605.1.15

i18n test suite, Multilingual nesting.

Expected results:

Please use the quote marks of the main paragraph text, rather than change the quote marks to match the embedded quotation.

(This issue is being tracked at https://www.w3.org/TR/geor-gap/#issue22_quotations)
Comment 1 Radar WebKit Bug Importer 2022-02-01 08:29:17 PST