Re: [css-regions] Concern about CSS regions flowing into generated content

Hi Elliott,

I'd like to know you if you have reconsidered the issues with allowing pseudo-elements become regions since the last reply to this thread.

>From a specification standpoint, the behaviour for pseudo-elements is currently defined like this:
"If the ‘content’ property computes to something else than ‘normal’ (or ‘none’ for a pseudo-element), the block container does not become a CSS Region. If the ‘content’ property computes to ‘normal’ (or ‘none’ for a pseudo-element), then the block container becomes a CSS Region and is ordered in a region chain according to its document order."

This definition basically allows a pseudo-element to become a region only if the content property evaluates to "none". This way the content property will always have priority and the pseudo-element's box will be used to flow content if nothing else is specified.

Regarding the WebKit implementation, do you think that closing https://bugs.webkit.org/show_bug.cgi?id=95117 will also solve the fragility concerns of the pseudo-elements in WebKit? If not, is there something you think I can help you with?

Thanks,
Andrei.

On Jul 28, 2012, at 2:24 AM, Elliott Sprehn <esprehn@gmail.com> wrote:

> 
> On Thu, Jul 26, 2012 at 7:47 PM, Alan Stearns <stearns@adobe.com> wrote:
> On 7/26/12 6:49 PM, "Elliott Sprehn" <esprehn@gmail.com> wrote:
> ...
>  
> 
> Elliot,
> 
> There are two ways that generated content interacts with named flows and
> regions. First, an element can be redirected to a named flow. The
> generated content associated with that element will be rendered in the
> region chain along with the element. Second, a CSS Region itself may have
> generated content, and section 5 describes how that content interacts with
> the named flow content in the Region Box. In both of those cases,
> generated content is limited to the current set of possibilities, so I do
> not think that is what you're asking about.
> 
> Yeah, I understand these cases and they seem fine.
>  
> 
> The flow-from property applies to non-replaced block containers. A
> ::before pseudo-element with display:block could have flow-from apply. In
> this case, generated content for the pseudo-element is not visually
> formatted, and we merely use the CSS-generated box from the pseudo-element
> as part of the region chain. That's the use case - defining a box in CSS
> rather than a box from an HTML element to use as a CSS Region.
> 
> This is the part that concerns me, since this box is now part of the region chain you could end up rendering a link or an input inside a generated content box which wasn't allowed before.
>  
> 
> So the fragment of the named flow that flows through the pseudo-element
> box isn't "inside" the generated content. It's only "inside" the
> CSS-generated box, and the pseudo-element's generated content is not
> displayed. Does this address your concern?
> 
> Can you give an example of a real world use case for this feature? I understand what it does, but I don't understand why you'd ever actually want to do this.
> 
> For example the below was never possible before, and it seems really bizarre that the way you can now put random content like form controls into pseudo elements is Regions. If we want pseudo elements to be able to contain anything we should spec the content property as allowing a ref(#id) or something, but Regions doesn't seem like the right way to introduce such a feature to the platform.
> 
> Webkit's implementation of pseudo elements is also very fragile and buggy, so this feature doesn't work how you'd expect in many cases.
> 
> Could we break this part of the Regions spec out for a different time? It doesn't seem critical for real world usage of Regions, it has a high implementation cost, and it introduces some weirdness in the platform.
> 
> <style>
>     #content {
>       -webkit-flow-into: example;
>     }
>     #region::before {
>         -webkit-flow-from: example;
>         content: "";
>         display: inline-block;
>         vertical-align: top;
>         width: 5em;
>     }
> </style>
> 
> <div id="content">
>     <button>Example</button>
> </div>
> <div id="region">
>     Content.
> </div>
> 

Received on Wednesday, 10 October 2012 12:05:43 UTC