Closed
Bug 71000
Opened 24 years ago
Closed 24 years ago
[RFE] XUL iframe onload event
Categories
(Core :: XUL, enhancement)
Core
XUL
Tracking
()
VERIFIED
WONTFIX
People
(Reporter: rvj, Assigned: hyatt)
Details
Attachments
(4 files)
it appears that no onload event is available for XUL iframe/browser/editor
elements to tell if a document (htm, xml, gif, etc) has loaded or not.
Is this planned and if not could it be?
When developing UIs some means of letting XUL scripts know when to begin
processing is needed.
As a work around, I have attempted to find a method of notifying XUL from the
document itself but security seems to prevent even this option.
Apologies if this a duplicate (could nt find in XUL component)
Updated•24 years ago
|
Severity: normal → enhancement
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: other → All
Hardware: Other → All
Summary: [RFE}xul iframe onload event → [RFE] XUL iframe onload event
Comment 2•24 years ago
|
||
Marking NEW.
Assignee | ||
Comment 3•24 years ago
|
||
You do it using iframElt.addEventListener("load", myFunc, true);
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → INVALID
Sorry if I'm missing something obvious but I still cant see whats necessary to
get the iframe load event to fire (attaching xul)
I've even altered the src assignment until after the eventlisterner is added
(just in case it arrived beforehand) but still no joy.
Even worse the frame does not load at all- is this a separate bug? Thanks.
Comment 6•24 years ago
|
||
uh, if it isn't loading, why would you expect its load handler to fire?
ok but that was the last test I tried which seems to show up another bug
associated with setting the src attribute.
a) should I report it as a separate bug?
modified version of test case with src preset attached
b) can you confirm whether the iframeloaded function fires?
Comment 9•24 years ago
|
||
There is no (to my knowledge) 'src' _property_ for the iframe binding.
The correct way to set the 'src' attribute is through the DOM 'setAttribute'
method, e.g.,
document.getElementById('someiframe').setAttribute('src','http://www.w3.org');
However, when I add the load listener (either bubbling or capturing), I am
not getting any event notifications (e.g., neither 'load', nor 'click' comes
through).
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
Comment 10•24 years ago
|
||
... although iframe derives from an html iframe which does have that .src
property for its DOM, but the xul iframe is not picking that up from html.
Reporter | ||
Comment 11•24 years ago
|
||
thanks - revised test case now works !
ps I guess that if src is preset the load event is not fired (maybe because it
has already arrived?)
Reporter | ||
Comment 12•24 years ago
|
||
Reporter | ||
Comment 13•24 years ago
|
||
spoke too soon !
new test case (iframe resized after load event ) results in flashing effect (is
it continually reloading?)
I know there are a number of onload event bugs pending - is this one of them?
Reporter | ||
Comment 14•24 years ago
|
||
Reporter | ||
Comment 15•24 years ago
|
||
and finally (today) ..........
I've noticed that the onload event fires fairly reliably for wan http locations
however this does not seem to be true of lan based http locations .
FYI After clearing cache memory and disc the onload event will fire when the
XUL application is started. However when the XUL application is subsequently
restarted it does not. (a caching issue?)
Assignee | ||
Comment 16•24 years ago
|
||
I already have a bug about adding the src property to iframes and browsers.
Comment 17•24 years ago
|
||
I don't understand, <iframe> has a src in the guide.
http://www.mozilla.org/xpfe/xulref/iframe.html
Assignee | ||
Comment 18•24 years ago
|
||
This bug is bogus. Events in the content DOM don't bubble across iframes. Only
in chrome docshells does this sort of bubbling occur (and HTML iframes have a
hack that allows you to put onload right on the iframe).
If you disagree with this behavior, file an RFE on jst@netscape.com to request
that events cross iframe boundaries by default in content.
Status: REOPENED → RESOLVED
Closed: 24 years ago → 24 years ago
Resolution: --- → WONTFIX
Comment 19•24 years ago
|
||
Thanks hyatt. Sorry for not getting back to this yesterday. Marking verified.
(To answer boberp last comment: the xul <iframe> has a 'src' _attribute_
( as in <iframe src="..." >), but does not have a 'src' _property_, (as in
document.getElementById('aFrame').src = "...";)
Status: RESOLVED → VERIFIED
Comment 20•24 years ago
|
||
rvj asked me to clarify the last two comments, and I couldn't because I have no
idea what was being said. What is docshell?
AFAIK, Mozilla doesn't support iframe onload events.
<iframe onload="alert('Blah')" src="www.excite.com">
The alert will never fire. bug 60173. Although this isn't a dupe because he is
talking about XUL.
Comment 21•24 years ago
|
||
Add this file as 'foop.xul' to your comm.jar package, in the
/content/navigator/ folder.
Then enter
mozilla -console -chrome chrome://content/navigator/foop.xul
<?xml version="1.0"?>
<window
xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="loadxul();"
height="400px"
width="400px"
align="vertical" >
<script>
<![CDATA[
var url = ['http://www.mozilla.org/xpfe/',
'http://www.mozilla.org/'];
var idx = 0;
function iframeloaded() {
dump("iframeloaded\n");
idx = ++idx % url.length;
window.setTimeout('foop()', 2000);
}
function loadxul() {
dump("loadxul\n");
document.getElementById("iframe").
addEventListener("load", iframeloaded, true);
window.setTimeout('foop()', 2000);
}
function foop() {
dump('foop : ' + url[idx] + '\n');
document.getElementById("iframe").setAttribute('src', url[idx]);
}
]]>
</script>
<iframe id="iframe" src="http://www.mozilla.org/" flex="1"/>
</window>
Comment 22•24 years ago
|
||
And yes, it appears that jst has not done the stuff for iframe onload for
html (bug 60173 as noted).
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: jrgmorrison → xptoolkit.widgets
You need to log in
before you can comment on or make changes to this bug.
Description
•