Re: [css-content][css-pseudo] alt missing from generated content module? moved?

> On May 11, 2016, at 10:40 AM, fantasai <fantasai.lists@inkedblade.net> wrote:
> 
> On 05/11/2016 09:50 AM, Dave Cramer wrote:
>> On Wed, May 11, 2016 at 9:39 AM, James Craig <jcraig@apple.com> wrote:
>>> Example 21 and 22 in the "Automatic Counters and numbering section"
>>> 
>>> https://drafts.csswg.org/css-content-3/#counters
>>> 
>>> ...reference the "alt" property that was previously defined in this spec.
>>> 
>>> Will someone point me to the new location of that property definition?
>>> 
>>> I could not find it in Pseudos either.
>>> https://drafts.csswg.org/css-pseudo-4/
>>> 
>> 
>> It's an editing error—I'll fix the examples. Fantasai pointed out that
>> having a separate alt property was a problem, as it would not cascade
>> with the content property itself.
> 
> See https://lists.w3.org/Archives/Public/www-style/2014Nov/0046.html

Yes. I started and was active in the thread from 2014, but a refresher indicates it faded without any indication the property would be removed.

>> So we're proposing to have
>> alternative text as part of the syntax of the content property itself,
>> by allowing a slash at the end of the property followed by an alt text
>> string. Here's an example:
>> 
>> hr::before { content: "* * *" / "" }

Doesn't this break backwards compatibility of the content property? Now web developers would have to duplicate their assignment with and without the slash.

content: "\2730"; /* for legacy UAs */
content: "\2730" / "New!"; /* for newer UAs that recognize the slash syntax */

It's also much less understandable, IMO.

>> In this case, using the empty alt string to indicate that the string
>> inserted via the content property is purely decorative. If an image is
>> inserted via content property, one could express proper alt text as
>> well
>> 
>> foo::before { content: url('bar.jpg') / "alt text for bar.jpg image" }

Why not just use the original comma-based syntax here?

content: url(example.png), "text alternative";

Alternately, you could define an alt() syntax to make it more readable:

content: url(example.png), alt("text alternative");

And/or the CSS spec could extend the meaning of content fallback so that two sequential text strings define the rendered text and its alternative:

content: "\2730", "New!"; /* "New! as alt text for the visibly rendered ✰ character. */

James

PS. If the CSSWG meeting is continuing on Thursday, I'm in the same building (4th floor) for unrelated an Accessibility API meeting. I'm happy to step out and join CSSWG for a time to discuss. 

Received on Thursday, 12 May 2016 06:20:47 UTC