Closed Bug 572897 Opened 15 years ago Closed 15 years ago

Do not always call SetValueChanged(PR_TRUE) when SetValueInternal is called

Categories

(Core :: DOM: Core & HTML, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla2.0b3

People

(Reporter: mounir, Assigned: mounir)

References

Details

Attachments

(1 file, 2 obsolete files)

Attached patch Patch v1 (obsolete) — Splinter Review
It's a follow-up from bug 549475: we have at least two calls to SetValueInternal vhich don't need SetValueChanged(PR_TRUE) to be called so it would be clearer to have a parameter to specify that instead of doing some hack around the call or just hoping everything is going to be allright.
Attachment #452125 - Flags: review?(Olli.Pettay)
No longer blocks: 549475
Depends on: 549475
Comment on attachment 452125 [details] [diff] [review] Patch v1 I'm having some trouble to review this since Bug 549475 hasn't landed yet, and I'm not sure how value-changed handling was changed there. Are there tests for this all?
Comment on attachment 452125 [details] [diff] [review] Patch v1 Clearing the request until I get some answer to the question.
Attachment #452125 - Flags: review?(Olli.Pettay)
Comment on attachment 452125 [details] [diff] [review] Patch v1 Actually, there is no change in value-changed in bug 549475 excepted it tries to sanitize the value when it's changed. This patch is here to prevent calling SetValue(something) then calling SetValueChanged(PR_FALSE). It happens two times in the code: - when we change the type of the element and we need to sanitize the value with the new type sanitizing algorithm ; - when we call Reset(), SetValue() is called then SetValueChanged(PR_FALSE). Actually, I realize this change is in bug 572896. I will fix that and re-ask for a review after.
Attached patch Patch v1.1 (obsolete) — Splinter Review
Actually, the patch was correct: there are two calls with PR_FALSE.
Attachment #452125 - Attachment is obsolete: true
Attachment #458637 - Flags: review?(Olli.Pettay)
Comment on attachment 458637 [details] [diff] [review] Patch v1.1 > > if (IsSingleLineTextControlInternal(PR_FALSE, mType)) { > nsAutoString value; >- PRBool valueChanged = ValueChanged(); > GetValue(value); > // SetValueInternal is going to sanitize the value. >- SetValueInternal(value, PR_FALSE); >- SetValueChanged(valueChanged); >+ SetValueInternal(value, PR_FALSE, PR_FALSE); > } > } > So is this is "- when we change the type of the element and we need to sanitize the value with the new type sanitizing algorithm " Do we have a testcase for this?
bug 549475 is introducing value sanitizing algorithm and testing it.
Attachment #458637 - Flags: review?(Olli.Pettay) → review+
Comment on attachment 458637 [details] [diff] [review] Patch v1.1 This is bug 549475 follow-up. Only refactorization.
Attachment #458637 - Flags: approval2.0?
Attachment #458637 - Flags: approval2.0? → approval2.0+
Attached patch Patch v1.2Splinter Review
Re-based patch. r=smaug a=bsmedberg
Attachment #458637 - Attachment is obsolete: true
Could you push the patch from bug 572896 while pushing this one (this one as to be applied after).
Depends on: 572896
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: