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

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>91014</bug_id>
          
          <creation_ts>2012-07-11 14:12:22 -0700</creation_ts>
          <short_desc>Static NodeList needs to to keep item wrappers alive</short_desc>
          <delta_ts>2013-03-19 13:23:44 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Erik Arvidsson">arv</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>ggaren</cc>
    
    <cc>haraken</cc>
    
    <cc>rniwa</cc>
    
    <cc>sam</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>667041</commentid>
    <comment_count>0</comment_count>
      <attachid>151772</attachid>
    <who name="Erik Arvidsson">arv</who>
    <bug_when>2012-07-11 14:12:22 -0700</bug_when>
    <thetext>Created attachment 151772
Layout test

Currently we do not keep the wrappers of static node lists alive. Both the JSC and V8 bindings get this wrong.

document.body.innerHTML = &apos;&lt;b&gt;&lt;/b&gt;&apos;;
var elements = document.body.querySelectorAll(&apos;*&apos;);
elements[0].customProperty = 42;
document.body.textContent = &apos;&apos;;
gc();
shouldBe(&apos;elements[0].customProperty&apos;, &apos;42&apos;);</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>670528</commentid>
    <comment_count>1</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2012-07-16 11:50:30 -0700</bug_when>
    <thetext>Does this problem only apply to StaticNodeList? What about StaticHashSetNodeList and DynamicNodeList?

In JSC, the way to fix this is to make the node list wrapper&apos;s visit function add its document to the opaque root set. This will require giving all NodeLists, and not just DynamicNodeLists, owner document pointers.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>670665</commentid>
    <comment_count>2</comment_count>
    <who name="Erik Arvidsson">arv</who>
    <bug_when>2012-07-16 14:29:37 -0700</bug_when>
    <thetext>(In reply to comment #1)
&gt; Does this problem only apply to StaticNodeList? What about StaticHashSetNodeList and DynamicNodeList?

Most (all?) of the DynamicNodeLists keep the wrappers alive though other means. For example the nodes in a childNodes NodeList are kept alive as long as the parent node is kept alive.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>670671</commentid>
    <comment_count>3</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2012-07-16 14:33:55 -0700</bug_when>
    <thetext>How do they keep the parent node alive?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>670674</commentid>
    <comment_count>4</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2012-07-16 14:35:02 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; How do they keep the parent node alive?

DynamicNodeList has a RefPtr to its owner.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>670687</commentid>
    <comment_count>5</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2012-07-16 14:46:37 -0700</bug_when>
    <thetext>But what keeps the JavaScript wrapper alive?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>858674</commentid>
    <comment_count>6</comment_count>
    <who name="Adam Klein">adamk</who>
    <bug_when>2013-03-19 13:23:44 -0700</bug_when>
    <thetext>*** Bug 105666 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>151772</attachid>
            <date>2012-07-11 14:12:22 -0700</date>
            <delta_ts>2012-07-11 14:12:22 -0700</delta_ts>
            <desc>Layout test</desc>
            <filename>nodelist-reachable-item.html</filename>
            <type>text/html</type>
            <size>374</size>
            <attacher name="Erik Arvidsson">arv</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+Cjxib2R5PjwvYm9keT4KPHNjcmlwdCBzcmM9Ii4uLy4uL2pzL3Jlc291
cmNlcy9qcy10ZXN0LXByZS5qcyI+PC9zY3JpcHQ+CjxzY3JpcHQ+Cgpkb2N1bWVudC5ib2R5Lmlu
bmVySFRNTCA9ICc8Yj48L2I+JzsKdmFyIGVsZW1lbnRzID0gZG9jdW1lbnQuYm9keS5xdWVyeVNl
bGVjdG9yQWxsKCcqJyk7CmVsZW1lbnRzWzBdLmN1c3RvbVByb3BlcnR5ID0gNDI7CmRvY3VtZW50
LmJvZHkudGV4dENvbnRlbnQgPSAnJzsKZ2MoKTsKc2hvdWxkQmUoJ2VsZW1lbnRzWzBdLmN1c3Rv
bVByb3BlcnR5JywgJzQyJykKCjwvc2NyaXB0Pgo8c2NyaXB0IHNyYz0iLi4vLi4vanMvcmVzb3Vy
Y2VzL2pzLXRlc3QtcG9zdC5qcyI+PC9zY3JpcHQ+Cgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>