<?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>44575</bug_id>
          
          <creation_ts>2010-08-24 19:21:20 -0700</creation_ts>
          <short_desc>beforeload event fired twice on &lt;object&gt;s</short_desc>
          <delta_ts>2011-09-09 15:57:11 -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>WebCore Misc.</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac (Intel)</rep_platform>
          <op_sys>OS X 10.6</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sidney San Martín">s+webkit</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>abarth</cc>
    
    <cc>aestes</cc>
    
    <cc>ap</cc>
    
    <cc>aroben</cc>
    
    <cc>eric</cc>
    
    <cc>hyatt</cc>
    
    <cc>jamesr</cc>
    
    <cc>marc.hoyois</cc>
    
    <cc>mitz</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>268973</commentid>
    <comment_count>0</comment_count>
      <attachid>65360</attachid>
    <who name="Sidney San Martín">s+webkit</who>
    <bug_when>2010-08-24 19:21:20 -0700</bug_when>
    <thetext>Created attachment 65360
Test case demonstrating duplicate beforeload events

I&apos;m hoping that I&apos;m missing something about the beforeload event, and that this isn&apos;t a bug.

The attached testcase increments a counter each time beforeload fires, and logs the event&apos;s target element to the console.

Expected results:
beforeload fires once on the &lt;object&gt;

