Bug 60948 - tooLong validity should not be true for a value set by a script
Summary: tooLong validity should not be true for a value set by a script
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Major
Assignee: Kent Tamura
URL: http://lists.whatwg.org/pipermail/com...
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-17 01:14 PDT by Kent Tamura
Modified: 2011-05-19 02:50 PDT (History)
3 users (show)

See Also:


Attachments
Patch (14.66 KB, patch)
2011-05-17 01:31 PDT, Kent Tamura
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kent Tamura 2011-05-17 01:14:19 PDT
The specification was updated a few days ago. See the URL.
Comment 1 Kent Tamura 2011-05-17 01:31:23 PDT
Created attachment 93747 [details]
Patch
Comment 2 Hajime Morrita 2011-05-17 03:24:10 PDT
Comment on attachment 93747 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=93747&action=review

> Source/WebCore/html/HTMLInputElement.cpp:935
> +            m_wasModifiedByUser = sendChangeEvent;

Are there any possibility to overwrite? existing "true" value?
For example, Is it possible to make this false by script after some user action that made this true.

> Source/WebCore/html/HTMLTextAreaElement.h:113
> +    bool m_wasModifiedByUser;

should be mutable? or updateValue() should not be const?
const_cast<> inside updateValue() apparently indicates something wrong.
Comment 3 Kent Tamura 2011-05-17 03:39:51 PDT
Comment on attachment 93747 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=93747&action=review

>> Source/WebCore/html/HTMLInputElement.cpp:935
>> +            m_wasModifiedByUser = sendChangeEvent;
> 
> Are there any possibility to overwrite? existing "true" value?
> For example, Is it possible to make this false by script after some user action that made this true.

Yes, it's possible and it's an expected behavior. 

If the <input> has user-edited value (m_wasModifedByUser=true) and a script calls setValue("foobar"), m_wasModifedByUser should be cleared.

>> Source/WebCore/html/HTMLTextAreaElement.h:113
>> +    bool m_wasModifiedByUser;
> 
> should be mutable? or updateValue() should not be const?
> const_cast<> inside updateValue() apparently indicates something wrong.

We should remove 'const' from updateValue().
Comment 4 Hajime Morrita 2011-05-17 04:17:55 PDT
(In reply to comment #3)
> (From update of attachment 93747 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=93747&action=review
> 
> >> Source/WebCore/html/HTMLInputElement.cpp:935
> >> +            m_wasModifiedByUser = sendChangeEvent;
> > 
> > Are there any possibility to overwrite? existing "true" value?
> > For example, Is it possible to make this false by script after some user action that made this true.
> 
> Yes, it's possible and it's an expected behavior. 
I see. The expectation is different from what I thought. But it's reasonable.
Comment 5 Kent Tamura 2011-05-18 21:38:44 PDT
Comment on attachment 93747 [details]
Patch

Thank you for r+!
Comment 6 WebKit Commit Bot 2011-05-19 02:48:51 PDT
The commit-queue encountered the following flaky tests while processing attachment 93747 [details]:

java/lc3/JavaObject/JavaObjectToByte-006.html bug 60333 (author: ap@webkit.org)
The commit-queue is continuing to process your patch.
Comment 7 WebKit Commit Bot 2011-05-19 02:50:20 PDT
Comment on attachment 93747 [details]
Patch

Clearing flags on attachment: 93747

Committed r86832: <http://trac.webkit.org/changeset/86832>
Comment 8 WebKit Commit Bot 2011-05-19 02:50:26 PDT
All reviewed patches have been landed.  Closing bug.