<?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>55899</bug_id>
          
          <creation_ts>2011-03-07 13:14:35 -0800</creation_ts>
          <short_desc>[Chromium] Detached DOM trees leak because of CSSStyleDeclaration wrapper sharing</short_desc>
          <delta_ts>2011-03-11 05:32:27 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit Misc.</component>
          <version>528+ (Nightly build)</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>
          <dependson>55399</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mikhail Naganov">mnaganov</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>antonm</cc>
    
    <cc>gregsimon</cc>
    
    <cc>koivisto</cc>
    
    <cc>vitalyr</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>363532</commentid>
    <comment_count>0</comment_count>
    <who name="Mikhail Naganov">mnaganov</who>
    <bug_when>2011-03-07 13:14:35 -0800</bug_when>
    <thetext>A common pattern of detached DOM trees leak is observed. The common repro scenario is like this: an application sets a style value on some node, then a whole DOM subtree to which this node belongs stays uncollected, even after being detached from the document.

This happens because V8 object group for the node includes CSSStyleDeclaration wrapper, which participates in two object groups -- the node group, and the group containing all style declarations. The latter group is thus held by any DOM subtree, including the document object group, and it effectively prevents all other object groups from being collected. Graphically the situation looks like this:

   Document DOM tree &lt;--&gt; CSSStyleDeclaration &lt;--&gt; Group with style decls. &lt;--&gt; CSSStyleDeclaration &lt;--&gt; Detached DOM subtree

Thanks to Rick Byers for providing the example.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>363533</commentid>
    <comment_count>1</comment_count>
      <attachid>84974</attachid>
    <who name="Mikhail Naganov">mnaganov</who>
    <bug_when>2011-03-07 13:15:15 -0800</bug_when>
    <thetext>Created attachment 84974
repro page</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>365943</commentid>
    <comment_count>2</comment_count>
    <who name="anton muhin">antonm</who>
    <bug_when>2011-03-11 05:32:27 -0800</bug_when>
    <thetext>Should be fixed now.  See https://bugs.webkit.org/show_bug.cgi?id=56117 for more details.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>84974</attachid>
            <date>2011-03-07 13:15:15 -0800</date>
            <delta_ts>2011-03-07 13:15:15 -0800</delta_ts>
            <desc>repro page</desc>
            <filename>cssstylesleak.html</filename>
            <type>text/html</type>
            <size>707</size>
            <attacher name="Mikhail Naganov">mnaganov</attacher>
            
              <data encoding="base64">PGh0bWw+CiAgICA8Ym9keT4KICAgICAgICA8ZGl2IGlkPSd0ZW1wbGF0ZSc+CiAgICAgICAgPC9k
aXY+CiAgICAgICAgPHNjcmlwdCB0eXBlPSd0ZXh0L2phdmFzY3JpcHQnPgogICAgICAgICAgdmFy
IHRlbXBsYXRlID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ3RlbXBsYXRlJyk7CgogICAgICAg
ICAgdmFyIG5ld05vZGUgPSAodGVtcGxhdGUuY2xvbmVOb2RlKGZhbHNlKSk7CiAgICAgICAgICBu
ZXdOb2RlLnN0eWxlLndpZHRoID0gJzUwcHgnOyAgLy8gZXNzZW50aWFsCiAgICAgICAgICBkb2N1
bWVudC5ib2R5LmFwcGVuZENoaWxkKG5ld05vZGUpOyAgLy8gZXNzZW50aWFsCiAgICAgICAgCiAg
ICAgICAgICBmb3IodmFyIGkgPSAwOyBpIDwgNTAwMDAwOyBpKyspIHsKICAgICAgICAgICAgdmFy
IG5ld05vZGUgPSAodGVtcGxhdGUuY2xvbmVOb2RlKGZhbHNlKSk7CiAgICAgICAgICAgIG5ld05v
ZGUuc3R5bGUud2lkdGggPSAnNTBweCc7ICAgICAgLy8gZXNzZW50aWFsCiAgICAgICAgICAgIGRv
Y3VtZW50LmJvZHkuYXBwZW5kQ2hpbGQobmV3Tm9kZSk7CiAgICAgICAgICAgIG5ld05vZGUuc3R5
bGUud2lkdGggPSAnJzsgICAgICAgICAvLyBkb2Vzbid0IGhlbHAKICAgICAgICAgICAgZG9jdW1l
bnQuYm9keS5yZW1vdmVDaGlsZChuZXdOb2RlKTsKICAgICAgICAgIH0KICAgICAgICA8L3Njcmlw
dD4KICAgIDwvYm9keT4KPC9odG1sPgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>