This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Feedback from Mihnea-Vlad Ovidenie <mihnea@adobe.com> === 1. I have a document that does not have a flow thread. From js, I call document.getFlowByName(".."). I assume that this call returns a null object since I do not yet have a flow thread. 2. Another possibility would be to return a valid js object, that, in the future, if the user adds a flowThread with the desired name, gets connected to the flow thread. Should we support 1 or 2? I would say 1 but the spec does not say anything about the lifetime of the NamedFlow objects. ===
So with option 1, we have: // No flow yet var nf = document.getFlowByName('article'); // nf is null // Add content to 'article' nf = document.getFlowByName('article'); // nf is not null // Remove all content from 'article' // nf is now a NamedFlow object that has no content. nf === document.getFlowByName('article'); // evaluates to false.. Since we can have a named flow with no content, I think I would go with option 2: // No flow yet var nf = document.getFlowByName('article'); // nf is not null // Add content to 'article' nf === document.getFlowByName('article'); // evaluates to true // Remove all content from 'article' // nf is now a NamedFlow object that has no content. nf === document.getFlowByName('article'); // evaluates to true..
(In reply to comment #1) > So with option 1, we have: > > // No flow yet > var nf = document.getFlowByName('article'); // nf is null > > // Add content to 'article' > nf = document.getFlowByName('article'); // nf is not null > > // Remove all content from 'article' > > // nf is now a NamedFlow object that has no content. > nf === document.getFlowByName('article'); // evaluates to false.. > > Since we can have a named flow with no content, I think I would go with option > 2: > > // No flow yet > var nf = document.getFlowByName('article'); // nf is not null > > // Add content to 'article' > nf === document.getFlowByName('article'); // evaluates to true > > // Remove all content from 'article' > > // nf is now a NamedFlow object that has no content. > nf === document.getFlowByName('article'); // evaluates to true.. After discussion: Option 1 with the following precisions: - if a flow has never been referenced by CSS or JS, return null. - if a flow was previous created, but no longer exists, the implementation may return null. - if a script holds on to a reference to a NamedFlow, implementations must guarantee that a) the object is valid (can be used) at all times, and b) subsequent calls to getFlowByName with the same name return the same object.
Changes for this issue: https://dvcs.w3.org/hg/csswg/rev/d4e15f801ff5