Re: foo {content:title} - a proposal

Le 13/03/2013 16:21, Leif Halvard Silli a écrit :
> Yes. In Webkit. But it isn’t my impression that we are moving towards a
> situation where*more*  user agents support generated content for void
> elements. Am I wrong? Opera used to have the best support for generated
> content on void elements - <input> and <img>. But then they willfully
> disabled much of what they could do, in order to conform to CSS 2.1 -
> or what do I know why they did it. And, since I some Opera engineers
> info gave me that info, they have "disabled" their entire rendering
> engine. There is no progress in Firefox and IE, that I am aware of.
>
> Thus, the generated content field for void elemnets seems to me like a
> where the only that is moving, is Webkit. Perhaps one could bring more
> vendors along with a content:title; ?

The ::before and ::after pseudo-elements generate CSS boxes *inside* the 
box generated by the element itself, before/after the first/last child.

For *replaced* elements like <img> and <input>, everything "inside" is 
ignored and replaced by something else. Therefore, I think it is 
consistent with the rest of CSS that ::before and ::after don’t do 
anything on replaced elements.

We had a proposal for an ::outside pseudo-element:
http://www.w3.org/TR/css3-content/#wrapping

It can be combined as eg. ::outside::after. These would work on replaced 
elements, but were apparently never implemented and removed from the ED. 
Anyone knows why it was removed?


That said, I see another part to this proposal: `content: attr(title)` 
takes the attribute. But in the given example:

   <label title="Advisory text.">
      <input type="text" />
      <span><::before>Advisory text</::before></span>
   </label>

… the title is taken from an ancestor. Does HTML have a concept of title 
being "inherited" like lang?

So the second part of the proposal is a "title" keyword to do that. This 
used case is covered by GCPM’s named strings:

http://dev.w3.org/csswg/css3-gcpm/#named-strings

-- 
Simon Sapin

Received on Wednesday, 13 March 2013 16:02:28 UTC