Actual results:
beforeload appears to fire twice on the &lt;object&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>268999</commentid>
    <comment_count>1</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2010-08-24 21:34:19 -0700</bug_when>
    <thetext>Is this a recent change?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>269000</commentid>
    <comment_count>2</comment_count>
    <who name="Sidney San Martín">s+webkit</who>
    <bug_when>2010-08-24 21:38:42 -0700</bug_when>
    <thetext>(In reply to comment #1)
&gt; Is this a recent change?

I don&apos;t think so, but I just noticed it. I can reproduce in Safari 5.0.1 and Chrome 5.0.375.127.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>269261</commentid>
    <comment_count>3</comment_count>
      <attachid>65422</attachid>
    <who name="Mihai Parparita">mihaip</who>
    <bug_when>2010-08-25 08:46:27 -0700</bug_when>
    <thetext>Created attachment 65422
Stacktrace when dispatchBeforeLoadEvent is called during window resizes

This is because we end up dispatching beforeload for every single layout (and your logging triggers a layout, as opening the inspector console). The easiest way to see this is to resize the window while showing the testcase, the beforeload count keeps going up.

Attached is the stack trace that shows how we get to dispatching the beforeload event during a resize. This is technically correct, since we do end up calling requestObject shortly after.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>269295</commentid>
    <comment_count>4</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2010-08-25 09:47:06 -0700</bug_when>
    <thetext>Hyatt added beforeload.  Jamesr has talked about moving object/embed loading out of the renderers.  Both may be interested in this bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>269455</commentid>
    <comment_count>5</comment_count>
    <who name="James Robinson">jamesr</who>
    <bug_when>2010-08-25 13:14:29 -0700</bug_when>
    <thetext>We probably shouldn&apos;t fire beforeload at all if the &lt;object&gt;&apos;s URL is empty, since we&apos;ll use the fallback content regardless in that case.  That would at least paper over this issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>280358</commentid>
    <comment_count>6</comment_count>
    <who name="Marc Hoyois">marc.hoyois</who>
    <bug_when>2010-09-16 14:25:24 -0700</bug_when>
    <thetext>I&apos;m developing the ClickToFlash extension for Safari and the fact that some &lt;object&gt;s fire two beforeload events in very quick succession is something I noticed early on. It&apos;s relatively common, in fact. It&apos;s not random in that a given object seems to always fire it once or always twice, but I have no idea what characteristic of the object is determinant. Here&apos;s a real-life example of an embedded Windows Media video that always fires it twice:

http://www.mediacollege.com/video/format/windows-media/streaming/embed.html

Also, I noticed that in the attached example, as soon as you add some attributes to the object (eg. add type=&quot;blah&quot;), resizing does not make it fire more events anymore. Doing that increases the count by 2 instead of 1. However, if you add something that actually launches a plugin, like type=&quot;application/x-shockwave-flash&quot;, the count only increases by 1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>280375</commentid>
    <comment_count>7</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-09-16 14:52:18 -0700</bug_when>
    <thetext>&lt;rdar://problem/8441094&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>292694</commentid>
    <comment_count>8</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-10-11 15:14:48 -0700</bug_when>
    <thetext>I think that this can be fixed by enforcing a comment in HTMLObjectElement::updateWidget():

    // FIXME: We should ASSERT(needsWidgetUpdate()), but currently
    // FrameView::updateWidget() calls updateWidget(false) without checking if
    // the widget actually needs updating!

Adding an early return in this case sounds like a right thing to do.

Another approach that looks like a right thing to do is removing HTMLPlugInImageElement::updateWidgetIfNecessary() and all associated machinery! All it does is call updateStyleIfNeeded(), and then updateWidget(true), which is almost a no-op for NPAPI plug-ins. And I don&apos;t see why WebKit plug-ins should be different here.

So, updateWidgetIfNecessary ends up calling updateStyleIfNeeded(), and then setNeedsWidgetUpdate(false), and that&apos;s it - which makes no sense. When I made this change, one regression test broke, but another one progressed to match Firefox.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>292857</commentid>
    <comment_count>9</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2010-10-11 21:27:35 -0700</bug_when>
    <thetext>updateWidgetIfNecessary is vestigial.  It used to be much more complicated, but now it should just be removed it possible.   The whole &quot;updateWidget&quot; nonsense should be.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>306520</commentid>
    <comment_count>10</comment_count>
    <who name="Andy Estes">aestes</who>
    <bug_when>2010-11-08 17:45:51 -0800</bug_when>
    <thetext>*** Bug 49123 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>463736</commentid>
    <comment_count>11</comment_count>
    <who name="Marc Hoyois">marc.hoyois</who>
    <bug_when>2011-09-07 16:03:13 -0700</bug_when>
    <thetext>This may be related to comment #8: trying to get computed styles of event.target within the handler can cause the handler to pause while a new beforeload event is fired and handled. This seems to happen consistently if plugins are disabled. I&apos;d like to point out that it&apos;s essential for several content-blocking extensions out there that computed styles be accessible within the beforeload handler, so please don&apos;t remove this possibility. The 2nd beforeload shouldn&apos;t be there, though (but it&apos;s easy to ignore in Javascript: just set a property on event.target before getting styles and remove it after).

Another completely different cause of duplicate beforeload events concerns native image types in &lt;object&gt; elements. For example if the specified type is image/jpeg, Safari tries to load the resource directly, but if that fails it checks the actual Content-Type and fires a beforeload again. In this case the second event is fired some time after the first has been handled, and so it&apos;s impossible to tell for sure that the second event is a duplicate. Instead of reusing the same &lt;object&gt; after checking the Content-Type, it would be more consistent if WebKit created a new subframe like it does in the case when type is not set and extension does not match a plugin, and fire the 2nd beforeload there.

These two phenomena can even combine so that &lt;object&gt; elements can fire up to 3 beforeload events.

It seems to me the main problem is that the beforeload event is not fired in the correct place: updateWidget is called in cases where no beforeload should be fired. Conceptually the algorithm should be

1. Gather parameters from the DOM. If no source and no type, abort and use fallback. (Only source and type are needed here, but since we must look for them in &lt;params&gt; for legacy reasons, we might as well gather all parameters now. It would even be useful to set them as a DOMStringMap property of the beforeload event.)
2. Fire beforeload. If defaultPrevented, abort and use fallback.
3. Run the loading procedures.

Start again whenever the data/src or type attributes are changed. Currently beforeload is fired in the middle of 3...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>465055</commentid>
    <comment_count>12</comment_count>
    <who name="Marc Hoyois">marc.hoyois</who>
    <bug_when>2011-09-09 15:21:57 -0700</bug_when>
    <thetext>It seems that beforeload events are always fired twice (at least on &lt;embeds&gt;) when plugins are disabled in Safari&apos;s preferences. I assumed that was the same as having no plugins installed, but it&apos;s not. Evaluation of things like event.target.offsetWidth or event.target.parentNode.toString() if the parent is an &lt;object&gt; create a 2nd beforeload dispatch on event.target within the handler, but otherwise a 2nd beforeload is still fired after the first has been handled.

Anyway I cannot reproduce the first example in my comment #11 if plugins are enabled, so this is not quite a real-life example, but still a valid test case to keep in mind to make sure beforeload dispatch is logically implemented.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>465074</commentid>
    <comment_count>13</comment_count>
      <attachid>106932</attachid>
    <who name="Marc Hoyois">marc.hoyois</who>
    <bug_when>2011-09-09 15:57:11 -0700</bug_when>
    <thetext>Created attachment 106932
Test case demonstrating what I was talking about in comment #11

Scratch that, my first example in comment #11 can also happen with plugins enabled. I attach a test case with the &lt;object&gt;&lt;embed&gt; combination. The console output is

1 before accessing parentNode
2 before accessing parentNode
2 after accessing parentNode
1 after accessing parentNode

which shows that accessing the &lt;object&gt; element while handling the beforeload of the &lt;embed&gt; element dispatches a new beforeload on &lt;embed&gt;. You can also have the &lt;embed&gt; element alone and evaluate event.target.offsetWidth or getComputedStyle(event.target, null): same result.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>65360</attachid>
            <date>2010-08-24 19:21:20 -0700</date>
            <delta_ts>2010-08-24 19:21:20 -0700</delta_ts>
            <desc>Test case demonstrating duplicate beforeload events</desc>
            <filename>webkit_beforeload_multiple_ssm.html</filename>
            <type>text/html</type>
            <size>312</size>
            <attacher name="Sidney San Martín">s+webkit</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8aGVhZD4KPGJvZHk+CjxwPjxjb2RlPmJlZm9yZWxvYWQ8
L2NvZGU+IGNvdW50OiA8c3Bhbj4wPC9zcGFuPjwvcD4KPHNjcmlwdD4KdmFyIGhpdENvdW50ID0g
MCwgaGl0RWxlbWVudCA9IGRvY3VtZW50LmdldEVsZW1lbnRzQnlUYWdOYW1lKCdzcGFuJylbMF07
CmRvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIoImJlZm9yZWxvYWQiLCBmdW5jdGlvbihlKXsgaGl0
RWxlbWVudC50ZXh0Q29udGVudCA9ICsraGl0Q291bnQ7IGNvbnNvbGUubG9nKGUudGFyZ2V0KSB9
LCB0cnVlKTsKPC9zY3JpcHQ+CjxvYmplY3Q+
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>65422</attachid>
            <date>2010-08-25 08:46:27 -0700</date>
            <delta_ts>2010-08-25 08:46:27 -0700</delta_ts>
            <desc>Stacktrace when dispatchBeforeLoadEvent is called during window resizes</desc>
            <filename>dispatchBeforeLoadEvent stack trace.txt</filename>
            <type>text/plain</type>
            <size>4612</size>
            <attacher name="Mihai Parparita">mihaip</attacher>
            
              <data encoding="base64">IzAgIFdlYkNvcmU6OkNvbnRhaW5lck5vZGU6OmRpc3BhdGNoQmVmb3JlTG9hZEV2ZW50ICh0aGlz
PTB4MTA2MzllZTUwLCBzb3VyY2VVUkw9QDB4N2ZmZjVmYmZjY2IwKSBhdCBXZWJLaXQvV2ViQ29y
ZS9kb20vQ29udGFpbmVyTm9kZS5jcHA6MTA0NQojMSAgMHgwMDAwMDAwMTAxZGNlMzUyIGluIFdl
YkNvcmU6OlJlbmRlckVtYmVkZGVkT2JqZWN0Ojp1cGRhdGVXaWRnZXQgKHRoaXM9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DAwMDAwMDEwMDAyNTA4ZiBpbiA/PyAoKQoj
NDYgMHgwMDAwN2ZmZjg0YWE0ZmFkIGluIC1bTlNUaXRsZWRGcmFtZSByZXNpemVXaXRoRXZlbnQ6
XSAoKQojNDcgMHgwMDAwN2ZmZjg0NzE5NDE1IGluIC1bTlNUaXRsZWRGcmFtZSBtb3VzZURvd246
XSAoKQojNDggMHgwMDAwN2ZmZjg0NzE5MzdiIGluIC1bTlNUaGVtZUZyYW1lIG1vdXNlRG93bjpd
ICgpCiM0OSAweDAwMDA3ZmZmODQ2MTc3NjMgaW4gLVtOU1dpbmRvdyBzZW5kRXZlbnQ6XSAoKQoj
NTAgMHgwMDAwMDAwMTAwMDQxYmY1IGluID8/ICgpCiM1MSAweDAwMDAwMDAxMDAwNDFiODEgaW4g
Pz8gKCkKIzUyIDB4MDAwMDdmZmY4NDU0Y2VlMiBpbiAtW05TQXBwbGljYXRpb24gc2VuZEV2ZW50
Ol0gKCkKIzUzIDB4MDAwMDAwMDEwMDAzODhjMiBpbiA/PyAoKQojNTQgMHgwMDAwN2ZmZjg0NGUz
OTIyIGluIC1bTlNBcHBsaWNhdGlvbiBydW5dICgpCiM1NSAweDAwMDA3ZmZmODQ0ZGM1ZjggaW4g
TlNBcHBsaWNhdGlvbk1haW4gKCkKIzU2IDB4MDAwMDAwMDEwMDAwOWIxOCBpbiA/PyAoKQ==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>106932</attachid>
            <date>2011-09-09 15:57:11 -0700</date>
            <delta_ts>2011-09-09 15:57:11 -0700</delta_ts>
            <desc>Test case demonstrating what I was talking about in comment #11</desc>
            <filename>beforeload.html</filename>
            <type>text/html</type>
            <size>411</size>
            <attacher name="Marc Hoyois">marc.hoyois</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxoZWFkPgo8L2hlYWQ+Cjxib2R5PgoKPHNjcmlwdD4KdmFyIGkgPSAw
Owpkb2N1bWVudC5hZGRFdmVudExpc3RlbmVyKCJiZWZvcmVsb2FkIiwgZnVuY3Rpb24oZXZlbnQp
IHsKCWlmKCEoZXZlbnQudGFyZ2V0IGluc3RhbmNlb2YgSFRNTEVtYmVkRWxlbWVudCkpIHJldHVy
bjsKCXZhciBqID0gKytpOwoJY29uc29sZS5sb2coaiArICIgYmVmb3JlIGFjY2Vzc2luZyBwYXJl
bnROb2RlIik7CglldmVudC50YXJnZXQucGFyZW50Tm9kZS5zb21lcHJvcGVydHk7Cgljb25zb2xl
LmxvZyhqICsgIiBhZnRlciBhY2Nlc3NpbmcgcGFyZW50Tm9kZSIpOwp9LCB0cnVlKTsKPC9zY3Jp
cHQ+Cgo8b2JqZWN0PgoJPGVtYmVkIHR5cGU9InZpZGVvL2Fxa3Fzc2QiPgo8L29iamVjdD4KCjwv
Ym9keT48L2h0bWw+
</data>

          </attachment>
      

    </bug>

</bugzilla>