<?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>87448</bug_id>
          
          <creation_ts>2012-05-24 18:41:15 -0700</creation_ts>
          <short_desc>Presence of video tag causes DumpRenderTree to exit before calling onload handler</short_desc>
          <delta_ts>2020-05-04 07:46:50 -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>Media</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="Kenneth Russell">kbr</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>eric.carlson</cc>
    
    <cc>jer.noble</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>633447</commentid>
    <comment_count>0</comment_count>
      <attachid>143946</attachid>
    <who name="Kenneth Russell">kbr</who>
    <bug_when>2012-05-24 18:41:15 -0700</bug_when>
    <thetext>Created attachment 143946
Test case; unzip in LayoutTests/fast/canvas/webgl

It appears that if a &lt;video&gt; tag is present, DumpRenderTree will exit before calling the body&apos;s onload handler, unless layoutTestController.waitUntilDone() has been called. If waitUntilDone() is called within the body&apos;s onload handler, the test will exit early.

Reproduced with Chromium port&apos;s DumpRenderTree implementation. Not sure whether it happens with other ports.

Commenting out the video tag causes the onload handler to run 100% reliably.

Calling waitUntilDone() in script executed during page load causes the test to run 100% reliably.

See the attached test case; unzip in LayoutTests/fast/canvas/webgl.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>633450</commentid>
    <comment_count>1</comment_count>
    <who name="Kenneth Russell">kbr</who>
    <bug_when>2012-05-24 18:43:50 -0700</bug_when>
    <thetext>Discovered while working on Bug 87042 and Bug 86877.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>633604</commentid>
    <comment_count>2</comment_count>
    <who name="Ami Fischman">fischman</who>
    <bug_when>2012-05-24 23:29:09 -0700</bug_when>
    <thetext>kbr: do you know if DRT&apos;s behavior is document somewhere vis-a-vis what it guarantees to execute before exiting when waitUntilDone() hasn&apos;t been called?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>633967</commentid>
    <comment_count>3</comment_count>
    <who name="Eric Carlson">eric.carlson</who>
    <bug_when>2012-05-25 08:49:36 -0700</bug_when>
    <thetext>The media element will block the document&apos;s &apos;load&apos; event during setup and initial buffering, are you sure your onload handler is being called at all?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>634025</commentid>
    <comment_count>4</comment_count>
    <who name="Kenneth Russell">kbr</who>
    <bug_when>2012-05-25 10:18:26 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; kbr: do you know if DRT&apos;s behavior is document somewhere vis-a-vis what it guarantees to execute before exiting when waitUntilDone() hasn&apos;t been called?

