Re: [css21-selectors] Interpretation of attribute selector

On 6/2/10 2:13 PM, Belov, Charles wrote:
>>> p[style="text-align:justify;"] {
>>> 	text-align:left;
>>> }
>>
>> This is what I claimed was rare.  That doesn't help the few
>> people trying to do it, of course.....
>
> Presumably it would become less rare once WCAG 2.0 becomes a
> recommendation.

I don't see why...

> From
> http://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast :
>
> 1.4.8 Visual Presentation:  For the visual presentation of blocks of
> text, a mechanism is available to achieve the following: (Level AAA)
>
>     3. Text is not justified (aligned to both the left and the right
> margins).

Selecting on the style attribute is the wrong way to do that, though, 
since it will ignore "justify" alignment assigned through other means. 
If you think that WCAG requires a way for pages to dynamically change 
all "justify" alignments to "left", then you need a different facility 
to do it (either use script or explicit UA support).

>>     p[style="text-align: justify;"], p[style="text-align:justify;"] {
>>       text-align: left;
>>     }
>>
>> This will obviously not work if the @style has more stuf in
>> it, etc, but neither did your original selector above.
>
> Alas, it appears not to work at all, producing justified text in Firefox
> 3.6.3 Windows, Safari 4 Windows and Internet Explorer 8.
>
> Please see http://www.sfmta.com/cms/testSelectorD.htm .

See Zack's answer.

-Boris

Received on Wednesday, 2 June 2010 19:08:01 UTC