- From: Andrew Fedoniouk <news@terrainformatica.com>
- Date: Sat, 8 May 2010 12:05:37 -0700
- To: "L. David Baron" <dbaron@dbaron.org>, "Robert O'Callahan" <robert@ocallahan.org>
- Cc: "Tab Atkins Jr." <jackalmage@gmail.com>, "www-style list" <www-style@w3.org>
--------------------------------------------------
From: "L. David Baron" <dbaron@dbaron.org>
Sent: Saturday, May 08, 2010 8:05 AM
To: "Robert O'Callahan" <robert@ocallahan.org>
Cc: "Tab Atkins Jr." <jackalmage@gmail.com>; "www-style list"
<www-style@w3.org>
Subject: Re: [css3-content] "content" property, replaced elements, and width
> On Saturday 2010-05-08 23:25 +1200, Robert O'Callahan wrote:
>> On Sat, May 8, 2010 at 7:32 AM, Tab Atkins Jr. <jackalmage@gmail.com>
>> wrote:
>> > CSS 2.1 was not at all clear on how this should work. The current
>> > behavior, though, is almost certainly *not* what we want when
>> > 'content' applies to all elements. What are the feelings of
>> > implementors on the possibility of changing the behavior here?
>> >
>>
>> Not hard to fix in Gecko. It does seem like a weird special case though.
>
> The motiviation for the special case was the extension of 'content'
> to work on elements rather than just pseudo-elements. It is needed
> to make that extension do what authors want. That extension, plus
> this special case, plus the extended attr() function, allows
> 'content' to describe the presentation of a bunch of standard
> replaced elements in HTML (and other languages). That is, with this
> extension, an image element is just displayed using the rule:
>
> img { content: attr(src, url); }
>
David, do you remember any discussion of what should happen
if you have style:
p { content: "test" }
on DOM like this:
<p>foo<span>bar</span></p>
?
p:hover { content: "test" }
case is also interesting.
I've implemented the content: for elements but it
works predictable only for terminal elements only (that have no children).
It has great use in localization especially when combined with constants:
styles.en.css:
@const YES : "Yes";
styles.ru.css:
@const YES : "Да";
button#yes { content: @YES; }
<button #yes>Yes</button>
--
Andrew Fedoniouk
http://terrainformatica.com
Received on Saturday, 8 May 2010 19:06:05 UTC