- From: James Craig <jcraig@apple.com>
- Date: Mon, 03 Feb 2014 15:59:57 -0800
- To: "Tab Atkins Jr." <jackalmage@gmail.com>
- Cc: www-style list <www-style@w3.org>
Hi Tab et al, On Nov 15, 2012, at 3:25 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote: > 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. Do you have an estimate for when the ‘alt’ property will be available in a draft of CSS4? I need to reference this from another spec. The section of the ARIA text alternative computation covering CSS generated content is woefully incomplete, and I’m hoping to fix it for ARIA 1.1. James
Received on Tuesday, 4 February 2014 00:00:24 UTC