Closed Bug 21459 Opened 25 years ago Closed 25 years ago

[DOGFOOD] Can not submit form onLoad event.

Categories

(Core :: DOM: UI Events & Focus Handling, defect, P1)

x86
All
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: desale, Assigned: rpotts)

References

()

Details

(Whiteboard: [PDT+][BLOCKER][TESTCASE])

If we try to submit form onLoad event then form does not get submitted. On the
other hand form submission with button click and other ways is working fine.
Just form submission could not be done onLoad of page.

BUILDS: 1999-12-10-09. 1999-12-09-20.

STEPS TO REPRODUCE:
1]Please visit URL mentioned above with mentioned builds. [As soon as you open
this page form should get submitted and you should see resluts of cgi file.
which does not happen.]
2] Click on Submit button. [Now you can see that form got submitted, which
should have happened as soon as we load page because we are calling same submit
function onClick of this submit button.]

------- OR -------

1] Please copy HTML code I'm providing. Save it as HTML file.
2] Copy CGI code I'm providing. Save it as CGI file.
3] Change action form action in HTML file according to location of your cgi
file.
4] Open HTML file with above mentioned builds. [As soon as you open this page
form should get submitted and you should see resluts of cgi file. which does not
happen.]
5] Click on Submit button. [Now you can see that form got submitted, which
should have happened as soon as we load page because we are calling same submit
function onClick of this submit button.]


EXPECTED RESULTS:
As soon as we load the page, form submission should occur and we should see
something like follows on screen.
Text Value is: Temp Text Value
Hidden Value is: Temp Hidden Value

ACTUAL RESULTS:
Form submission does not occur onLoad event of page. We need to click submit
button to actually submit form.

TESTCASE HTML CODE START:

<html>
<head>
<title>Form Submission onLoad Event</title>
</head>
<script>
<!--
function SubForm(){
document.workform.submit();
}
//-->
</script>
<body onLoad="SubForm();">
<form name="workform" action="http://bubblegum/desale/cgi-bin/onloadsub.cgi"
method="post" >
Text to Input<input type="text" name="temptext" value="Temp Text Value"
size="40"><br>
This is Hidden<input type="hidden" name="tempsel" value="Temp Hidden Value"
><br>
<input type=button name="button2" value="Submit" onclick="SubForm();">
</form>
</body>
</html>

TESTCASE HTML CODE END:

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

TESTCASE CGI CODE START:

#!/usr/local/bin/perl
require "cgi-lib.pl";
print "Content-type: text/html", "\n\n";
MAIN:
{
&ReadParse(*input);
$textval = $input{'temptext'};
$selval = $input{'tempsel'};
print "<HTML>\n";
print "<HEAD>\n";
print "<TITLE>CGI Test</TITLE>\n";
print "</HEAD>\n";
print "<BODY>\n";
print "<H2> Text Value is:    $textval</H2><br>\n";
print "<H2> Hidden Value is:    $selval</H2><br>\n";
print "</BODY>\n";
print "</HTML>\n";
}
exit(0);

TESTCASE CGI CODE END:

Now onLoad Event works fine if we try to call alert box onLoad of any page. So
onLoad event in intself is working fine. Submission process on itself is also
working fine. Just combination is not working. Means if we try submission onLoad
then it does not work.
I tried to give as much information as much I can. Let me know if you need any
more information on this.
Priority: P3 → P1
Whiteboard: [BLOCKER][TESTCASE]
QA Contact: janc → desale
Summary: Can not submit form onLoad event. → [DOGFOOD] Can not submit form onLoad event.
This happens on Win32, Mac, and possibly on Linux too.
Can we have an example for PDT of where this happens in real life? What pages or
sites? Thanks
Our automation driver uses submit onLoad. You could
1] visit http://bubblegum/ngdriver/tester.html
2] Click "Find Suites In" button.
3] Let select belove button load with all suites names.
4] Select one suite from select.
5] Click "Run Suite(s)" Button.

Expected Results: It should run all the testcases in that suite.

Actual Results: It hangs at first testcase because it could not submit form
onLoad.
Whiteboard: [BLOCKER][TESTCASE] → [PDT+][BLOCKER][TESTCASE]
Putting on PDT+ radar.
So the problem here seems to be that the onload is firing before layout has
finished building its internal model.  Specifically this can be tracked in
that for most pages, nsWebShell::OnEndDocumentLoad fires before
HTMLContentSink::DidBuildModel.  This is a problem, probably network related.
Looking into getting more help on it, adding rpotts to CC list.
Blocks: 11349
Assignee: joki → rpotts
hey tom,

Yeah, it looks like when the cache landed in HTTP the order of the notifications
got swapped...  Now the channel is removed from the loadgroup (causing an
OnEndDocumentLoad) *before* the consumer's OnStopRequest (ie. layout) is called.

I'll try to fix this up...  So, I guess it's my bug now :-(

-- rick
should this be marked M12?
Target Milestone: M12
I have a fix for this bug and am waiting for a code review...  I'm marking it
M12...
This bug is also causing some weird problems in editor, because we are getting
the OnEndDocument load too learly. See bug 21820
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
I've just checked in the fix for this.

This will also fix the situations where the consumer was *not* receiving an
OnStopRequest() notification when an error occurred...

-- rick
Status: RESOLVED → REOPENED
Tried to load the given page on windows build 1999121508 - it didnt work
you had to go and click on the submit button for it to work.
varda, your using a build that had not recieved rpotts' fix.
the fix should show up in 12/15 afternoon builds but we needed
to back out the changes until more investigation is done
wrt/ the regressioons we saw in
the afternoon build documented in bug
http://bugzilla.mozilla.org/show_bug.cgi?id=21884
Status: REOPENED → RESOLVED
Closed: 25 years ago25 years ago
OK I've checked the fix in again along with a fix for the crash with images...
It was due to a redirect :-(

So, I'm closing this one again...
Status: RESOLVED → VERIFIED
Verified with 12-16-09.
Blocks: 22176
No longer blocks: 22176
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.