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

On Apr 19, 2013, at 5:30 PM, "Tab Atkins Jr." <jackalmage@gmail.com> wrote:

> 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 stand corrected. But how would you select the image content with @region? You don't need to with text content, because the font and text properties operate directly on the glyphs and line boxes. But most other properties, like width and height, operate on the content box (or on the border box when you have box-sizing: border-box).

> 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.

OK, so I assume you are agreeing that the contents of an image box stuck into a region flow would be similarly unstylable. That just doesn't seem like a good thing to me. I would rather fix "content: url(some-image);" somehow. And I would rather be able to right a general rule about flowing content without worrying if I had it on a class that occasionally selected an image. And then having to write a separate rule for that.

Received on Saturday, 20 April 2013 00:46:48 UTC