WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
27452
Support for the checkValidity() method and the invalid event
https://bugs.webkit.org/show_bug.cgi?id=27452
Summary
Support for the checkValidity() method and the invalid event
Michelangelo De Simone
Reported
2009-07-20 11:59:10 PDT
As per summary the implementation of checkValidity method along with its related simple event "invalid" is required as soon as static validation routine are landed.
Attachments
Untested, undocumented and unworthy patch
(12.49 KB, patch)
2009-08-18 18:43 PDT
,
Michelangelo De Simone
no flags
Details
Formatted Diff
Diff
Patch v1
(33.22 KB, patch)
2009-08-19 15:42 PDT
,
Michelangelo De Simone
no flags
Details
Formatted Diff
Diff
Patch v1 with updated layout tests
(35.95 KB, patch)
2009-08-19 16:17 PDT
,
Michelangelo De Simone
no flags
Details
Formatted Diff
Diff
Patch v1 with working test case
(1010 bytes, patch)
2009-08-21 14:57 PDT
,
Michelangelo De Simone
no flags
Details
Formatted Diff
Diff
Patch v1a
(35.84 KB, patch)
2009-08-21 15:00 PDT
,
Michelangelo De Simone
no flags
Details
Formatted Diff
Diff
Patch v1b
(35.32 KB, patch)
2009-08-21 16:16 PDT
,
Michelangelo De Simone
adele
: review+
Details
Formatted Diff
Diff
Show Obsolete
(5)
View All
Add attachment
proposed patch, testcase, etc.
Michelangelo De Simone
Comment 1
2009-08-18 18:43:15 PDT
Created
attachment 35093
[details]
Untested, undocumented and unworthy patch
Michelangelo De Simone
Comment 2
2009-08-18 18:49:12 PDT
Peter and I discussed the Form::checkValidity() method on #WebKit, it has an optional parameter (unhandledInvalidControls) which can be used for interactive validation tkent is going to work (or is already working) on; see 4.10.15.2. I'd like some feedback and, yes, the comment inside HTMLFormElement.idl is a mistake.:)
Peter Kasting
Comment 3
2009-08-18 18:55:29 PDT
Comment on
attachment 35093
[details]
Untested, undocumented and unworthy patch
> diff --git a/WebCore/dom/Document.idl b/WebCore/dom/Document.idl > index 44966cc..116be9f 100644 > --- a/WebCore/dom/Document.idl > +++ b/WebCore/dom/Document.idl > @@ -277,6 +277,7 @@ module core { > attribute [DontEnum] EventListener onscroll; > attribute [DontEnum] EventListener onselect; > attribute [DontEnum] EventListener onsubmit; > + attribute [DontEnum] EventListener oninvalid;
Alphabetical order?
> diff --git a/WebCore/dom/Element.idl b/WebCore/dom/Element.idl > index 16aac84..44a73ae 100644 > --- a/WebCore/dom/Element.idl > +++ b/WebCore/dom/Element.idl > @@ -162,6 +162,7 @@ module core { > attribute [DontEnum] EventListener onscroll; > attribute [DontEnum] EventListener onselect; > attribute [DontEnum] EventListener onsubmit; > + attribute [DontEnum] EventListener oninvalid;
Here too
> diff --git a/WebCore/dom/Node.h b/WebCore/dom/Node.h > index a557f94..2276c0f 100644 > --- a/WebCore/dom/Node.h > +++ b/WebCore/dom/Node.h > @@ -613,6 +613,8 @@ public: > void setOnselect(PassRefPtr<EventListener>); > EventListener* onsubmit() const; > void setOnsubmit(PassRefPtr<EventListener>); > + EventListener* oninvalid() const; > + void setOninvalid(PassRefPtr<EventListener>);
Here too (maybe should put the existing cases in order...?)
> diff --git a/WebCore/page/DOMWindow.idl b/WebCore/page/DOMWindow.idl > index 7c61523..e9c6ac5 100644 > --- a/WebCore/page/DOMWindow.idl > +++ b/WebCore/page/DOMWindow.idl > @@ -250,6 +250,7 @@ module window { > attribute EventListener onunload; > attribute EventListener onvolumechange; > attribute EventListener onwaiting; > + attribute EventListener oninvalid;
Here too
Kent Tamura
Comment 4
2009-08-19 03:12:47 PDT
(In reply to
comment #2
)
> Peter and I discussed the Form::checkValidity() method on #WebKit, it has an > optional parameter (unhandledInvalidControls) which can be used for interactive > validation tkent is going to work (or is already working) on; see 4.10.15.2.
It seems good. Thanks!
Michelangelo De Simone
Comment 5
2009-08-19 13:10:51 PDT
CC'ed Darin to have his comments too.
Michelangelo De Simone
Comment 6
2009-08-19 15:42:21 PDT
Created
attachment 35152
[details]
Patch v1
Michelangelo De Simone
Comment 7
2009-08-19 16:09:08 PDT
Comment on
attachment 35152
[details]
Patch v1 Regression on (the usual) domListEnumeration: updating...
Michelangelo De Simone
Comment 8
2009-08-19 16:17:24 PDT
Created
attachment 35157
[details]
Patch v1 with updated layout tests
Michelangelo De Simone
Comment 9
2009-08-21 13:52:53 PDT
There's a mistake in one of the attached tests.
Michelangelo De Simone
Comment 10
2009-08-21 14:57:10 PDT
Created
attachment 38398
[details]
Patch v1 with working test case
Michelangelo De Simone
Comment 11
2009-08-21 15:00:09 PDT
Created
attachment 38400
[details]
Patch v1a Bugzilla-tool didn't do the trick...:)
Michelangelo De Simone
Comment 12
2009-08-21 15:35:13 PDT
Adele gave her feedbacks on irc, the patch is being modified with the elimination of the stuff related to unhandledInvalidControls; instead of it a "TODO" comment is added to remind about it.
Michelangelo De Simone
Comment 13
2009-08-21 16:16:35 PDT
Created
attachment 38408
[details]
Patch v1b This patch complies with Adele's review comments.
Adele Peterson
Comment 14
2009-08-21 16:22:18 PDT
Comment on
attachment 38408
[details]
Patch v1b You can return false early if !control->checkValidity(). Everything else looks good. r=me
> +bool HTMLFormElement::checkValidity() > +{ > + // TODO: Check for unhandled invalid controls, see #27452 for tips. > + > + bool hasOnlyValidControls = true; > + for (unsigned i = 0; i < formElements.size(); ++i) { > + HTMLFormControlElement* control = formElements[i]; > + if (!control->checkValidity()) > + hasOnlyValidControls = false; > + } > + > + return hasOnlyValidControls; > +} > +
Michelangelo De Simone
Comment 15
2009-08-21 16:23:54 PDT
(In reply to
comment #14
)
> (From update of
attachment 38408
[details]
) > You can return false early if !control->checkValidity(). Everything else looks > good. r=me
I can't. Form::checkValidity() is supposed to fire an invalid event on every single invalid controls it has.
Adele Peterson
Comment 16
2009-08-21 16:26:00 PDT
nevermind my comment - I forgot about where the events were dispatched
Peter Kasting
Comment 17
2009-08-21 16:56:05 PDT
Fixed in
r47649
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug