<?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>22203</bug_id>
          
          <creation_ts>2013-05-30 07:00:26 +0000</creation_ts>
          <short_desc>[Shadow]: Define relationships between trees using terms of {child, parent, descendant, ancestor}.</short_desc>
          <delta_ts>2013-07-24 05:14:34 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>HISTORICAL - Component Model</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></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>22716</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Hayato Ito">hayato</reporter>
          <assigned_to name="Hayato Ito">hayato</assigned_to>
          
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>88421</commentid>
    <comment_count>0</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2013-05-30 07:00:26 +0000</bug_when>
    <thetext>A document tree and a shadow tree are used mutually exclusive in the spec.

Can we define a term that can specify either a document tree or a shadow tree?

In addition to that, can we define the relationship of trees using the terms of (child, parent, descendant or ascendent) rather than (nesting, enclosing)?

Hopefully, that makes the spec simpler. For example, we can define an *inclusive-ancestor tree* and use that in the spec.

WDYT?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88456</commentid>
    <comment_count>1</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2013-05-30 16:34:50 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; A document tree and a shadow tree are used mutually exclusive in the spec.
&gt; 
&gt; Can we define a term that can specify either a document tree or a shadow
&gt; tree?

A tree? http://dom.spec.whatwg.org/#concept-tree :)

&gt; 
&gt; In addition to that, can we define the relationship of trees using the terms
&gt; of (child, parent, descendant or ascendent) rather than (nesting, enclosing)?

What&apos;s wrong with nesting and enclosing? I am trying to understand the problem you&apos;re trying to solve.

&gt; Hopefully, that makes the spec simpler. For example, we can define an
&gt; *inclusive-ancestor tree* and use that in the spec.

Where do we need it?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88499</commentid>
    <comment_count>2</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2013-05-31 06:33:21 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; (In reply to comment #0)
&gt; &gt; A document tree and a shadow tree are used mutually exclusive in the spec.
&gt; &gt; 
&gt; &gt; Can we define a term that can specify either a document tree or a shadow
&gt; &gt; tree?
&gt; 
&gt; A tree? http://dom.spec.whatwg.org/#concept-tree :)

Agreed. We can use a tree. :)

&gt; 
&gt; &gt; 
&gt; &gt; In addition to that, can we define the relationship of trees using the terms
&gt; &gt; of (child, parent, descendant or ascendent) rather than (nesting, enclosing)?
&gt; 
&gt; What&apos;s wrong with nesting and enclosing? I am trying to understand the
&gt; problem you&apos;re trying to solve.
&gt; 
&gt; &gt; Hopefully, that makes the spec simpler. For example, we can define an
&gt; &gt; *inclusive-ancestor tree* and use that in the spec.
&gt; 
&gt; Where do we need it?

I&apos;ve come up this idea when I was writing these parts of Event.path.

  If TREE1 and TREE2 are the same, push NODE2 to RESULT
  Otherwise, if TREE1 is enclosed by TREE2, push NODE2 to RESULT

If we had defined relationships between trees, we could rewrite that as:

  If TREE2 is an inclusing ancestor tree of TREE1, push NODE2 to RESULT

Also I could rewrite related target resolution algorithm by using such terms. That would make the section 5, Event, more readable, I hope.



Yet another motivation came from this bug:
  https://code.google.com/p/chromium/issues/detail?id=244779

tasak@ misunderstood the meaning of &apos;enclosing&apos;. That made him implement wrongly. It could be nice if we could avoid such a confusion by using more familar terms.


Also, we can replace &apos;a document tree and a shadow tree&apos; with &apos;a tree and its child tree&apos; in some parts of the spec.

For example,

&gt; Since a node in a document tree and a node in a shadow tree never have the same root, there may never exist a valid DOM range that spans either both a document tree and a shadow tree, or multiple shadow trees.

This sentence should not be applied only to relationship between &apos;a document tree&apos; and &apos;a shadow tree&apos;. That should be applied to &apos;tree and its child tree&apos;.



This is just rough my idea. I am not sure we can get much benefits from these terms. Let me think further...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88500</commentid>
    <comment_count>3</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2013-05-31 06:46:00 +0000</bug_when>
    <thetext>I&apos;ve changed the subject of this issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91202</commentid>
    <comment_count>4</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2013-07-24 05:14:34 +0000</bug_when>
    <thetext>Fixed. The new spec introduced a tree of trees.
https://dvcs.w3.org/hg/webcomponents/rev/dbf47f602628</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>