<?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>45309</bug_id>
          
          <creation_ts>2010-09-07 10:37:31 -0700</creation_ts>
          <short_desc>ActiveDOMObjects::hasPendingActivity doesn&apos;t prevent element wrapper collection</short_desc>
          <delta_ts>2012-11-16 13:29:39 -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>WebCore JavaScript</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P1</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Eric Carlson">eric.carlson</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>abarth</cc>
    
    <cc>antonm</cc>
    
    <cc>ap</cc>
    
    <cc>ggaren</cc>
    
    <cc>jorlow</cc>
    
    <cc>vestbo</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>275141</commentid>
    <comment_count>0</comment_count>
      <attachid>66738</attachid>
    <who name="Eric Carlson">eric.carlson</who>
    <bug_when>2010-09-07 10:37:31 -0700</bug_when>
    <thetext>Created attachment 66738
test case (may crash)

Even with the changes for https://bugs.webkit.org/show_bug.cgi?id=45306, the attached test case asserts in JSEventListener::jsFunction when a media element tries to fire an event after the js wrapper has been collected. Those changes should prevent this because they make HTMLMediaElement inherit from ActiveDOMObject and 1) return true from hasPendingActivity when events are in the queue, and 2) flush pending events in suspend/stop. 

It doesn&apos;t prevent the object from being collected because when markActiveObjectsForContext sees that a media element has pending activity it calls markDOMObjectWrapper, but the media element has a DOMNodeWrapper so the mark never happens and the element is collected.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>276020</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-09-08 13:16:37 -0700</bug_when>
    <thetext>We&apos;re hitting this for media elements and with marquee.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>341541</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2011-01-28 11:09:44 -0800</bug_when>
    <thetext>&lt;rdar://problem/8931194&gt; ActiveDOMObjects::hasPendingActivity doesn&apos;t prevent element wrapper collection</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>394020</commentid>
    <comment_count>3</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2011-04-27 17:14:00 -0700</bug_when>
    <thetext>I believe that all we need to do to fix this bug is to mark these elements with the ActiveDOMObject IDL attribute.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>482522</commentid>
    <comment_count>4</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2011-10-12 10:54:45 -0700</bug_when>
    <thetext>This test doesn&apos;t ASSERT in ToT, although there is no ActiveDOMObject IDL attribute on the elements. I&apos;m not sure if this is just because of some unrelated behavior change that renders the test ineffective, or the problem is somehow fully fixed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>769545</commentid>
    <comment_count>5</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2012-11-16 12:00:54 -0800</bug_when>
    <thetext>This will likely be fixed when I fix bug 101428.  It might actually be fixed on trunk currently given that we&apos;re using the ActiveDOMObject owner for HTMLMediaElement rather than the Node owner.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>66738</attachid>
            <date>2010-09-07 10:37:31 -0700</date>
            <delta_ts>2010-09-07 13:15:33 -0700</delta_ts>
            <desc>test case (may crash)</desc>
            <filename>async-event-crash.html</filename>
            <type>text/html</type>
            <size>5056</size>
            <attacher name="Eric Carlson">eric.carlson</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgogICAgPGhlYWQ+CiAgICAgICAgPHNjcmlwdCBzcmM9bWVk
