Closed
Bug 567938
Opened 14 years ago
Closed 14 years ago
form.submit() broken if called from <input type='submit'>'s onclick handler
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
blocking2.0 | --- | alpha5+ |
People
(Reporter: nirvn.asia, Assigned: mounir)
References
Details
(Keywords: regression)
Attachments
(2 files, 2 obsolete files)
325 bytes,
text/html
|
Details | |
10.92 KB,
patch
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.3a5pre) Gecko/20100524 Minefield/3.7a5pre
Build Identifier:
The latest minefield fails to submit a form when triggered by the javascript submit() function.
Reproducible: Always
Steps to Reproduce:
1. Open the attached test case
2. Click on the "Submit Query" button
Actual Results:
Nothing happens.
Expected Results:
The form should be submitted and page reloaded.
Regression range is within the last 5 days.
I'm surprised this isn't tested in current test suit. :)
Reporter | ||
Comment 1•14 years ago
|
||
Comment 2•14 years ago
|
||
Regression range:
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=145123f19ced&tochange=8d6db7f8fe09
Possibly from bug 563668? Mounir, can you take a look?
Assignee: general → nobody
Status: UNCONFIRMED → NEW
blocking2.0: --- → alpha5+
Component: JavaScript Engine → HTML: Form Submission
Ever confirmed: true
Keywords: regressionwindow-wanted
QA Contact: general → form-submission
Updated•14 years ago
|
Blocks: 563668
Keywords: regressionwindow-wanted → regression
Assignee | ||
Comment 3•14 years ago
|
||
Ok, I'm looking at that.
Assignee: nobody → mounir.lamouri
Status: NEW → ASSIGNED
Assignee | ||
Comment 4•14 years ago
|
||
This is working with <button type='submit'> with <input> and if i call the function from onmousedown or onmouseup. In other words, that's not a failure with |form.submit()| but with |form.submit()| called from the onclick handler of a <input type='submit'>.
I'm still investigating.
And thank you for your report Mathieu :)
Summary: form.submit() broken in latest Minefield → form.submit() broken if called from <input type='submit'>'s onclick handler
Assignee | ||
Comment 5•14 years ago
|
||
Found it, that's a dup of bug 567927
Assignee | ||
Comment 6•14 years ago
|
||
This should fix a regression (with a test).
Attachment #447323 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 7•14 years ago
|
||
s/a/the/
Assignee | ||
Updated•14 years ago
|
OS: Windows 7 → All
Hardware: x86 → All
Version: unspecified → Trunk
Comment 8•14 years ago
|
||
Comment on attachment 447323 [details] [diff] [review]
Patch v1
r=me, with a few caveats:
1) Can you also add tests for the other cases fixed by the oldType change? Separate bug ok.
2) That test will randomly fail if the about:blank load completes before the <script> has had a chance to execute. What you want to do is to run your test off the main page onload event (using addLoadEvent), and only set up the iframe's load handler there.
Attachment #447323 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 9•14 years ago
|
||
Thank you very much for your help on the tests Boris.
Attachment #447323 -
Attachment is obsolete: true
Attachment #447335 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 11•14 years ago
|
||
Boris, do you think you can review this patch soon ? Otherwise, could you move the review to someone else ? (jst, smaug or sicking maybe)
I suppose this regression must be quite annoying for Minefield users...
Comment 12•14 years ago
|
||
Comment on attachment 447335 [details] [diff] [review]
Patch v2
>+++ b/content/html/content/test/test_bug567938-1.html
>+ // Cleaning-up.
>+ for (var tmpChild = form.firstChild; tmpChild; tmpChild = form.firstChild) {
>+ form.removeChild(tmpChild);
>+ }
form.textContent = "";
And for the other tests too.
>+ is(frames['submit_frame'].location.href,
>+ "http://mochi.test:8888/tests/content/html/content/test/foo",
>+ "The form should have been submitted");
If this is true for submit it will also be true for image, no? So the real test for image is that onload fires? This seems to apply to the other tests too.
>+++ b/content/html/content/test/test_bug567938-2.html
>+ element.onclick = function() { form.submit(); element.type='input'; };
s/input/text/ ?
r=bzbarsky
Attachment #447335 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Updated•14 years ago
|
Keywords: checkin-needed
Reporter | ||
Comment 14•14 years ago
|
||
Any chance we can get this applied to trunk? I'm getting uncomfortable switching to Chromium every time I need to submit info in our database ;)
Comment 15•14 years ago
|
||
Pushed to trunk:
http://hg.mozilla.org/mozilla-central/rev/9e3e79324eb9
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Updated•14 years ago
|
Keywords: checkin-needed
Assignee | ||
Updated•14 years ago
|
Flags: in-testsuite+
Reporter | ||
Comment 16•14 years ago
|
||
Thanks
Updated•6 years ago
|
Component: HTML: Form Submission → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•