<?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>49123</bug_id>
          
          <creation_ts>2010-11-05 21:08:18 -0700</creation_ts>
          <short_desc>REGRESSION: beforeload events are fired by &lt;object&gt; elements with YouTube embedding code</short_desc>
          <delta_ts>2010-11-08 17:45:51 -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>Plug-ins</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac (Intel)</rep_platform>
          <op_sys>OS X 10.6</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>44575</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Regression</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Marc Hoyois">marc.hoyois</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>aestes</cc>
    
    <cc>ap</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>305716</commentid>
    <comment_count>0</comment_count>
    <who name="Marc Hoyois">marc.hoyois</who>
    <bug_when>2010-11-05 21:08:18 -0700</bug_when>
    <thetext>Overview:
TWO beforeload events are fired by &lt;object&gt; elements instead of ZERO when their fallback content is used.

Steps to Reproduce:
Open the attached HTML file. It contains an instance of YouTube&apos;s standard embedding code, and alerts for beforeload events.

Expected result:
The &lt;object&gt; tag is ignored because it has neither the type nor the data attribute. The enclosed &lt;embed&gt; tag is used and fires a beforeload event.
Total events fired: 1.

Actual result:
The &lt;object&gt; tag is ignored because it has neither the type nor the data attribute. The enclosed &lt;embed&gt; tag is used and fires a beforeload event. BUT, the unused &lt;object&gt; tag also fires two beforeload events.
Total events fired: 3.

Tested in OS X 10.6.4 with WebkKit 6533.18.5, r71367.

Notes:
The same happens with any other kind of fallback content (&lt;video&gt;, &lt;img&gt;, ...)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>305717</commentid>
    <comment_count>1</comment_count>
      <attachid>73162</attachid>
    <who name="Marc Hoyois">marc.hoyois</who>
    <bug_when>2010-11-05 21:09:29 -0700</bug_when>
    <thetext>Created attachment 73162
An HTML file that reproduces the bug</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>305731</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-11-05 22:31:41 -0700</bug_when>
    <thetext>Note that I&apos;m getting entirely different behavior with Safari 5.0.2: the movie apparently just loads from the object element, and there is just one beforeload event.

With a debug build:

ASSERTION FAILED: !m_inBeforeLoadEventHandler
(/Users/ap/Safari/OpenSource/WebCore/html/HTMLObjectElement.cpp:282 virtual void WebCore::HTMLObjectElement::updateWidget(bool))</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>305740</commentid>
    <comment_count>3</comment_count>
    <who name="Marc Hoyois">marc.hoyois</who>
    <bug_when>2010-11-05 22:51:10 -0700</bug_when>
    <thetext>Yeah I forgot to mention that. Safari 5.0.2 and earlier treat the &lt;object&gt;/&lt;embed&gt; combination in a special way, but that was fixed a few weeks ago in the nightlies (now the &lt;embed&gt; is just like any other fallback). But the problem is already there for other kind of fallback content. I&apos;m attaching an example with &lt;video&gt; fallback.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>305741</commentid>
    <comment_count>4</comment_count>
      <attachid>73166</attachid>
    <who name="Marc Hoyois">marc.hoyois</who>
    <bug_when>2010-11-05 22:52:00 -0700</bug_when>
    <thetext>Created attachment 73166
Another example with &lt;video&gt; fallback</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>306519</commentid>
    <comment_count>5</comment_count>
    <who name="Andy Estes">aestes</who>
    <bug_when>2010-11-08 17:45:51 -0800</bug_when>
    <thetext>I believe this is a dupe of https://bugs.webkit.org/show_bug.cgi?id=44575, although this technically is documenting two separate issues:

1) beforeload is fired twice on object tags (dupe of 44575).
2) beforeload is fired on object tags that will never fire a load event (new bug AFAIK).

For #2, I&apos;m not sure whether its correct to fire a beforeload event for objects with fallback content that that we know we won&apos;t load. That warrants its own discussion that is separate from #1, IMO.

