Skip to content

Commit

Permalink
[css-text-3] Initial draft proposed clarification to text-transform i…
Browse files Browse the repository at this point in the history
…nteraction with semantics. #3775
  • Loading branch information
fantasai committed Aug 19, 2020
1 parent df0020d commit 00ad751
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions css-text-3/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,10 @@ Text Processing</h3>
It has no effect on the underlying content,
and must not affect the content of a plain text copy &amp; paste operation.

Note: The 'text-transform' property only affects the presentation layer;
correct casing for semantic purposes is expected to be encoded
in the source text.

<wpt>
text-transform/text-transform-copy-paste-001-manual.html
</wpt>
Expand Down Expand Up @@ -558,6 +562,53 @@ Text Processing</h3>
<pre>abbr:lang(ja) { text-transform: full-width; }</pre>
</div>

Note: The purpose of 'text-transform' is
to allow for presentational casing transformations
without affecting the semantics of the document.
Note in particular that 'text-transform' casing operations are lossy,
and can distort the meaning of a text.
While accessiblity interfaces may wish to convey
the apparent casing of the rendered text,
the transformed text cannot be relied on accurately represent

This comment has been minimized.

Copy link
@bkardell

bkardell Aug 19, 2020

Contributor

Missing a world here I think.. "[to] accurately represent"?

the underlying meaning of the document.

This comment has been minimized.

Copy link
@bkardell

bkardell Aug 19, 2020

Contributor

In the case that brought this to discussion, the transforms are done via an attribute and UA rules. This seems an important distinction? The meaning is in the document - and yeah, you could probably abuse it otherwise too.


<div class="example">
In this example,
the first line of text is capitalized as a visual effect.

<pre highlight=css>
section > p:first-of-type::first-line {
text-transform: uppercase;
}
</pre>

This effect cannot be written into the source document
because the position of the line break depends on layout.
But also, the capitalization is not reflecting a semantic distinction
and is not intended to affect the paragraph’s reading;
therefore it belongs in the presentation layer.
</div>

<div class="example">
In this example,
the [=ruby=] annotations,
which are half the size of the main paragraph text,
are transformed to use regular-size kana
in place of [=small kana=].

<pre highlight=css>
rt { font-size: 50%; text-transform: full-size-kana; }
:is(h1, h2, h3, h4) rt { text-transform: none; /* unset for large text*/ }
</pre>

Note that while this makes such letters easier to see at small type sizes,
the transformation distorts the text:
the reader needs to mentally substitute [=small kana=]
in the appropriate places--
not unlike reading a text in English
with all “s” characters substituted by “f”.

This comment has been minimized.

Copy link
@acli

acli Aug 19, 2020

I’m sorry I’ve not been following the discussion but I’m not sure what use case is being talked about here. What are “s” characters? Or is the “f” supposed to be “ſ”?

This comment has been minimized.

Copy link
@fantasai

fantasai Nov 18, 2020

Author Collaborator

@acli It's not a use case, it's an analogy.

This comment has been minimized.

Copy link
@r12a

r12a Jan 13, 2021

Contributor

I, too, was expecting the f to be ſ (017F LATIN SMALL LETTER LONG S), however whether you should do that with styling or in the content probably varies according to the particular usage. I can see people doing it both ways and being correct. I think the stylistic approach (which i believe can be done by opentype features in some fonts) might be used by someone who is attempting to make some text look old-fashioned for a particular use.

</div>

<p class="note">
Note: As defined in <a href="#order">Text Processing Order of Operations</a>,
transforming text affects line-breaking and other formatting operations.
Expand Down

0 comments on commit 00ad751

Please sign in to comment.