Bug 71809 - [test case] iframe with display:none not registering correctly in JS
Summary: [test case] iframe with display:none not registering correctly in JS
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml ecma (show other bugs)
Version: unspecified
Platform: FreeBSD Ports FreeBSD
: NOR grave
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
: 120820 139553 141273 141787 151800 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-01-04 12:10 UTC by John Gillis
Modified: 2008-01-14 03:53 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Gillis 2004-01-04 12:10:41 UTC
Version:            (using KDE KDE 3.1.4)
Installed from:    FreeBSD Ports
Compiler:          gcc version 2.95.4 20020320 [FreeBSD] 
OS:          FreeBSD

I'm having a problem with iframes not registering in the DOM correctly. First, as an aside, I'd like to note that iframes aren't appearing in window.frames.

However, this problem is that I am unable to use JavaScript to fool with the IFRAME. In fact, I can't figure out what path to take to get there. Here's a simple example:

----------------------- test.html

<html><head><script>
function test() {
  if (navigator.appName == "Konqueror")
    var start = document.all["newframe"];
  else
    var start = window.frames[0];

  // Doesn't appear in Mozilla, appears as test2.html in Konq
  window.alert(start.src);
  // Mozilla shows test2.html; Konq shows test.html
  window.alert(start.document.location);
}
</script></head>
<body onLoad="test();">
<iframe id=newframe src=test2.html>
</body></html>

------------------------- test2.html

<html><body>test 2</body></html>

------------------------------------------

