<?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>7161</bug_id>
          
          <creation_ts>2006-02-09 11:30:32 -0800</creation_ts>
          <short_desc>&lt;iframe src=&quot;&quot;&gt; load event is dispatched synchronously unlike Chrome Canary and Firefox</short_desc>
          <delta_ts>2023-08-18 11:33:37 -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>DOM</component>
          <version>420+</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, HasReduction, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alexey Proskuryakov">ap</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>cdumez</cc>
    
    <cc>ian</cc>
    
    <cc>rniwa</cc>
    
    <cc>techrazy.yang</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>31957</commentid>
    <comment_count>0</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2006-02-09 11:30:32 -0800</bug_when>
    <thetext>See the attached test case (which works as expected in Firefox and WinIE).

The document body has an element:
&lt;p id=console&gt;FAILURE&lt;/p&gt;

For whatever reason, document.getElementById(&quot;console&quot;) returns null if called from an IFrame onload handler.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31958</commentid>
    <comment_count>1</comment_count>
      <attachid>6367</attachid>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2006-02-09 11:31:07 -0800</bug_when>
    <thetext>Created attachment 6367
test case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31960</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2006-02-09 11:45:19 -0800</bug_when>
    <thetext>Starts to work if the iframe is moved below &lt;p&gt;.

&quot;onclick handler&quot; in the alert was supposed to be &quot;onload handler&quot;, of course. It is there to indicate that the handler is called at all (didn&apos;t fire before, bug 3609).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1887837</commentid>
    <comment_count>3</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-07-30 05:49:35 -0700</bug_when>
    <thetext>I am able to reproduce this bug in Safari 15.6 on macOS 12.5 using attached test case and Safari is only browser - which shows &quot;FAILURE&quot; while all other browsers return &quot;SUCCESS&quot; on this test case. I tested it in &quot;Private Window&quot; to avoid any cache issue as well.

Just wanted to share updated test results. Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1887838</commentid>
    <comment_count>4</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-07-30 05:50:04 -0700</bug_when>
    <thetext>Other browsers which show &quot;SUCCESS&quot; - Chrome Canary 106 and Firefox Nightly 105. Forgot to add them.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1887898</commentid>
    <comment_count>5</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2022-07-30 13:36:25 -0700</bug_when>
    <thetext>Ah, this is an issue of when load event is fired. Safari is loading iframe synchronously before p element has been inserted into the document.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1887901</commentid>
    <comment_count>6</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-07-30 13:43:27 -0700</bug_when>
    <thetext>&lt;rdar://problem/97844849&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1887931</commentid>
    <comment_count>7</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2022-07-31 01:01:31 -0700</bug_when>
    <thetext>Hm... Chrome stable (103.0.5060.134) also fails the test. I suppose Chrome changed its behavior very recently.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1887934</commentid>
    <comment_count>8</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-07-31 02:18:20 -0700</bug_when>
    <thetext>So I just tested this in Chrome Beta (104.0.5112.65) and Chrome Dev (105.0.5195.10) and both also show &quot;FAILURE&quot; for this test case, so indeed, it is something which got fixed in Chrome just in Canary branch.

I tried to also look for some such iframe related bugs and only came across following (This is just guess work - so ignore, if irrelevant):

-&gt; Fixed just 19 days ago:

https://chromium.googlesource.com/chromium/src/+/cf2f72ac8431c836b7ecb92a87018ee7f3c2db64</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1972111</commentid>
    <comment_count>9</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-08-18 11:33:37 -0700</bug_when>
    <thetext>Is this code segment in question:

https://searchfox.org/wubkat/source/Source/WebCore/loader/PolicyChecker.cpp#259

// We ignore the response from the client for initial empty document loads and proceed with the load synchronously.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>6367</attachid>
            <date>2006-02-09 11:31:07 -0800</date>
            <delta_ts>2006-02-09 11:31:07 -0800</delta_ts>
            <desc>test case</desc>
            <filename>iframe-onload.html</filename>
            <type>text/html</type>
            <size>513</size>
            <attacher name="Alexey Proskuryakov">ap</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMDEgVHJhbnNpdGlvbmFs
Ly9FTiIKICAgICAgICAiaHR0cDovL3d3dy53My5vcmcvVFIvaHRtbDQvbG9vc2UuZHRkIj4KPGh0
bWw+CjxoZWFkPgo8dGl0bGU+aWZyYW1lIG9ubG9hZCBoYW5kbGVyPC90aXRsZT4KPHNjcmlwdD4K
CglmdW5jdGlvbiByZXBvcnRTdWNjZXNzKCkgewoJCWFsZXJ0KCJvbmNsaWNrIGhhbmRsZXIiKTsK
CQlkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgiY29uc29sZSIpLmZpcnN0Q2hpbGQubm9kZVZhbHVl
ID0gIlNVQ0NFU1MiOwoJfQoJCjwvc2NyaXB0Pgo8L2hlYWQ+Cjxib2R5Pgo8aUZyYW1lIHN0eWxl
PSJ3aWR0aDozNTBweDtib3JkZXI6ZG90dGVkIGdyZWVuIDFweCIgd2lkdGg9IjIwMCIgc3JjPSIi
IGhlaWdodD0iMjAwIiBvbmxvYWQ9ImphdmFzY3JpcHQ6cmVwb3J0U3VjY2VzcygpIj5zb21lIGNv
bnRlbnQ8L2lGcmFtZT4KPHAgaWQ9Y29uc29sZT5GQUlMVVJFPC9wPgo8L2JvZHk+CjwvaHRtbD4K
</data>

          </attachment>
      

    </bug>

</bugzilla>