Bug 141787

Summary: iframe display style set to none => contentDocument is empty
Product: [Applications] konqueror Reporter: Stevan White <stevan_white>
Component: khtmlAssignee: Konqueror Developers <konq-bugs>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:

Description Stevan White 2007-02-16 15:31:56 UTC
Version:           3.5.5 (using KDE KDE 3.5.5)
Installed from:    Ubuntu Packages
OS:                Linux

If the CSS style display of an iframe is set to none, then the DOM contentDocument member of the iframe object remains null, even though the onload() event fires.

This behaviour is unlike that in Firefox, Opera, and IE6.

I expect the iframe's src to be loaded regardless of whether it is displayed or not, and for its onload() event to fire when the src has loaded.
Comment 1 Stevan White 2007-02-16 15:35:48 UTC
Code to play with:

<iframe style="display: none"
        id="iframe1"
        src="some_external_text_file"
        onload="iframe_loaded();"
        >
</iframe>

<script type="text/javascript">
function iframe_loaded() {
        alert( document.getElementById( "iframe1" ).contentDocument );
}
</script>
Comment 2 Maksim Orlovich 2007-09-08 02:30:15 UTC

*** This bug has been marked as a duplicate of 71809 ***
Comment 3 Stevan White 2009-05-05 10:27:21 UTC
This problem is resolved, as of at least KDE 4.2.2.

Thanks!