In Mozilla (haven't tested in Windows), using window.frames[0].document provides the full interface to the iframe's object. Is there a work around for the time being that anyone may know?
Comment 1 John Gillis 2004-01-17 16:53:27 UTC
After further testing, that does work. D'oh.

However, my actual still does not, and I figured out why. I set the display of the frame to none, so it will be broken if you change this line:

< <iframe id=newframe src=test2.html>
> <iframe id=newframe style="display: none;" src=test2.html>

	For now, I hide it after the page has loaded, and I can access the iframe via javascript.
Comment 2 Allan Sandfeld 2005-04-13 23:47:30 UTC
So hidden frames are not accessable in window.frames?
Comment 3 Germain Garand 2005-10-24 02:47:15 UTC
updating summary to match comment #1
Comment 4 Louai Al-Khanji 2006-08-30 20:45:20 UTC
Hi, is this still an issue?
Comment 5 Maksim Orlovich 2006-09-02 02:38:30 UTC
I am pretty sure it is, though window.frames["foo"] should work reliably due to an unrelated change..
Comment 6 illogic-al 2007-01-06 14:32:51 UTC
The "testcase" does not test the bug in question. Could you provide an updated testcase and attach it here?
Comment 7 John Gillis 2007-01-06 18:09:44 UTC
It doesn't? I had missed the display: none in the first post... This bug 
is 3 years old, and I was really just trying to do some AJAXy stuff, so 
it's not that important to me anymore.
Comment 8 Martin Fitzpatrick 2007-01-08 21:18:19 UTC
Confirmed on KDE 3.5.5 / Kubuntu 6.10. Updated test case is available here: http://www.mutube.com/x/kde/bug71809/test.html

As mentioned by original reporter, viewing under Firefox vs. Konqueror returns different values for the ...[frame].src & ...[frame].document.location return different values.  Hopefully the new test case will make this a little clearer.
Comment 9 Martin Fitzpatrick 2007-01-08 23:46:01 UTC
Note with regard to previous comment/test case. It appears that now display:none has no effect - rather that there is incorrect behaviour regardless of whether the iframe is visible or not. Can someone confirm what I am seeing?
Comment 10 Germain Garand 2007-02-06 13:27:56 UTC
*** Bug 141273 has been marked as a duplicate of this bug. ***
Comment 11 Maksim Orlovich 2007-09-08 02:23:41 UTC
Worked on this a bit for today. ~1000 lines of changes, and now it works, but 
it needs tons of other work to make it stable/reliable, plus tons of testing. Needless to say it's 4.0 only. 

Also, re: #9 What you're seeing in that testcase is in large part due to how you grab the frame --- you get the <iframe> object and not the window object with konqueror UA!
Comment 12 Maksim Orlovich 2007-09-08 02:29:27 UTC
*** Bug 120820 has been marked as a duplicate of this bug. ***
Comment 13 Maksim Orlovich 2007-09-08 02:30:16 UTC
*** Bug 141787 has been marked as a duplicate of this bug. ***
Comment 14 Maksim Orlovich 2007-09-08 02:44:55 UTC
*** Bug 139553 has been marked as a duplicate of this bug. ***
Comment 15 Maksim Orlovich 2007-11-03 15:43:36 UTC
*** Bug 151800 has been marked as a duplicate of this bug. ***
Comment 16 Maksim Orlovich 2008-01-14 03:26:34 UTC
SVN commit 761089 by orlovich:

Move object loading to the DOM from the renderer, fixing the long-standing
major bug that hidden iframes couldn't be interacted with.

The basic overview here is that a new DOM base class, HTMLPartContainerElementImpl
is created, that manages the interaction with KHTMLPart when it
comes to loading child parts. KHTMLPart now keeps tracks of those
per ChildFrame (along the way removing the confusion of having 2 m_frames
in close quarters talking about different things); and the DOM
objects for iframe/object/embed/frame/etc. request the loading themselves
as needed. The renderer "just" displays the part widget set from the DOM

BUG: 71809
BUG: 150240
(and probably others)


 M  +1 -1      ecma/kjs_html.cpp  
 M  +4 -4      ecma/kjs_window.cpp  
 M  +92 -69    html/html_baseimpl.cpp  
 M  +8 -4      html/html_baseimpl.h  
 M  +351 -51   html/html_objectimpl.cpp  
 M  +70 -8     html/html_objectimpl.h  
 M  +33 -33    khtml_part.cpp  
 M  +7 -6      khtml_part.h  
 M  +2 -1      khtmlpart_p.h  
 M  +8 -252    rendering/render_frames.cpp  
 M  +0 -17     rendering/render_frames.h  
 M  +2 -4      xml/dom_docimpl.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=761089
Comment 17 Maksim Orlovich 2008-01-14 03:53:30 UTC
SVN commit 761099 by orlovich:

Regression test for 71809/150240 + some baseline updates
CCBUG:150240
CCBUG:71809


 M             baseline/css21/t0801-c412-hz-box-00-b-a.html-dump.png  
 M  +8 -20     baseline/css21/t0801-c412-hz-box-00-b-a.html-render  
 A             baseline/frames/iframe-hidden.html-dom  
 AM            baseline/frames/iframe-hidden.html-dump.png  
 A             baseline/frames/iframe-hidden.html-render  
 M             baseline/mozilla/dom/dom-html/helmobj.html-dump.png  
 M  +4 -11     baseline/mozilla/dom/dom-html/helmobj.html-render  
 M  +1 -1      baseline/mozilla/dom/dom-html/hisi000.html-dom  
 M             baseline/mozilla/dom/dom-html/hisi000.html-dump.png  
 M  +19 -19    baseline/mozilla/dom/dom-html/hisi000.html-render  
 M  +23 -0     baseline/mozilla/dom/dom-html/hobj028.html-dom  
 M             baseline/mozilla/dom/dom-html/hobj028.html-dump.png  
 M  +9 -16     baseline/mozilla/dom/dom-html/hobj028.html-render  
 M             baseline/mozilla/dom/dom-html/htbl032.html-dump.png  
 M  +38 -38    baseline/mozilla/dom/dom-html/htbl032.html-render  
 M             baseline/mozilla/dom/dom-html/htbl033.html-dump.png  
 M  +27 -27    baseline/mozilla/dom/dom-html/htbl033.html-render  
 M             baseline/mozilla/dom/dom-html/htbl034.html-dump.png  
 M  +27 -27    baseline/mozilla/dom/dom-html/htbl034.html-render  
 M             baseline/mozilla/dom/dom-html/htbl035.html-dump.png  
 M  +21 -21    baseline/mozilla/dom/dom-html/htbl035.html-render  
 M             baseline/mozilla/dom/dom-html/htbl051.html-dump.png  
 M  +21 -21    baseline/mozilla/dom/dom-html/htbl051.html-render  
 M  +1 -1      baseline/mozilla/dom/dom-html/htcl009.html-dom  
 M             baseline/mozilla/dom/dom-html/htcl009.html-dump.png  
 M  +2 -2      baseline/mozilla/dom/dom-html/htcl009.html-render  
 M             baseline/mozilla/html_401/table_rules_all.html-dump.png  
 M  +23 -23    baseline/mozilla/html_401/table_rules_all.html-render  
 M             baseline/mozilla/html_401/table_rules_cols.html-dump.png  
 M  +32 -32    baseline/mozilla/html_401/table_rules_cols.html-render  
 M             baseline/mozilla/html_401/table_rules_groups.html-dump.png  
 M  +45 -45    baseline/mozilla/html_401/table_rules_groups.html-render  
 M             baseline/mozilla/html_401/table_rules_rows.html-dump.png  
 M  +31 -31    baseline/mozilla/html_401/table_rules_rows.html-render  
 M             baseline/webcore/fast/css/ZeroOpacityLayers.html-dump.png  
 M  +1 -1      baseline/webcore/fast/dom/client-width-height-quirks.html-dom  
 M             baseline/webcore/fast/dom/client-width-height-quirks.html-dump.png  
 M  +1 -1      baseline/webcore/fast/dom/client-width-height-quirks.html-render  
 A             tests/frames/iframe-hidden.html  
 M  +2 -0      tests/webcore/fast/frames/ignore  


WebSVN link: http://websvn.kde.org/?view=rev&revision=761099