Bug 3581 - iFrames set to display:none are Missing from frames array
Summary: iFrames set to display:none are Missing from frames array
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 412
Hardware: Macintosh OS X 10.4
: P2 Normal
Assignee: Anders Carlsson
URL:
Keywords:
: 8976 9277 (view as bug list)
Depends on:
Blocks: 9610
  Show dependency treegraph
 
Reported: 2005-06-16 17:02 PDT by David Wheeler
Modified: 2006-07-05 16:16 PDT (History)
3 users (show)

See Also:


Attachments
Test Case (230 bytes, text/plain)
2005-06-16 17:03 PDT, David Wheeler
no flags Details
Screen shot of Safari rendering this test case (79.26 KB, image/png)
2005-06-17 09:04 PDT, Chris Petersen
no flags Details
Screen shot of Mac Firefox 1.0.4 rendering this test case (48.78 KB, image/png)
2005-06-17 09:06 PDT, Chris Petersen
no flags Details
Patch (39.73 KB, patch)
2006-07-05 11:28 PDT, Anders Carlsson
andersca: review-
Details | Formatted Diff | Diff
Better patch (40.93 KB, patch)
2006-07-05 13:18 PDT, Anders Carlsson
no flags Details | Formatted Diff | Diff
Patch without tabs (40.96 KB, patch)
2006-07-05 13:32 PDT, Anders Carlsson
mjs: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Wheeler 2005-06-16 17:02:48 PDT
* SUMMARY
iframes with their CSS set to "display:none" are not included in the frames
array but should be.

* STEPS TO REPRODUCE
1. open testcase
2. Note that it displays "1"
3. Edit testcase to remove 'style="display:none"'.
4. Reload testcase.
5. Note that it now displays "2".

* RESULTS
There are two iframes in the HTML, but only one appears in the frames array.

* EXPECTED RESULTS
Both iframes should appear in the frames array, even if one is set to
"display:none". Such is the case in Firefox.
Comment 1 David Wheeler 2005-06-16 17:03:13 PDT
Created attachment 2410 [details]
Test Case
Comment 2 Chris Petersen 2005-06-17 09:02:18 PDT
I see this issue on Safari 2.0 (v412) and TOT WebKit under 10.4.1(8B15). I have attached a screen shot of 
what is displayed under Safari 2.0 and Firefox 1.0.4.
Comment 3 Chris Petersen 2005-06-17 09:04:56 PDT
Created attachment 2440 [details]
Screen shot of Safari rendering this test case
Comment 4 Chris Petersen 2005-06-17 09:06:16 PDT
Created attachment 2441 [details]
Screen shot of Mac Firefox 1.0.4 rendering this test case
Comment 5 David Kilzer (:ddkilzer) 2006-02-13 14:14:45 PST
This bug may be related to (or the root cause of) Bug 6926 and Bug 7237.
Comment 6 Alexey Proskuryakov 2006-05-18 14:06:27 PDT
*** Bug 8976 has been marked as a duplicate of this bug. ***
Comment 7 Alexey Proskuryakov 2006-06-04 10:37:52 PDT
*** Bug 9277 has been marked as a duplicate of this bug. ***
Comment 8 Eric Seidel (no email) 2006-07-03 09:43:07 PDT
Another manifestation of this caused me several hours of headaches on our site:

<div id="test">
  <iframe id="iframe" name="iframe" src=""></iframe>
  <form target="iframe">
    <input type="submit" onclick="document.getElementById('test').style.display='none'"/>
  </form>
</div>
Comment 9 Eric Seidel (no email) 2006-07-03 11:02:56 PDT
The effect of the above code, is that instead of submitting the form in the iframe, the user is assaulted by a new window! :(
Comment 10 Adele Peterson 2006-07-03 17:07:46 PDT
we don't actually create Frame objects for frame nodes that don't have renderers.  We probably need to start doing that so frame's with display:none get appended to the FrameTree.  Or we could find another way to use the FrameArray in JS without using the FrameTree.  I'm not entirely sure how well that would work though.
Comment 11 Anders Carlsson 2006-07-05 11:28:18 PDT
Created attachment 9210 [details]
Patch
Comment 12 Anders Carlsson 2006-07-05 12:15:53 PDT
Comment on attachment 9210 [details]
Patch

This introduces crashes
Comment 13 Anders Carlsson 2006-07-05 13:18:52 PDT
Created attachment 9215 [details]
Better patch
Comment 14 Anders Carlsson 2006-07-05 13:32:17 PDT
Created attachment 9216 [details]
Patch without tabs
Comment 15 Maciej Stachowiak 2006-07-05 13:57:05 PDT
Comment on attachment 9216 [details]
Patch without tabs

r=me
Comment 16 Anders Carlsson 2006-07-05 14:24:37 PDT
Committed in r15170
Comment 17 David Wheeler 2006-07-05 14:34:57 PDT
Sweet, thanks for the fix. When should we look for a Safari release with this fix?
Comment 18 David Kilzer (:ddkilzer) 2006-07-05 16:13:58 PDT
(In reply to comment #17)
> Sweet, thanks for the fix. When should we look for a Safari release with this
> fix?

Apple doesn't comment on unreleased software, but if I had to guess, it would be Mac OS X 10.5 (Leopard).  Note that I am not an Apple engineer, nor am I employed by Apple.
Comment 19 David Wheeler 2006-07-05 16:16:25 PDT
Yeah, that was my guess, too. Pity if true.