Status isn't reset to "Done" after dynamically added Script Element finishes executing

RESOLVED DUPLICATE of bug 209330

Status

()

RESOLVED DUPLICATE of bug 209330
17 years ago
14 years ago

People

(Reporter: shankarp, Unassigned)

Tracking

({embed, topembed-})

Trunk
mozilla1.3final
embed, topembed-
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: DIGBug)

Attachments

(2 attachments)

(Reporter)

Description

17 years ago
Basically what I do here in the HTML snippet is, I create a "Script Element",
and add it to the DOM. 
After the element is added to the document's body, the element.onload event
fires, where in I display some alerts specific to the code, indicating that the
script has been evaled properly by the browser.
In NS6.2 even after the script fully executes, the Window's status is not set to
"Document Done" state.

Steps to Reproduce:
1) Open the attached HTML in a NS6.2/latest Gecko client.
2) Click on the "Click Here to Run The Test" button.
3) click ok on all the alerts, which are self explanatory.
4) Look at the Browser Window's status, it is still in the "Transferring Data
from ar.atwola.com..." eventhough the Javascript has been fully transferred &
evaled.

What to expect:
The browser window's status should say "Document Done" after executing the script.
(Reporter)

Comment 1

17 years ago
Created attachment 68243 [details]
Test HTML file to reproduce the bug.

Comment 2

17 years ago
Browser, not engine. Reassigning to DOM Level 0. 
Here is a sample of the code:

var element1 = null;

function loadScript() {
	// this is just a simple test to load a real JS file....
	// we could use a script array to load multiple scripts...
	var aFile = "http://ar.atwola.com/file/adsWrapper.js";
	// create a SCRIPT tag for loading the first script, 
	// if the SCRIPT tag already exists then reuse it for the 
	// subsequent scripts
	if (!element1) {
		element1 = document.createElement('SCRIPT');
		element1.src = aFile;
		handleState(element1);
		document.body.appendChild(element1);
	}
	else {
		var element2 = document.createElement('SCRIPT');
		element2.src = aFile;
		handleState(element2);
		document.body.replaceChild(element2, element1);

		// assign the new script to the old script after replacing,
		// so that we can use it again for the next script.
		element1 = element2;
	}
}
Assignee: rogerl → jst
Status: UNCONFIRMED → NEW
Component: JavaScript Engine → DOM Level 0
Ever confirmed: true
QA Contact: pschwartau → desale

Updated

17 years ago
Whiteboard: DIGBug
This works for me, I see "Document done." after clicking on the button and
dismissing all the alerts. Please reopen if I'm missing something.
Status: NEW → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → WORKSFORME
(Reporter)

Comment 4

17 years ago
Window status is set to "Document Done", but the Progress bar doesn't go away..
It looks to the user as if the browser is still trying to download something. 
Please look at the "Progress Bar" in the lower Right Hand side of the Status pane.

Thanks,
Shankar/.
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---

Comment 5

17 years ago
nomianting for nsbeta1 as a request from DIG.
Keywords: nsbeta1

Updated

17 years ago
Keywords: topembed

Comment 6

17 years ago
nsbeta1- for now. Please renominate if this causes other than cosmetic problems
and must be fixed for mozilla1.0.
Status: REOPENED → ASSIGNED
Keywords: nsbeta1 → nsbeta1-
Target Milestone: --- → mozilla1.1
Um, that was a comment from me, not from Nisheeth.

Comment 8

17 years ago
Minusing to topembed- and adding embed.  This is not a stop ship issue.
Keywords: topembed → embed, topembed-

Comment 9

17 years ago
Created attachment 83323 [details]
testcase, script and image updates

I saw similar behavior with the "transferring data..." status message not going
away.  I also saw in another example that the progress bar displays at full --
whereas the attachment 68243 [details] didn't cause that for me.

I tested this on Win2000 (2002051006), WinME (2002051208), and Mac OS 9
(2002051008) and all of those showed the same result.

Steps to reproduce:
1.) Load the attached file.
2.) Click either form button (to load image or script).

Actual behavior:
Status message reads, "Transferring data from www.embimedia.com..." and
progress bar displays at 100%.

Expected behavior:
Status bar should reset or do whatever it is supposed to be doing when media
elements have completely been loaded, and the progress meter should disappear.

Comment 10

17 years ago
I also saw similiar behaviour with "transferring data" message or the progress
bar which does not go away. 

1. Open http://www.tagesschau.de
2. Wait until the page is loaded (Document: Done)
3. Move the mouse over the menu in the upper left corner (Fernsehen, Hörfunk)
4. A submenu opens
5. The "transferring data" message as well as the progress bar reappear

Expected: After the page has been loaded sucessfully, the progress bar and the
"transferring data" message should not reappear

I hope this gets fixed for mozilla1.0

Updated

16 years ago
OS: Windows 2000 → All
Hardware: PC → All
Summary: Window's status is not reset to "Document Done" after a Script Element that has been added to the DOM dynamically using a script src tag has finished executing. → Status isn't reset to "Done" after dynamically added Script Element finishes executing

Updated

16 years ago
Target Milestone: mozilla1.1alpha → mozilla1.3alpha

Updated

16 years ago
Target Milestone: mozilla1.3alpha → mozilla1.3final
Mass-reassigning bugs to dom_bugs@netscape.com
Assignee: jst → dom_bugs
Status: ASSIGNED → NEW

Comment 12

14 years ago
I also see this bug with some JavaScript that is not dynamically inserted into 
the DOM, but just creates a dynamic image request ("new Image(...)") and 
associates it with the document ("document.myArray[0] = image"). 

Seeing it with almost all versions but definitely as recent as 1.7 
Gecko/20040707.

Comment 13

14 years ago
I met the same bug. Solved it with some additional javascript, loading a hidden
empty iframe with an empty source after the dynamic scripting is done. Status
bar says 'done', but not able to modify the status bar text. Not an imortant bug
but from a users point of view very annoying.
Example @ http://www.nicon.nl/rsjs/testxhttp.html [sloppy I suppose, but shows
the solution for the time being]

Comment 14

14 years ago
(In addition to comment #13)
> I met the same bug. Solved it with some additional javascript, loading a hidden
> empty iframe with an empty source after the dynamic scripting is done. Status
> bar says 'done', but not able to modify the status bar text. Not an imortant bug
> but from a users point of view very annoying.
> Example @ http://www.nicon.nl/rsjs/testxhttp.html [sloppy I suppose, but shows
> the solution for the time being]

Reworked the original example script, now able to manipulate the status bar
also. See http://www.nicon.nl/rsjsdef/nwxhttp.html, hit source button to view
source.

Works now in current trunk build. Fixed by bug 209330.

*** This bug has been marked as a duplicate of 209330 ***
Status: NEW → RESOLVED
Last Resolved: 17 years ago14 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.