- From: Alan Stearns <stearns@adobe.com>
- Date: Fri, 22 Mar 2013 16:12:17 -0700
- To: Mihnea-Vlad Ovidenie <mihnea@adobe.com>, "www-style@w3.org" <www-style@w3.org>
On 3/22/13 6:32 AM, "Mihnea-Vlad Ovidenie" <mihnea@adobe.com> wrote: >Hi, > >CSSRegions spec [1] has a paragraph describing the computation of offset* >attributes for elements laid out in a named flow. However, it does not >mention explicitly if/how collecting an element inside a named flow >affects the way *offsetParent* [2] is determined. > >For instance, in the case of the following markup: > ><div id="contentNode" style="flow-into: flow"> ></div> > >What should *document.getElementById("contentNode").offsetParent* return? > >In my opinion, it should return *null*, meaning that the algorithm of >determining the closest positioned containing element for an element >collected in a named flow should stop at the named flow level (and return >null in this case). > >Thoughts? > >[1] http://dev.w3.org/csswg/css3-regions/#cssomview-offset-attributes >[2] >http://dev.w3.org/csswg/cssom-view/#extensions-to-the-htmlelement-interfac >e I do not think it should return null. But I don't think that following the algorithm defined in cssom-view for fragmented content is necessarily the right thing to do either. That algorithm doesn't take fragmentation contexts into account. Since the various offset properties are concerned with the edges of the CSS layout box, it makes much more sense to me to update the algorithm to accommodate fragment containers. Instead of only considering ancestor elements in step 2 of the offsetParent algorithm, I think it should walk the ancestor chain up to the nearest fragment boundary, then hop to the fragment container and walk its ancestry (repeating for as many fragmentation contexts as are nested). Thus the result could be the region containing the element, or a positioned ancestor of that region. If and when columns or overflow:fragment boxes can be positioned, this will be an issue for those fragmentation contexts as well. And in a paginated view case, I think it will be much more useful to return the page containing the element. Thanks, Alan
Received on Friday, 22 March 2013 23:12:47 UTC