[css-regions][css-overflow] enhancing overflow:fragments use case 2

Hey all,

The next case I'd like to describe is taking an instance of
overflow:fragments and enhancing what's available to a JavaScript
developer by adding a named flow. There are a lot of capabilities we've
defined in Regions CSSOM [1] that are applicable and potentially useful in
an overflow:fragments layout.

So let's assume you have an element with overflow:fragments. It has
content that might or might not fragment across multiple boxes. Its
pseudo-element styling defines the boxes and their positions. There are
some questions about this element that would be difficult or impossible to
answer in a script:

1. Which box(es) does a content element belong to?
2. What are the contents of a particular box?
3. How many boxes were generated?
4. Were enough boxes generated?

If you add flow-from and flow-into to the overflow:fragments element, the
contents of the element can become a named flow, and then the answers to
the questions above become easy to access:

#frag-element {
  overflow:fragments;
  flow-into: frag-flow content;
  flow-from: frag-flow;
}

The addition of flow-into and flow-from in the manner above should have no
effect on the layout of #frag-element. The only change is that the content
now belongs to the 'frag-flow' named flow, and the fragment boxes the
element generates are considered a region chain for that named flow. Now
all of the CSSOM for named flows kicks in, and you have access to more
information about the fragmented content.

Simple cases of overflow:fragments won't need these extra capabilities,
but if they are needed then using named flows as an overflow:fragments
enhancement gives the developer access without having to change anything
else about their design.

Thanks,

Alan

[1] http://dev.w3.org/csswg/css-regions/#cssom_view_and_css_regions

Received on Tuesday, 8 October 2013 00:55:10 UTC