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?
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.
So hidden frames are not accessable in window.frames?
updating summary to match comment #1
Hi, is this still an issue?
I am pretty sure it is, though window.frames["foo"] should work reliably due to an unrelated change..
The "testcase" does not test the bug in question. Could you provide an updated testcase and attach it here?
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.
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.
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?
*** Bug 141273 has been marked as a duplicate of this bug. ***
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!
*** Bug 120820 has been marked as a duplicate of this bug. ***
*** Bug 141787 has been marked as a duplicate of this bug. ***
*** Bug 139553 has been marked as a duplicate of this bug. ***
*** Bug 151800 has been marked as a duplicate of this bug. ***
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
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