W3C home > Mailing lists > Public > www-style@w3.org > October 2011

RE: [css3-regions] more API for NameFlow

From: Alex Mogilevsky <alexmog@microsoft.com>
Date: Mon, 17 Oct 2011 17:37:41 +0000
To: Vincent Hardy <vhardy@adobe.com>
CC: www-style list <www-style@w3.org>
Message-ID: <D51C9E849DDD0D4EA38C2E5398569284122C0EB3@TK5EX14MBXC218.redmond.corp.microsoft.com>
Just to be clear on what I am proposing: 'content' property is an array of elements containing all elements that have 'flow-into' property applied. It is NodeList because that's how other APIs return element collections (e.g. getElementByTagName<http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-A6C9094>). I would like to not make assumptions that the collection only has elements though. If in the future there is a way to send content of an element to named flow (Issue 19: Special behavior of iframe flow<http://wiki.csswg.org/spec/css3-regions#issue-19special-behavior-of-iframe-flow>) this will still work.

I am trying to think of a more descriptive name... 'content' actually seems intuitive to me, but let's try something else.
It could be NamedFlow.flowSources. Or NamedFlow.flowContent? NamedFlow.contentNodes?

I guess then NamedFlow.getRegionByContentNode() would also be more explicit.

Alex

From: Vincent Hardy [mailto:vhardy@adobe.com]
Sent: Monday, October 17, 2011 4:52 AM
To: Alex Mogilevsky
Cc: www-style list
Subject: Re: [css3-regions] more API for NameFlow


On Oct 16, 2011, at 11:57 PM, Alex Mogilevsky wrote:


I have ACTION 350 ( http://www.w3.org/Style/CSS/Tracker/actions/350 ) assigned to me, which is titled "Alexmog to add an api to find out which element is in a named flow". I actually thought it is about another missing API - to get region from element, but I guess both are needed, so here we go:


[Supplemental] interface NamedFlow<http://dev.w3.org/csswg/css3-regions/Overview.html#dom-namedflow> {

  NodeList<http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-536297177> content;

  NodeList<http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-536297177> getRegionsByContent(Node<http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-1950641247> node);

};

'content' property returns an ordered collection of nodes that constitute the named flow. Note that this collection is life (general DOM rules for properties): every time it is queried it must return the same object, and the object is always up to date.

getRegionsByContent () gets a collection of regions that contain at least part of the target content. This can be used to navigate by bookmark in paginated view: the method returns regions containing the bookmarked element, which are then passed to pagination UI to show desired region or page.

How does this sound? Any better naming ideas?

This sounds good and it is good to have a live list of nodes in the flow.

In terms of naming, I am wondering if 'content' is too generic. May be 'flowNode' would be more specific, even though more verbose:

[Supplemental] interface NamedFlow {
NodeList flowNodes;
NodeList getRegionsByFlowNode(Node flowNode);
}

Cheers,
Vincent
Received on Monday, 17 October 2011 17:38:13 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:45 GMT