<?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>7899</bug_id>
          
          <creation_ts>2006-03-21 20:18:19 -0800</creation_ts>
          <short_desc>FrameTree:uniqueChildName doesn&apos;t return unique names</short_desc>
          <delta_ts>2017-01-28 11:00:20 -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>Frames</component>
          <version>420+</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=167537</see_also>
          <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="Justin Garcia">justin.garcia</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>brettw</cc>
    
    <cc>darin</cc>
    
    <cc>ddkilzer</cc>
    
    <cc>ian</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>37265</commentid>
    <comment_count>0</comment_count>
    <who name="Justin Garcia">justin.garcia</who>
    <bug_when>2006-03-21 20:18:19 -0800</bug_when>
    <thetext>The number used for unique frame names is the childCount() of the parent frame:
    char suffix[40];
    snprintf(suffix, sizeof(suffix), &quot;/&lt;!--frame%u--&gt;--&gt;&quot;, childCount());
This is wrong.  See the attached test case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37266</commentid>
    <comment_count>1</comment_count>
      <attachid>7224</attachid>
    <who name="Justin Garcia">justin.garcia</who>
    <bug_when>2006-03-21 20:26:51 -0800</bug_when>
    <thetext>Created attachment 7224
testcase

Creates two unnamed iframes, removes the first one and reinserts it.  It gets a generated name when it is reinserted, but that name is the same as the frame that is already in the document.  This name collision prevents the inserted frame from being constructed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>40245</commentid>
    <comment_count>2</comment_count>
      <attachid>11979</attachid>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2006-12-22 23:12:15 -0800</bug_when>
    <thetext>Created attachment 11979
reduction1

Attaching two unique reductions for triggering this bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>40220</commentid>
    <comment_count>3</comment_count>
      <attachid>11980</attachid>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2006-12-22 23:12:59 -0800</bug_when>
    <thetext>Created attachment 11980
reduction2

Attaching two unique reductions for how you can trigger this bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>40221</commentid>
    <comment_count>4</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2006-12-22 23:17:41 -0800</bug_when>
    <thetext>It would be trivial to fix this bug by replacing childCount() with a never-decrementing count of the number of frames that have been added to the page. In fact, we could gut the whole uniqueChildName function and just use the count for unique-ing.

Since a page can have a maximum of 200 frames, the count would be (virtually) guaranteed to be unique.

The only problem is this comment: &quot;Create a repeatable name.&quot; Why does the name need to be repeatable? What does repeatable mean? Using a global count would give a frame a new name if you removed and then re-added it to the document. So I don&apos;t think that would be &quot;repeatable.&quot;

On the other hand, this bug demonstrates that frames *need* to acquire new names when you remove and then re-add them to the document.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>38901</commentid>
    <comment_count>5</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2006-12-30 12:50:50 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt; The only problem is this comment: &quot;Create a repeatable name.&quot; Why does the name
&gt; need to be repeatable? What does repeatable mean? Using a global count would
&gt; give a frame a new name if you removed and then re-added it to the document. So
&gt; I don&apos;t think that would be &quot;repeatable.&quot;

My understanding was that the name of the frame needs to be the same for the same page the next time the page is loaded. Something about back/forward perhaps?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2894</commentid>
    <comment_count>6</comment_count>
    <who name="Brett Wilson (Google)">brettw</who>
    <bug_when>2007-08-07 11:31:09 -0700</bug_when>
    <thetext>*** Bug 14895 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2895</commentid>
    <comment_count>7</comment_count>
    <who name="Brett Wilson (Google)">brettw</who>
    <bug_when>2007-08-07 11:49:55 -0700</bug_when>
    <thetext>This bug is causing some crashes for me, and is showing up in the topcrash list for my embedding application. Should it be P1?

The crash is in EventHandler::passWheelEventToWidget (and presumably other input events) when you use the scroll wheel over certain iframes (seems to depend on timing, can can be hard to reproduce) because the widget for the RenderWidget is NULL.

