The native checkValidity() method and jQuery's is method for the selectors ':valid'/':invalid' are returning wrong results, if you set an invalid value to a disabled form field and then enabling it. I created a testcase here: http://jsfiddle.net/9bsZ9/ 1. Create a disabled and required form field 2. Set this field to an invalid value through script 3. Set disabled to false -> checkValidity should return false, but returns true. I'm not sure, why matchesSelector and jQuery.is are returning different values, but should also be looked into.
Confirmed.
Hattori-san, can you handle this?
Created attachment 143821 [details] Patch
Comment on attachment 143821 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=143821&action=review > Source/WebCore/ChangeLog:14 > + willValidate which is const, so I added the member it's ok to remove const from willValidate(). Then, we can assume m_willValidateInitialized as willValidate-and-validity-are-initialized.
Created attachment 143975 [details] Patch
Please wait for approval from abarth@webkit.org, dglazkov@chromium.org, fishd@chromium.org, jamesr@chromium.org or tkent@chromium.org before submitting, as this patch contains changes to the Chromium public API. See also https://trac.webkit.org/wiki/ChromiumWebKitAPI.
Comment on attachment 143975 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=143975&action=review > Source/WebCore/html/HTMLFormControlElement.h:98 > > - virtual bool willValidate() const; > + virtual bool willValidate(); > void updateVisibleValidationMessage(); should add OVERRIDE. > Source/WebCore/html/HTMLFormControlElement.h:162 > > - enum DataListAncestorState { Unknown, InsideDataList, NotInsideDataList }; > + enum DataListAncestorState { Unknown, InsideDataList, NotInsideDataList, DontCare }; > mutable enum DataListAncestorState m_dataListAncestorState; This change is unrelated to this bug. > Source/WebCore/html/HTMLKeygenElement.h:37 > + virtual bool willValidate() { return false; } OVERRIDE > Source/WebCore/html/HTMLOutputElement.h:44 > + virtual bool willValidate() { return false; } ditto.
Created attachment 143982 [details] Patch
Comment on attachment 143982 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=143982&action=review > Source/WebKit/chromium/public/WebInputElement.h:93 > WEBKIT_EXPORT int selectionEnd() const; > - WEBKIT_EXPORT bool isValidValue(const WebString&) const; > + WEBKIT_EXPORT bool isValidValue(const WebString&); > WEBKIT_EXPORT bool isChecked() const; It's possible that this change breaks Chromium build. Please watch the canary bots after landing this.
Created attachment 143998 [details] Patch
Comment on attachment 143998 [details] Patch Clearing flags on attachment: 143998 Committed r118501: <http://trac.webkit.org/changeset/118501>
All reviewed patches have been landed. Closing bug.