Re: CSS issue: Need fallback alternatives for CSS generated *text* content containing unicode glyphs

On Thu, Nov 15, 2012 at 3:09 PM, James Craig <jcraig@apple.com> wrote:
> On Nov 15, 2012, at 2:48 PM, "Tab Atkins Jr." <jackalmage@gmail.com> wrote:
>
>> On Thu, Nov 15, 2012 at 2:13 PM, James Craig <jcraig@apple.com> wrote:
>>> An alternate solution, that was proposed off-list, was for CSS to offer another property to indicate whether the value of the content property was considered decorative or not.
>>>
>>>        .expandable:before {
>>>                content: "\25BA"; /* a.k.a. ► */
>>>                generated-content: decorative; /* something like this? like adding aria-hidden="true", but applied to the psuedo-element */
>>>        }
>>
>> In this vein, I'm not opposed to a similar approach, where we define
>> an "alt" property that only applies to pseudo-elements and takes a
>> <string> as its value.  The presence of 'alt' means that 'content' is
>> decorative, and you should read 'alt' instead.  Absence means you
>> should read 'content' as normal.
>
> Just to be clear, you're talking about this, right?
>
>         .expandable:before {
>                 content: "\25BA"; /* a.k.a. ► */
>                 alt: ""; /* aria-expanded="false" already in DOM, so this pseudo-element is decorative */
>         }
>
> And this:
>
>         .new:before {
>                 content: "\2730";
>                 alt: attr(data-new); /* allows for localized content from the DOM, e.g. @data-new="New!" */
>         }
>
> I think that sounds okay, but have a few questions:
>
> 1. Should the 'alt' property only apply when content has been replaced, or would it apply at all times?
>
>         .foo:before { alt: "This text only available to assistive technology?"; }  /*e.g., no visibly rendered content for the pseudo-element. */

If 'content' isn't set to a non-"none" value, the pseudo-element isn't
generated at all, so no.

> 2. Would you also expect this to override content of native DOM elements, rather than just pseudo-elements?
>
>         <foo style="alt:'baz';">bar</foo> <!-- Potentially confusing to authors. I'm not sure it'd be a good idea on actual elements. -->

No, just pseudo-elements.  Specifically, just ::before and ::after for now.

> PS. How should I track this request? File a bug? WG Issue?

We track these things through WG email, so you're already covered.

~TJ

Received on Thursday, 15 November 2012 23:26:35 UTC