The widget is normally set when the load is committed for the frame, which of course requires that the load be started. The load is started from the redirect timer in the FrameLoader.

What happens is that frame 1 comes in and sets the redirect timer to start the load. Other stuff happens, frames get deleted, etc. to cause the name to be the same (this is where the timing sutff comes in). Frame 2 then gets created and happens to get the same &quot;unique&quot; child name as Frame 1. In FrameLoader::requestFrame, we now get the *old* frame in |frame|, cancel the old (correct) load, and start loading the new frame&apos;s URL in it. Frame 2 is never initialized, leading to a crash.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2824</commentid>
    <comment_count>8</comment_count>
    <who name="Brett Wilson (Google)">brettw</who>
    <bug_when>2007-08-08 09:05:25 -0700</bug_when>
    <thetext>Actually, it looks like this crash doesn&apos;t happen in Safari since the Mac Event handling code filters out sending messages to anything with a NULL widget. However, this still causes frames to not be loaded, as in the example. There could be other subtle bugs and crashes caused by the uninitialized frame, as well as, of course, the missing content.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2762</commentid>
    <comment_count>9</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-08-09 07:05:01 -0700</bug_when>
    <thetext>(In reply to comment #8)
&gt; Actually, it looks like this crash doesn&apos;t happen in Safari since the Mac Event
&gt; handling code filters out sending messages to anything with a NULL widget.
&gt; However, this still causes frames to not be loaded, as in the example. There
&gt; could be other subtle bugs and crashes caused by the uninitialized frame, as
&gt; well as, of course, the missing content.

How is it crashing in your application but not in Safari?  Are you using WebKit in your application?  A (partial) stack trace of the issue would be helpful.

</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="0"
              isprivate="0"
          >
            <attachid>7224</attachid>
            <date>2006-03-21 20:26:51 -0800</date>
            <delta_ts>2006-12-22 23:12:15 -0800</delta_ts>
            <desc>testcase</desc>
            <filename>iframe-test.html</filename>
            <type>text/html</type>
            <size>674</size>
            <attacher name="Justin Garcia">justin.garcia</attacher>
            
              <data encoding="base64">CjxzY3JpcHQ+CmZ1bmN0aW9uIHJ1blRlc3QoKSB7CiAgICB2YXIgZnJhbWVzID0gZG9jdW1lbnQu
Z2V0RWxlbWVudHNCeVRhZ05hbWUoImlmcmFtZSIpOwogICAgdmFyIGZyYW1lID0gZnJhbWVzWzBd
OwogICAgdmFyIHBhcmVudCA9IGZyYW1lLnBhcmVudE5vZGU7CiAgICAKICAgIHBhcmVudC5yZW1v
dmVDaGlsZChmcmFtZSk7CiAgICBwYXJlbnQuYXBwZW5kQ2hpbGQoZnJhbWUpOwogICAgCn0KPC9z
Y3JpcHQ+Cgo8Ym9keT4KVGhpcyB0ZXN0IGNyZWF0ZXMgdHdvIHVubmFtZWQgZnJhbWVzLCB0aGVu
IHJlbW92ZXMgdGhlIGZpcnN0IG9uZSBhbmQgcmVpbnNlcnRzIGl0LiAgVGhlIG5hbWUgZ2VuZXJh
dGVkIGZvciB0aGF0IGZyYW1lIHdoZW4gaXQgaXMgcmVpbnNlcnRlZCBpcyB0aGUgc2FtZSBhcyB0
aGUgZnJhbWUgdGhhdCBpcyBhbHJlYWR5IGluIHRoZSBkb2N1bWVudC4gIEFzIGEgcmVzdWx0IG9m
IHRoZSBjb2xsaXNpb24sIHRoZSBpbnNlcnRlZCBmcmFtZSBpc24ndCBjb25zdHJ1Y3RlZC48YnI+
PGJyPjxicj4KPGlmcmFtZSBzcmM9Imh0dHA6Ly93d3cuZ29vZ2xlLmNvbS90YWxrLyI+PC9pZnJh
bWU+CjxpZnJhbWUgc3JjPSJodHRwOi8vd3d3Lmdvb2dsZS5jb20vaW50bC9lbi9hYm91dC5odG1s
Ij48L2lmcmFtZT4KPHNjcmlwdD5ydW5UZXN0KCk7PC9zY3JpcHQ+CjwvYm9keT4=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>11979</attachid>
            <date>2006-12-22 23:12:15 -0800</date>
            <delta_ts>2006-12-22 23:12:15 -0800</delta_ts>
            <desc>reduction1</desc>
            <filename>scratch.html</filename>
            <type>text/html</type>
            <size>338</size>
            <attacher name="Geoffrey Garen">ggaren</attacher>
            
              <data encoding="base64">PGRpdj5Zb3Ugc2hvdWxkIHNlZSB0d28gImhlbGxvIHdvcmxkcyIgYmVsb3cuPC9kaXY+Cjxocj4K
CjxpZnJhbWUgc3JjPSJkYXRhOnRleHQvaHRtbCwgPHA+aGVsbG8gd29ybGQ8L3A+Ij48L2lmcmFt
ZT4KPGlmcmFtZSBzcmM9ImRhdGE6dGV4dC9odG1sLCA8cD5oZWxsbyB3b3JsZDwvcD4iPjwvaWZy
YW1lPgoKPHNjcmlwdD4KdmFyIGZyYW1lID0gZG9jdW1lbnQuZ2V0RWxlbWVudHNCeVRhZ05hbWUo
J2lmcmFtZScpWzBdOwp2YXIgcGFyZW50ID0gZnJhbWUucGFyZW50Tm9kZTsKCnBhcmVudC5yZW1v
dmVDaGlsZChmcmFtZSk7CnBhcmVudC5hcHBlbmRDaGlsZChmcmFtZSk7Cjwvc2NyaXB0Pgo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>11980</attachid>
            <date>2006-12-22 23:12:59 -0800</date>
            <delta_ts>2006-12-22 23:12:59 -0800</delta_ts>
            <desc>reduction2</desc>
            <filename>scratch2.html</filename>
            <type>text/html</type>
            <size>442</size>
            <attacher name="Geoffrey Garen">ggaren</attacher>
            
              <data encoding="base64">PGRpdj5Zb3Ugc2hvdWxkIHNlZSB0d28gImhlbGxvIHdvcmxkcyIgYmVsb3cuPC9kaXY+Cjxocj4K
CjxpZnJhbWUgc3JjPSJkYXRhOnRleHQvaHRtbCwgPHA+aGVsbG8gd29ybGQ8L3A+Ij48L2lmcmFt
ZT4KPGlmcmFtZSBzcmM9ImRhdGE6dGV4dC9odG1sLCA8cD5oZWxsbyB3b3JsZDwvcD4iPjwvaWZy
YW1lPgoKPHNjcmlwdD4KdmFyIGZyYW1lID0gZG9jdW1lbnQuZ2V0RWxlbWVudHNCeVRhZ05hbWUo
J2lmcmFtZScpWzBdOwp2YXIgcGFyZW50ID0gZnJhbWUucGFyZW50Tm9kZTsKCnBhcmVudC5yZW1v
dmVDaGlsZChmcmFtZSk7Cgp2YXIgbmV3RnJhbWUgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdp
ZnJhbWUnKTsKbmV3RnJhbWUuc3JjPSJkYXRhOnRleHQvaHRtbCwgPHA+aGVsbG8gd29ybGQ8L3A+
IjsKcGFyZW50LmFwcGVuZENoaWxkKG5ld0ZyYW1lKTsKPC9zY3JpcHQ+Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>