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)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla2.0b3
People
(Reporter: mounir, Assigned: mounir)
References
Details
Attachments
(1 file, 2 obsolete files)
6.11 KB,
patch
|
Details | Diff | 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)
Assignee | ||
Updated•15 years ago
|
Comment 1•15 years ago
|
||
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 2•15 years ago
|
||
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)
Assignee | ||
Comment 3•15 years ago
|
||
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.
Assignee | ||
Comment 4•15 years ago
|
||
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 5•15 years ago
|
||
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?
Assignee | ||
Comment 6•15 years ago
|
||
bug 549475 is introducing value sanitizing algorithm and testing it.
Updated•15 years ago
|
Attachment #458637 -
Flags: review?(Olli.Pettay) → review+
Assignee | ||
Comment 7•15 years ago
|
||
Comment on attachment 458637 [details] [diff] [review]
Patch v1.1
This is bug 549475 follow-up. Only refactorization.
Attachment #458637 -
Flags: approval2.0?
Updated•15 years ago
|
Attachment #458637 -
Flags: approval2.0? → approval2.0+
Assignee | ||
Comment 8•15 years ago
|
||
Re-based patch.
r=smaug a=bsmedberg
Attachment #458637 -
Attachment is obsolete: true
Assignee | ||
Comment 9•15 years ago
|
||
Could you push the patch from bug 572896 while pushing this one (this one as to be applied after).
Depends on: 572896
Assignee | ||
Updated•15 years ago
|
Keywords: checkin-needed
Comment 10•15 years ago
|
||
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.
Description
•