Closed
Bug 544698
Opened 15 years ago
Closed 15 years ago
Clean up form submission code
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
People
(Reporter: sicking, Assigned: sicking)
References
Details
Attachments
(4 files)
84.20 KB,
patch
|
jst
:
review+
|
Details | Diff | Splinter Review |
26.57 KB,
patch
|
jst
:
review+
|
Details | Diff | Splinter Review |
9.77 KB,
patch
|
jst
:
review+
|
Details | Diff | Splinter Review |
19.47 KB,
patch
|
jst
:
review+
|
Details | Diff | Splinter Review |
I'd imagine that there is a lot of cleanup that can happen here. However I'm worried about making behavioral changes at this point.
Attaching two patches. Some move some of the logic out of the form submission code (specifically the stuff in nsFormSubmission::ProcessValue), and moves it into the relevant elements instead. Also contains some decomtamination.
Second patch just moves code around to avoid having to forward declare functions, and removes a pile of useless/out-of-date comments.
Assignee | ||
Comment 1•15 years ago
|
||
By moving out value processing out to the elements the submission code no longer has to deal with "form processors", and also don't need to get a handle to the element in AddNameValuePair/AddNameFilePair.
Assignee: nobody → jonas
Attachment #425667 -
Flags: review?(jst)
Assignee | ||
Comment 2•15 years ago
|
||
No code changes, just move functions around to avoid having to forward declare. Add and remove comments to make code more readable.
Attachment #425668 -
Flags: review?(jst)
Comment 3•15 years ago
|
||
Is this for all operating systems?
Assignee | ||
Comment 4•15 years ago
|
||
Yes, this is all cross platform code.
OS: Mac OS X → All
Hardware: x86 → All
Assignee | ||
Comment 5•15 years ago
|
||
There is only one place in the code where there are two things pointing to the same nsFormSubmission, during nsHTMLFormElement::FlushPendingSubmission.
However as far as I can see there is no need to let mPendingSubmission point to the submission we're submitting, so just hold a local variable instead.
Attachment #427722 -
Flags: review?(jst)
Assignee | ||
Comment 6•15 years ago
|
||
So this (final) patch contains the following cleanups:
Move the creation of the encoder to the nsFormSubmission ctor. This way we don't have to create the encoder outside of the submission and then pass both the charset and the charset encoder through all subclass ctors. Instead we just pass the charset and then the encoder is constructed in the ctor.
Move the call to linkHandler->OnLinkClickSync from the submission code to the form element code.
Attachment #427724 -
Flags: review?(jst)
Comment 7•15 years ago
|
||
Comment on attachment 425667 [details] [diff] [review]
Part1: Move value "processing" from submission-code to elements. Kill dead code. Decomtaminate
Looks good! Caught one typo...
- In nsFormSubmission::Release():
+ mRefCnt = 1; // stabalize
s/stabalize/stabilize/.
r=jst
Attachment #425667 -
Flags: review?(jst) → review+
Updated•15 years ago
|
Attachment #425668 -
Flags: review?(jst) → review+
Updated•15 years ago
|
Attachment #427722 -
Flags: review?(jst) → review+
Updated•15 years ago
|
Attachment #427724 -
Flags: review?(jst) → review+
Assignee | ||
Comment 8•15 years ago
|
||
Checked in
http://hg.mozilla.org/mozilla-central/rev/38c07ace8a84
http://hg.mozilla.org/mozilla-central/rev/9b590d74d8a6
http://hg.mozilla.org/mozilla-central/rev/910467d64a1a
http://hg.mozilla.org/mozilla-central/rev/a3805f7d1cca
Thanks for the reviews!
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
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
•