RESOLVED FIXED 29071
[HTML5][Forms] Support for :in-range and :out-of-range CSS selectors
https://bugs.webkit.org/show_bug.cgi?id=29071
Summary [HTML5][Forms] Support for :in-range and :out-of-range CSS selectors
Kent Tamura
Reported 2009-09-08 23:14:44 PDT
Implement :in-range and :out-of-range selectors. They should reflect ValidityState.rangeOverflow and .rangeUnderflow lively.
Attachments
Patch. (18.38 KB, patch)
2010-12-28 17:23 PST, Yael
tkent: review-
Patch. (21.06 KB, patch)
2010-12-29 06:11 PST, Yael
tkent: review+
Peter Kasting
Comment 1 2010-04-29 16:48:13 PDT
*** Bug 27450 has been marked as a duplicate of this bug. ***
Yael
Comment 2 2010-12-28 17:23:25 PST
Created attachment 77592 [details] Patch. Add support for :in-range and :out-of-range. They simply check InputType::rangeOverflow() and InputType::rangeUnderflow() to make a decision. Note that WebKit clamps the value of input[type=range], so it will never be :out-of-range. It will also never be :invalid.
Kent Tamura
Comment 3 2010-12-29 04:29:54 PST
Comment on attachment 77592 [details] Patch. View in context: https://bugs.webkit.org/attachment.cgi?id=77592&action=review Thank you for working on this! > WebCore/css/CSSStyleSelector.cpp:2678 > + case CSSSelector::PseudoInRange: > + return e && e->isInRange(); > + case CSSSelector::PseudoOutOfRange: > + return e && e->isOutOfRange(); Please add document()->setContainsValidaityStyleRules() like PseudoValid and PseudoInvalid, and update CSSStyleSelector::canShareStyleWithElement(). > WebCore/html/InputType.h:93 > virtual bool supportsRequired() const; > + virtual bool supportsRangeLimitation() const; > virtual bool valueMissing(const String&) const; nit: supportsRangeLimitation() should be put just before rangeUnderflow(). > WebCore/html/NumberInputType.h:65 > + virtual bool supportsRangeLimitation() const { return true; } nit: We have no reason to have the body of a virtual function in a header file. > WebCore/html/RangeInputType.h:62 > + virtual bool supportsRangeLimitation() const { return true; } ditto. > LayoutTests/ChangeLog:16 > + * fast/forms/controls-in-range-expected.txt: Added. > + * fast/forms/controls-in-range.html: Added. > + * fast/forms/controls-invalid-value-in-range-expected.txt: Added. > + * fast/forms/controls-invalid-value-in-range.html: Added. > + * fast/forms/controls-out-of-range-expected.txt: Added. > + * fast/forms/controls-out-of-range.html: Added. > + * fast/forms/script-tests/controls-in-range.js: Added. > + * fast/forms/script-tests/controls-invalid-value-in-range.js: Added. > + * fast/forms/script-tests/controls-out-of-range.js: Added. These tests should be named as fast/css/pseudo-*.html
Yael
Comment 4 2010-12-29 06:11:24 PST
Created attachment 77614 [details] Patch. Thank you for the review. I updated the patch based on your comments.
Kent Tamura
Comment 5 2010-12-29 06:22:24 PST
Comment on attachment 77614 [details] Patch. Looks good!
Yael
Comment 6 2010-12-29 06:27:33 PST
Thank you for the review!
Yael
Comment 7 2010-12-29 08:02:37 PST
WebKit Review Bot
Comment 8 2010-12-29 10:26:11 PST
http://trac.webkit.org/changeset/74744 might have broken GTK Linux 64-bit Debug
Yael
Comment 9 2010-12-29 10:30:22 PST
(In reply to comment #8) > http://trac.webkit.org/changeset/74744 might have broken GTK Linux 64-bit Debug Not likely. The test editing/selection/extend-by-character-005.html has been failing intermittently for a while now.
Note You need to log in before you can comment on or make changes to this bug.