aWEtZmlsZS5qcz48L3NjcmlwdD4KCiAgICAgICAgPHNjcmlwdD4KICAgICAgICAgICAgY29uc3Qg
bG9vcENvdW50ID0gMjA7CiAgICAgICAgICAgIGNvbnN0IHNlZWtDb3VudCA9IDYwOwogICAgICAg
ICAgICBjb25zdCBtb3ZpZUNvdW50ID0gMTA7CiAgICAgICAgICAgIHZhciBjb3VudCA9IDA7CiAg
ICAgICAgICAgIHZhciBkb25lID0gZmFsc2U7CgogICAgICAgICAgICBpZiAod2luZG93LmxheW91
dFRlc3RDb250cm9sbGVyKSB7CiAgICAgICAgICAgICAgICBsYXlvdXRUZXN0Q29udHJvbGxlci5k
dW1wQXNUZXh0KCk7CiAgICAgICAgICAgICAgICBsYXlvdXRUZXN0Q29udHJvbGxlci53YWl0VW50
aWxEb25lKCk7CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIGZ1bmN0aW9uIGxvZyhtc2cpCiAg
ICAgICAgICAgIHsKICAgICAgICAgICAgICAgIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdjb25z
b2xlJykuYXBwZW5kQ2hpbGQoZG9jdW1lbnQuY3JlYXRlVGV4dE5vZGUobXNnICsgIlxuIikpOwog
ICAgICAgICAgICB9CgogICAgICAgICAgICBmdW5jdGlvbiBmaW5pc2goKQogICAgICAgICAgICB7
CiAgICAgICAgICAgICAgICBsb2coIioqIEhhbmRsZWQgIiArIGNvdW50ICsgIiAndGltZXVwZGF0
ZScgZXZlbnRzLiIpOwogICAgICAgICAgICAgICAgaWYgKHdpbmRvdy5sYXlvdXRUZXN0Q29udHJv
bGxlcikKICAgICAgICAgICAgICAgICAgICBsYXlvdXRUZXN0Q29udHJvbGxlci5ub3RpZnlEb25l
KCk7CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIGZ1bmN0aW9uIHRpbWV1cGRhdGUoKQogICAg
ICAgICAgICB7CiAgICAgICAgICAgICAgICArK2NvdW50OwogICAgICAgICAgICAgICAgdmFyIHZp
ZGVvID0gZXZlbnQudGFyZ2V0OwogICAgICAgICAgICAgICAgdmFyIHZpZGVvcyA9IGRvY3VtZW50
LmdldEVsZW1lbnRzQnlUYWdOYW1lKCd2aWRlbycpOwoKICAgICAgICAgICAgICAgIC8vIERlbGV0
ZSB0aGUgdmlkZW8gZWxlbWVudCBpZiBpdCBpcyBzdGlsbCBpbiB0aGUgRE9NCiAgICAgICAgICAg
ICAgICBmb3IgKG5keCA9IDA7IG5keCA8IHZpZGVvcy5sZW5ndGg7IG5keCsrKSB7CiAgICAgICAg
ICAgICAgICAgICAgaWYgKHZpZGVvID0gdmlkZW9zW25keF0pIHsKICAgICAgICAgICAgICAgICAg
ICAgICAgZm9yY2VHQygpOwogICAgICAgICAgICAgICAgICAgICAgICBsb2coIioqIERlbGV0aW5n
IHZpZGVvLiIpOwogICAgICAgICAgICAgICAgICAgICAgICB2aWRlby5wYXJlbnROb2RlLnJlbW92
ZUNoaWxkKHZpZGVvKTsKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAg
ICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAvLyBEb25lIHdp
dGggdGhlIHRlc3Qgb25jZSB0aGVyZSBhcmUgbm8gbW9yZSB2aWRlbyBlbGVtZW50cy4KICAgICAg
ICAgICAgICAgIGlmICghZG9uZSAmJiAhZG9jdW1lbnQuZ2V0RWxlbWVudHNCeVRhZ05hbWUoJ3Zp
ZGVvJykubGVuZ3RoKSB7CiAgICAgICAgICAgICAgICAgICAgZm9yY2VHQygpOwogICAgICAgICAg
ICAgICAgICAgIGRvbmUgPSB0cnVlOwogICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZmlu
aXNoLCAyMDApOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CgogICAgICAgICAgICBm
dW5jdGlvbiBmb3JjZUdDKCkKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgbG9nKCIqKiBG
b3JjaW5nIGdhcmJhZ2UgY29sbGVjdGlvbi4iKTsKICAgICAgICAgICAgICAgIGlmICh3aW5kb3cu
R0NDb250cm9sbGVyKQogICAgICAgICAgICAgICAgICAgIHJldHVybiBHQ0NvbnRyb2xsZXIuY29s
bGVjdCgpOwoKICAgICAgICAgICAgICAgIC8vIEZvcmNlIGdhcmJhZ2UgY29sbGVjdGlvbiB0aGUg
b2xkIGZhc2hpb25lZCB3YXkuCiAgICAgICAgICAgICAgICBmb3IgKHZhciBuZHggPSAwOyBuZHgg
PCA5OTAwMDsgbmR4KyspCiAgICAgICAgICAgICAgICAgICAgdmFyIHN0ciA9IG5ldyBTdHJpbmco
IjEyMzQxMjM0Iik7CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIGZ1bmN0aW9uIGxvYWRlZG1l
dGFkYXRhKCkKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgdmFyIHZpZGVvID0gZXZlbnQu
dGFyZ2V0OwoKICAgICAgICAgICAgICAgIGxvZygiKiogU2Vla2luZyB0byBnZW5lcmF0ZSBxdWV1
ZSBvZiAiICsgKGxvb3BDb3VudCAqIHNlZWtDb3VudCkgKyAiICd0aW1ldXBkYXRlJyBldmVudHMu
Iik7CiAgICAgICAgICAgICAgICBmb3IgKHZhciBuZHg9MDsgbmR4IDwgbG9vcENvdW50OyBuZHgr
KykKICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBzZWVrTmR4PTA7IHNlZWtOZHggPCBzZWVr
Q291bnQ7IHNlZWtOZHgrKykKICAgICAgICAgICAgICAgICAgICAgICAgdmlkZW8uY3VycmVudFRp
bWUgPSBzZWVrTmR4ICogMC4xOwogICAgICAgICAgICB9CgogICAgICAgICAgICBmdW5jdGlvbiBz
ZXR1cCh2aWRlbykKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgdmFyIGRvTm90aGluZyA9
IGZ1bmN0aW9uKCkgeyB9OwogICAgICAgICAgICAgICAgdmlkZW8uYWRkRXZlbnRMaXN0ZW5lcigi
bG9hZGVkbWV0YWRhdGEiLCBsb2FkZWRtZXRhZGF0YSwgZmFsc2UpOwogICAgICAgICAgICAgICAg
dmlkZW8uYWRkRXZlbnRMaXN0ZW5lcigidGltZXVwZGF0ZSIsIHRpbWV1cGRhdGUsIGZhbHNlKTsK
ICAgICAgICAgICAgICAgIHZpZGVvLmFkZEV2ZW50TGlzdGVuZXIoImxvYWRzdGFydCIsIGRvTm90
aGluZyk7CiAgICAgICAgICAgICAgICB2aWRlby5hZGRFdmVudExpc3RlbmVyKCJwcm9ncmVzcyIs
IGRvTm90aGluZyk7CiAgICAgICAgICAgICAgICB2aWRlby5hZGRFdmVudExpc3RlbmVyKCJzdXNw
ZW5kIiwgZG9Ob3RoaW5nKTsKICAgICAgICAgICAgICAgIHZpZGVvLmFkZEV2ZW50TGlzdGVuZXIo
ImxvYWQiLCBkb05vdGhpbmcpOwogICAgICAgICAgICAgICAgdmlkZW8uYWRkRXZlbnRMaXN0ZW5l
cigiYWJvcnQiLCBkb05vdGhpbmcpOwogICAgICAgICAgICAgICAgdmlkZW8uYWRkRXZlbnRMaXN0
ZW5lcigiZXJyb3IiLCBkb05vdGhpbmcpOwogICAgICAgICAgICAgICAgdmlkZW8uYWRkRXZlbnRM
aXN0ZW5lcigiZW1wdGllZCIsIGRvTm90aGluZyk7CiAgICAgICAgICAgICAgICB2aWRlby5hZGRF
dmVudExpc3RlbmVyKCJzdGFsbGVkIiwgZG9Ob3RoaW5nKTsKICAgICAgICAgICAgICAgIHZpZGVv
LmFkZEV2ZW50TGlzdGVuZXIoInBsYXk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0IHdlIGRvbid0IGNyYXNoIHdoZW4gYSB2aWRlbyBlbGVtZW50
IHdpdGggcGVuZGluZyBhc3luYyBldmVudHMgaXMgZGVsZXRlZC48L3A+CiAgICAgICAgPHByZSBp
ZD0iY29uc29sZSI+PC9wcmU+CiAgICA8L2JvZHk+CjwvaHRtbD4KCg==
</data>

          </attachment>
      

    </bug>

</bugzilla>