*** This bug has been marked as a duplicate of bug 44575 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>73162</attachid>
            <date>2010-11-05 21:09:29 -0700</date>
            <delta_ts>2010-11-05 21:09:29 -0700</delta_ts>
            <desc>An HTML file that reproduces the bug</desc>
            <filename>test.html</filename>
            <type>text/html</type>
            <size>660</size>
            <attacher name="Marc Hoyois">marc.hoyois</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8aGVhZD4KPHNjcmlwdD4KICAgIGZ1bmN0aW9uIGhhbmRs
ZUV2ZW50KGV2ZW50KSB7CiAgICAgICAgYWxlcnQoZXZlbnQudGFyZ2V0Lm5vZGVOYW1lICsgIlxu
IiArIGV2ZW50LnVybCk7CiAgICB9CgogICAgZG9jdW1lbnQuYWRkRXZlbnRMaXN0ZW5lcigiYmVm
b3JlbG9hZCIsIGhhbmRsZUV2ZW50LCB0cnVlKTsKPC9zY3JpcHQ+CjwvaGVhZD4KPGJvZHk+CiAg
ICA8b2JqZWN0IHdpZHRoPSI2NDAiIGhlaWdodD0iMzg1Ij48cGFyYW0gbmFtZT0ibW92aWUiIHZh
bHVlPSJodHRwOi8vd3d3LnlvdXR1YmUuY29tL3YvS3RwYXR4cmZ0eDg/ZnM9MSI+PC9wYXJhbT48
cGFyYW0gbmFtZT0iYWxsb3dGdWxsU2NyZWVuIiB2YWx1ZT0idHJ1ZSI+PC9wYXJhbT48cGFyYW0g
bmFtZT0iYWxsb3dzY3JpcHRhY2Nlc3MiIHZhbHVlPSJhbHdheXMiPjwvcGFyYW0+PGVtYmVkIHNy
Yz0iaHR0cDovL3d3dy55b3V0dWJlLmNvbS92L0t0cGF0eHJmdHg4P2ZzPTEmYW1wO2hsPWVuX1VT
IiB0eXBlPSJhcHBsaWNhdGlvbi94LXNob2Nrd2F2ZS1mbGFzaCIgYWxsb3dzY3JpcHRhY2Nlc3M9
ImFsd2F5cyIgYWxsb3dmdWxsc2NyZWVuPSJ0cnVlIiB3aWR0aD0iNjQwIiBoZWlnaHQ9IjM4NSI+
PC9lbWJlZD48L29iamVjdD4KPC9ib2R5Pgo8L2h0bWw+
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>73166</attachid>
            <date>2010-11-05 22:52:00 -0700</date>
            <delta_ts>2010-11-05 22:52:00 -0700</delta_ts>
            <desc>Another example with &lt;video&gt; fallback</desc>
            <filename>test2.html</filename>
            <type>text/html</type>
            <size>311</size>
            <attacher name="Marc Hoyois">marc.hoyois</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8aGVhZD4KPHNjcmlwdD4KICAgIGZ1bmN0aW9uIGhhbmRs
ZUV2ZW50KGV2ZW50KSB7CiAgICAgICAgYWxlcnQoZXZlbnQudGFyZ2V0Lm5vZGVOYW1lICsgIlxu
IiArIGV2ZW50LnVybCk7CiAgICB9CgogICAgZG9jdW1lbnQuYWRkRXZlbnRMaXN0ZW5lcigiYmVm
b3JlbG9hZCIsIGhhbmRsZUV2ZW50LCB0cnVlKTsKPC9zY3JpcHQ+CjwvaGVhZD4KPGJvZHk+CiAg
ICA8b2JqZWN0IHdpZHRoPSI2NDAiIGhlaWdodD0iMzg1Ij48dmlkZW8gc3JjPSJkdW1teS5tcDQi
Pjwvb2JqZWN0Pgo8L2JvZHk+CjwvaHRtbD4=
</data>

          </attachment>
      

    </bug>

</bugzilla>