I don&apos;t know whether it&apos;s written down but it seems to be common knowledge among WebKit developers; jamesr told me that that is definitely the rule.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>634029</commentid>
    <comment_count>5</comment_count>
    <who name="Ami Fischman">fischman</who>
    <bug_when>2012-05-25 10:20:15 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; (In reply to comment #2)
&gt; &gt; kbr: do you know if DRT&apos;s behavior is document somewhere vis-a-vis what it guarantees to execute before exiting when waitUntilDone() hasn&apos;t been called?
&gt; 
&gt; I don&apos;t know whether it&apos;s written down but it seems to be common knowledge among WebKit developers; jamesr told me that that is definitely the rule.

Sorry, what is the common knowledge?
(I really don&apos;t know what the contract is)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>634033</commentid>
    <comment_count>6</comment_count>
    <who name="Kenneth Russell">kbr</who>
    <bug_when>2012-05-25 10:22:40 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; (In reply to comment #4)
&gt; &gt; (In reply to comment #2)
&gt; &gt; &gt; kbr: do you know if DRT&apos;s behavior is document somewhere vis-a-vis what it guarantees to execute before exiting when waitUntilDone() hasn&apos;t been called?
&gt; &gt; 
&gt; &gt; I don&apos;t know whether it&apos;s written down but it seems to be common knowledge among WebKit developers; jamesr told me that that is definitely the rule.
&gt; 
&gt; Sorry, what is the common knowledge?
&gt; (I really don&apos;t know what the contract is)

Sorry; I meant that the onload handler is called before DRT exits.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>634035</commentid>
    <comment_count>7</comment_count>
    <who name="Kenneth Russell">kbr</who>
    <bug_when>2012-05-25 10:23:26 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; The media element will block the document&apos;s &apos;load&apos; event during setup and initial buffering, are you sure your onload handler is being called at all?

When the problem occurs, the onload handler is definitely not getting called. I&apos;ll upload a revised test case showing this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>634036</commentid>
    <comment_count>8</comment_count>
      <attachid>144096</attachid>
    <who name="Kenneth Russell">kbr</who>
    <bug_when>2012-05-25 10:24:02 -0700</bug_when>
    <thetext>Created attachment 144096
Revised test case showing onload handler is not called</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>634051</commentid>
    <comment_count>9</comment_count>
    <who name="Eric Carlson">eric.carlson</who>
    <bug_when>2012-05-25 10:41:40 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; 
&gt; When the problem occurs, the onload handler is definitely not getting called. I&apos;ll upload a revised test case showing this.

So I&apos;ll bet that this is caused by the &lt;video&gt; element delaying the &apos;load&apos; event while loading and parsing the initial portion of the file. As far as I know DRT does not wait for the &apos;load&apos; event to be fired, that is what waitUntilDone() is for.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>634058</commentid>
    <comment_count>10</comment_count>
    <who name="Ami Fischman">fischman</who>
    <bug_when>2012-05-25 10:45:55 -0700</bug_when>
    <thetext>(In reply to comment #9)
&gt; As far as I know DRT does not wait for the &apos;load&apos; event to be fired, that is what waitUntilDone() is for.

Eric: what would you say DRTs contract is/should be?
FWIW, http://trac.webkit.org/wiki/Writing%20Layout%20Tests%20for%20DumpRenderTree says:
   By default, DumpRenderTree dumps each test file immediately after the document has loaded and the load event handlers have executed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>634076</commentid>
    <comment_count>11</comment_count>
    <who name="Eric Carlson">eric.carlson</who>
    <bug_when>2012-05-25 11:02:41 -0700</bug_when>
    <thetext>(In reply to comment #10)
&gt; (In reply to comment #9)
&gt; &gt; As far as I know DRT does not wait for the &apos;load&apos; event to be fired, that is what waitUntilDone() is for.
&gt; 
&gt; Eric: what would you say DRTs contract is/should be?
&gt; FWIW, http://trac.webkit.org/wiki/Writing%20Layout%20Tests%20for%20DumpRenderTree says:
&gt;    By default, DumpRenderTree dumps each test file immediately after the document has loaded and the load event handlers have executed.

Silly me!</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="0"
              isprivate="0"
          >
            <attachid>143946</attachid>
            <date>2012-05-24 18:41:15 -0700</date>
            <delta_ts>2012-05-25 10:24:02 -0700</delta_ts>
            <desc>Test case; unzip in LayoutTests/fast/canvas/webgl</desc>
            <filename>video-race-test.zip</filename>
            <type>application/octet-stream</type>
            <size>1498</size>
            <attacher name="Kenneth Russell">kbr</attacher>
            
              <data encoding="base64">UEsDBBQAAAAIACaUuEDm4AxksQMAACgJAAAUABwAdmlkZW8tcmFjZS10ZXN0Lmh0bWxVVAkAA1fh
vk8u4b5PdXgLAAEEi3wBAASIEwAAlVbfb9s2EH7XX3Hhi53CltIsKAL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aLa5TmM8pEoqlVevSfXd3c8r29vaexQQCx8N8haGhrAEW
7RXbPr6nC5daNi/pTtLptr5j1N5DjctJdJDRyUN8YHO3ZHyXv03vblc3b1czIAlP727SWzaB7CL0
PW62u/o+ftnISzg5uSGdGeyM3Uh3MTZVzliemnJ3loApyxNyqzUGX2RRsa1qFkgXORj/EP0DUEsD
BBQAAAAIAAGUuEBRDgSBswAAAPMAAAAcABwAdmlkZW8tcmFjZS10ZXN0LWV4cGVjdGVkLnR4dFVU
CQADEuG+TyPhvk91eAsAAQSLfAEABIgTAABVjsFqwzAQRO/6isGnBkr+oaS+tcTE7geo1jpdUHaD
tIrx33dDcsllLvN4Mye6Fk1tJpToMaskNlbByvaHGydSUKYLiSFKQo6bNpuo2kHFiuZMZb9Gth8x
zp8q9LYL4SiobZ6p1nc477KcUYkQPQtThS7oho9x7HBxKp7JycVtulLC74Zu6scJh+P38NVPfbcP
4U7j6vssZ9DtfmjhQulRPOeWlvM2xFLdwhVWGoXwogrhH1BLAQIeAxQAAAAIACaUuEDm4AxksQMA
ACgJAAAUABgAAAAAAAEAAACkgQAAAAB2aWRlby1yYWNlLXRlc3QuaHRtbFVUBQADV+G+T3V4CwAB
BIt8AQAEiBMAAFBLAQIeAxQAAAAIAAGUuEBRDgSBswAAAPMAAAAcABgAAAAAAAEAAACkgf8DAAB2
aWRlby1yYWNlLXRlc3QtZXhwZWN0ZWQudHh0VVQFAAMS4b5PdXgLAAEEi3wBAASIEwAAUEsFBgAA
AAACAAIAvAAAAAgFAAAAAA==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>144096</attachid>
            <date>2012-05-25 10:24:02 -0700</date>
            <delta_ts>2012-05-25 10:24:02 -0700</delta_ts>
            <desc>Revised test case showing onload handler is not called</desc>
            <filename>video-race-test.zip</filename>
            <type>application/octet-stream</type>
            <size>1519</size>
            <attacher name="Kenneth Russell">kbr</attacher>
            
              <data encoding="base64">UEsDBBQAAAAIA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