[css3-regions] content:flow-from(flow) and ::before/::after

I think there is a problem with using "content:flow-from()" to put named flow into a region.

Whatever property is used for "flow-from", it is actually doing two things:

1)      Makes the element a region

2)      Identify the named flow to flow from.
If there was "display-inside:region" it could be used as an explicit trigger. We set display type implicitly but the result is same - element's nature changes when  it becomes a region.

Now, the meaning of 'content' is literally placing content inside an element, not changing the element otherwise.

Consider this:

#region { content:flow-from(foo); }
#region::before { content:"before")
#region::after { content:"after")

The flow "foo" may start at this region, or it may continue from elsewhere (possibly interrupted in the middle of an element, inside a table, or in a thick bottom border).

What is supposed to happen?

I think the generated content spec is very clear about it. It should have exactly same result as actually placing the pseudo-elements in content:

                <div id="region">
                                <span>before</span>
                                ... portion of named flow that fits in this region ...
                                <span>after</span>
                </div>

Now, the element is a region, which means that it completely disregards its own content and replaces it with the named flow:

                <div id="region">
                                ... portion of named flow that fits in this region ...
                </div>

that would be the effect when set on a regular dif. However if the div is a flexbox, "content:flow-from" will be ignored and befor+after will merge into one anonymous flex item:

                <div id="region" style="display:flexbox">
                                <span>before</span>
                                <span>after</span>
                </div>

This makes the definition of "content:flow-from" self-contradictory, or at least underderfined.

Ways to fix it:

1)      Define that "content:flow-from" (when it applies) discards "::before" and "::after"

2)      Define that "content:flow-from" doesn't change the parent element but instead inserts an anonymous region block

3)      Use a different property - "flow-from". It doesn't need to have priority over 'content' because dom content of a regin is  ignored

My preference is (3), as proposed yesterday.

Alex

Received on Tuesday, 26 July 2011 19:19:36 UTC