Re: [css3-regions] flow-into: <ident> content-only

On Fri, Apr 19, 2013 at 4:57 PM, Brad Kemper <brad.kemper@gmail.com> wrote:
> On Apr 19, 2013, at 3:28 PM, "Tab Atkins Jr." <jackalmage@gmail.com> wrote:
>>> I think that would be odd, if the border was left behind, and an un-border-able image was sent into the flow. Which box would be affected by something like 'img { width:100px; }', and does the answer change if you had 'box-sizing:border-box'?
>>
>> It's no odder than "<p style='flow-into: foo contents;'>foo</p>",
>> which leaves the border behind and flows an unborderable anonymous
>> text node into the flow.  We already have a concept of "things that
>> aren't boxes, but still live in the box tree", this would just be
>> adding a new one.
>
> I disagree. I think it would be much odder. With text, you get font-size and other font and text properties from the new container (presumably) and the lines still wrap naturally in the new container because the line boxes still exist. What is the width and height of the image when it is content-only? Does it just fill the width of the new container? Can you no longer select it to set a width and height (or if you could select it and set those two properties, then could you set border on it as well, resulting in two borders, one attached and the other detached)?

(Actually, you get your styles from your original container.  You need
to use @region to override that.)

I assume that replaced content assumes its size from its original
container.  Just like naked text, you won't be able to select it - it
lives in the box tree, not the element tree.

> As well, I see no benefit of having images, videos, iframes, or form elements that can no longer be selected and styled because their element boxes are somewhere else. Is this just for purity?

No, it's practical.  For one, it lets "contents" work similarly across
all elements, whether they contain elements, text, or replaced
content.  For two, it formalizes the concept of "replaced content",
which means we can build on top of that in Web Components.

We actually already have this somewhat - using "content:
url(some-image);" in a ::before creates an image that is untargetable,
unstyleable, etc.  Pulling an the content out of an <img> would be the
same.

~TJ

Received on Saturday, 20 April 2013 00:30:52 UTC