[css-break][css-multicol][css-overflow] fragments, fragment containers and visualOffsetParent

Hi


Let's consider a case where a fragmented DIV has multiple fragments over a
multicol element.
<div style="column-count:3">
	<div id="fragmentedDIV">
		Lorem ipsum dolor sit amet, consecteturadipisicing elit, sed do eiusmod
tempor incididunt ut
		<SPAN>labore</SPAN>
		et dolore magna aliqua.
	</div>
</div>



The spec defines box fragment or fragment[1] as
	The portion of a box that belongs to exactly one fragmentainer. A box in
continuous flow always consists of only one fragment. A box in a
fragmented flow consists of one or more fragments.


At this point, UAs create these fragments in the layout phase but they
don't expose them to the web developers.
Accessing the fragments can prove useful to web developers.
Useful information to get for those fragments is their count, position and
size.


* So I'm proposing that every DOM element must have a javascript property
to get the list of fragments.

* Also, for elements that generate fragment containers (multicol, overflow
fragments etc), there must be a javascript property to get those fragment
containers. Useful information to get for those fragment containers is
their count, position and size.

*  Since we have access to fragments and fragment containters, there
should be such APIs as fragmentFromPoint() and
fragmentContainerFromPoint().


* Another proposition is to have a visualOffsetParent property that will
return the fragmentContainer when it's called on an element that's inside
a fragment container.

In the multi column example, visualOffsetParent for the span will return
the column in which it's located.

If the fragmentedDIV is a Containing Block (has position:relative etc),
visualOffsetParent for the span will return that fragment of fragmentedDIV
in which it's located.
visualOffsetParent for the fragment of fragmentedDIV will return its
fragment container.



--
Mihai Maerean

[1] http://dev.w3.org/csswg/css-break/#fragmentation-model

Received on Wednesday, 3 April 2013 16:00:26 UTC