<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>14948</bug_id>
          
          <creation_ts>2011-11-28 15:43:34 +0000</creation_ts>
          <short_desc>What should getFlowByName return if there is no flow with the given name?</short_desc>
          <delta_ts>2012-04-11 21:06:40 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>CSS</product>
          <component>Regions</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>cssom</status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Vincent Hardy">vhardy</reporter>
          <assigned_to name="Vincent Hardy">vhardy</assigned_to>
          <cc>eoconnor</cc>
    
    <cc>mihnea</cc>
    
    <cc>stearns</cc>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>60537</commentid>
    <comment_count>0</comment_count>
    <who name="Vincent Hardy">vhardy</who>
    <bug_when>2011-11-28 15:43:34 +0000</bug_when>
    <thetext>Feedback from Mihnea-Vlad Ovidenie &lt;mihnea@adobe.com&gt; 

===
1. I have a document that does not have a flow thread. From js, I call document.getFlowByName(&quot;..&quot;). 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.

===</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>65472</commentid>
    <comment_count>1</comment_count>
    <who name="Vincent Hardy">vhardy</who>
    <bug_when>2012-03-13 22:29:01 +0000</bug_when>
    <thetext>So with option 1, we have:

// No flow yet
var nf = document.getFlowByName(&apos;article&apos;); // nf is null

// Add content to &apos;article&apos;
nf = document.getFlowByName(&apos;article&apos;); // nf is not null

// Remove all content from &apos;article&apos;

// nf is now a NamedFlow object that has no content.
nf === document.getFlowByName(&apos;article&apos;); // 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(&apos;article&apos;); // nf is not null

// Add content to &apos;article&apos;
nf === document.getFlowByName(&apos;article&apos;); // evaluates to true

// Remove all content from &apos;article&apos;

// nf is now a NamedFlow object that has no content.
nf === document.getFlowByName(&apos;article&apos;); // evaluates to true..</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>65952</commentid>
    <comment_count>2</comment_count>
    <who name="Vincent Hardy">vhardy</who>
    <bug_when>2012-03-22 16:30:58 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; So with option 1, we have:
&gt; 
&gt; // No flow yet
&gt; var nf = document.getFlowByName(&apos;article&apos;); // nf is null
&gt; 
&gt; // Add content to &apos;article&apos;
&gt; nf = document.getFlowByName(&apos;article&apos;); // nf is not null
&gt; 
&gt; // Remove all content from &apos;article&apos;
&gt; 
&gt; // nf is now a NamedFlow object that has no content.
&gt; nf === document.getFlowByName(&apos;article&apos;); // evaluates to false..
&gt; 
&gt; Since we can have a named flow with no content, I think I would go with option
&gt; 2:
&gt; 
&gt; // No flow yet
&gt; var nf = document.getFlowByName(&apos;article&apos;); // nf is not null
&gt; 
&gt; // Add content to &apos;article&apos;
&gt; nf === document.getFlowByName(&apos;article&apos;); // evaluates to true
&gt; 
&gt; // Remove all content from &apos;article&apos;
&gt; 
&gt; // nf is now a NamedFlow object that has no content.
&gt; nf === document.getFlowByName(&apos;article&apos;); // 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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66128</commentid>
    <comment_count>3</comment_count>
    <who name="Vincent Hardy">vhardy</who>
    <bug_when>2012-03-27 17:06:15 +0000</bug_when>
    <thetext>Changes for this issue:

https://dvcs.w3.org/hg/csswg/rev/d4e15f801ff5</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>