<?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>13574</bug_id>
          
          <creation_ts>2007-05-03 08:51:01 -0700</creation_ts>
          <short_desc>Moving an IFRAME within the DOM tree results in reloading of content</short_desc>
          <delta_ts>2014-06-05 14:37:15 -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>Frames</component>
          <version>523.x (Safari 3)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc>http://pilgrimwebdesign.com/iframe_move.html</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>15652</blocked>
    
    <blocked>110007</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Jonathan Hurshman">jhurshman</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>abarth</cc>
    
    <cc>amla70</cc>
    
    <cc>ap</cc>
    
    <cc>bedney</cc>
    
    <cc>ddkilzer</cc>
    
    <cc>dimich</cc>
    
    <cc>dstorey</cc>
    
    <cc>dtrebbien</cc>
    
    <cc>m.goleb+bugzilla</cc>
    
    <cc>mike.sherov</cc>
    
    <cc>mitz</cc>
    
    <cc>mjs</cc>
    
    <cc>mkwst</cc>
    
    <cc>rboucher</cc>
    
    <cc>rniwa</cc>
    
    <cc>steffen.weber</cc>
    
    <cc>tolmasky</cc>
    
    <cc>tom</cc>
    
    <cc>webkit</cc>
    
    <cc>webkit</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>11403</commentid>
    <comment_count>0</comment_count>
    <who name="Jonathan Hurshman">jhurshman</who>
    <bug_when>2007-05-03 08:51:01 -0700</bug_when>
    <thetext>When an IFRAME is moved within its parent&apos;s DOM tree (e.g., to wrap it inside another element), its contents get reloaded, which can be undesireable. In addition, Safari will report that it is still trying to load something.

The reduction at http://pilgrimwebdesign.com/iframe_move.html should demonstrate this. What should happen is that the IFRAME is simply moved, with no impact on the state of its contents.

What does happen is that the load and unload events of the IFRAME fire each time the IFRAME is moved. In addition, the status bar reads:
    Loading &quot;http://pilgrimwebdesign.com/iframe_move.html&quot;, completed 3 of n items
where n starts at 4 and increments by one each time the IFRAME is moved.

This occurs in Safari 2.0.4 as well as the nightly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71785</commentid>
    <comment_count>1</comment_count>
    <who name="Robert Blaut">webkit</who>
    <bug_when>2008-02-24 13:53:35 -0800</bug_when>
    <thetext>I cannot confirm the bug in Webkit r30549.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71787</commentid>
    <comment_count>2</comment_count>
    <who name="">mitz</who>
    <bug_when>2008-02-24 13:56:19 -0800</bug_when>
    <thetext>Still reproducible.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82682</commentid>
    <comment_count>3</comment_count>
    <who name="Francisco Tolmasky">tolmasky</who>
    <bug_when>2008-06-08 16:39:51 -0700</bug_when>
    <thetext>I get this all the time.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82686</commentid>
    <comment_count>4</comment_count>
    <who name="">mitz</who>
    <bug_when>2008-06-08 17:01:54 -0700</bug_when>
    <thetext>What do other browsers do? Do they distinguish between an atomic move and a removal followed by an insertion?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86461</commentid>
    <comment_count>5</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2008-07-20 06:41:08 -0700</bug_when>
    <thetext>If we document other browser&apos;s behavior (specifically MSIE and Firefox), it will be easily to know how to fix WebKit.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86471</commentid>
    <comment_count>6</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2008-07-20 08:37:39 -0700</bug_when>
    <thetext>Firefox 2 and 3 behave the same as WebKit/Safari (tested nightly build r35249).  The iframe is reloaded as it moves in the DOM, and both load and unload events are called during this change.

Opera 9.24 and 9.51 behave the same as WebKit/Safari, except that no unload events are called.

MSIE 5.23 for Mac OS X, ironically, behaves &quot;as expected&quot;.  There are no load or unload events as it is moved within the DOM!

Will test MSIE 7 next.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86472</commentid>
    <comment_count>7</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2008-07-20 08:49:48 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; Firefox 2 and 3 behave the same as WebKit/Safari (tested nightly build r35249).
&gt;  The iframe is reloaded as it moves in the DOM, and both load and unload events
&gt; are called during this change.
&gt; 
&gt; Opera 9.24 and 9.51 behave the same as WebKit/Safari, except that no unload
&gt; events are called.
&gt; 
&gt; MSIE 5.23 for Mac OS X, ironically, behaves &quot;as expected&quot;.  There are no load
&gt; or unload events as it is moved within the DOM!

MSIE 7 behaves &quot;as expected&quot; in this case.  There are no load or unload events as it is moved within the DOM.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>174735</commentid>
    <comment_count>8</comment_count>
    <who name="">mitz</who>
    <bug_when>2009-12-23 22:02:35 -0800</bug_when>
    <thetext>See also bug 32848.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>177005</commentid>
    <comment_count>9</comment_count>
    <who name="William J. Edney">bedney</who>
    <bug_when>2010-01-04 20:18:29 -0800</bug_when>
    <thetext>Mozilla still has the same problem, 5.5 years after first reported:

https://bugzilla.mozilla.org/show_bug.cgi?id=254144

Funny that IE is the only one that &apos;does the right thing&apos; here - considering its usually the egregious offender.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>252317</commentid>
    <comment_count>10</comment_count>
    <who name="C. Scott Ananian">webkit</who>
    <bug_when>2010-07-15 22:14:34 -0700</bug_when>
    <thetext>There is now a work around for this bug, discussed in the comments to bug 32848.  You can use adoptNode() to move the iframe around, which will suppress the reload.

Eventually this workaround should work on Mozilla, too (although not soon: see http://groups.google.com/group/mozilla.dev.tech.dom/browse_thread/thread/960efae1f2ca7bfb?pli=1)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>839808</commentid>
    <comment_count>11</comment_count>
    <who name="Mike Sherov">mike.sherov</who>
    <bug_when>2013-02-22 12:21:04 -0800</bug_when>
    <thetext>Just chiming in here. This rears its head as an issue in jQueryUI: http://bugs.jqueryui.com/ticket/9067</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>839810</commentid>
    <comment_count>12</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2013-02-22 12:25:20 -0800</bug_when>
    <thetext>We tried do support this use case via magic iframe and failed: http://trac.webkit.org/changeset/111361

Keeping iframe alive while it&apos;s being moved inside a document is too hard.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>846791</commentid>
    <comment_count>13</comment_count>
    <who name="Mike Sherov">mike.sherov</who>
    <bug_when>2013-03-04 13:29:32 -0800</bug_when>
    <thetext>I&apos;m not sure this ticket should be closed. I&apos;m not asking for magic IFRAME. There was work done in 32848 that references this ticket implementing something once that was fixed. 

The adoptNode workaround mentioned in comment #12 is depending on someone implementing something further.

I could be reading it wrong, but it looks like there was work done for this.

A jsfiddle seems to indicate that the IFRAME still reloads: http://jsfiddle.net/jNLWw/

Forgive me if I&apos;m misunderstanding.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>846888</commentid>
    <comment_count>14</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2013-03-04 15:03:30 -0800</bug_when>
    <thetext>(In reply to comment #13)
&gt;
&gt; A jsfiddle seems to indicate that the IFRAME still reloads: http://jsfiddle.net/jNLWw/

That&apos;s the expected behavior. We have fixed this bug by adding a support for magic iframe but we had to remove that feature because it introduced lots of security vulnerabilities and other kinds of bugs.

Such as, we&apos;re not going to provide a way to move an iframe inside a DOM without reloading the content.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>