Changeset 74744 in webkit
- Timestamp:
- Dec 29, 2010 8:00:48 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 9 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r74743 r74744 1 2010-12-29 Yael Aharon <yael.aharon@nokia.com> 2 3 Reviewed by Kent Tamura. 4 5 [HTML5][Forms] Support for :in-range and :out-of-range CSS selectors 6 https://bugs.webkit.org/show_bug.cgi?id=29071 7 8 * fast/css/pseudo-in-range-expected.txt: Added. 9 * fast/css/pseudo-in-range-invalid-value-expected.txt: Added. 10 * fast/css/pseudo-in-range-invalid-value.html: Added. 11 * fast/css/pseudo-in-range.html: Added. 12 * fast/css/pseudo-out-of-range-expected.txt: Added. 13 * fast/css/pseudo-out-of-range.html: Added. 14 * fast/css/script-tests/pseudo-in-range-invalid-value.js: Added. 15 * fast/css/script-tests/pseudo-in-range.js: Added. 16 * fast/css/script-tests/pseudo-out-of-range.js: Added. 17 1 18 2010-12-29 Abhishek Arya <inferno@chromium.org> 2 19 -
trunk/WebCore/ChangeLog
r74743 r74744 1 2010-12-29 Yael Aharon <yael.aharon@nokia.com> 2 3 Reviewed by Kent Tamura. 4 5 [HTML5][Forms] Support for :in-range and :out-of-range CSS selectors 6 https://bugs.webkit.org/show_bug.cgi?id=29071 7 8 Use InputType::rangeUnderflow() and InputType::rangeOverflow() 9 to determine if a control is in-range or out-of-range. 10 11 Tests: fast/css/pseudo-in-range-invalid-value.html 12 fast/css/pseudo-in-range.html 13 fast/css/pseudo-out-of-range.html 14 15 * css/CSSSelector.cpp: 16 (WebCore::CSSSelector::pseudoId): 17 (WebCore::nameToPseudoTypeMap): 18 (WebCore::CSSSelector::extractPseudoType): 19 * css/CSSSelector.h: 20 * css/CSSStyleSelector.cpp: 21 (WebCore::CSSStyleSelector::canShareStyleWithElement): 22 (WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector): 23 * dom/Element.h: 24 (WebCore::Element::isInRange): 25 (WebCore::Element::isOutOfRange): 26 * html/BaseDateAndTimeInputType.cpp: 27 (WebCore::BaseDateAndTimeInputType::supportsRangeLimitation): 28 * html/BaseDateAndTimeInputType.h: 29 * html/HTMLInputElement.cpp: 30 (WebCore::HTMLInputElement::isInRange): 31 (WebCore::HTMLInputElement::isOutOfRange): 32 * html/HTMLInputElement.h: 33 * html/InputType.cpp: 34 (WebCore::InputType::supportsRangeLimitation): 35 * html/InputType.h: 36 * html/NumberInputType.cpp: 37 (WebCore::NumberInputType::supportsRangeLimitation): 38 * html/NumberInputType.h: 39 * html/RangeInputType.cpp: 40 (WebCore::RangeInputType::supportsRangeLimitation): 41 * html/RangeInputType.h: 42 1 43 2010-12-29 Abhishek Arya <inferno@chromium.org> 2 44 -
trunk/WebCore/css/CSSSelector.cpp
r66251 r74744 312 312 case PseudoLeftPage: 313 313 case PseudoRightPage: 314 case PseudoInRange: 315 case PseudoOutOfRange: 314 316 return NOPSEUDO; 315 317 case PseudoNotParsed: … … 438 440 DEFINE_STATIC_LOCAL(AtomicString, fullScreenDocument, ("-webkit-full-screen-document")); 439 441 #endif 442 DEFINE_STATIC_LOCAL(AtomicString, inRange, ("in-range")); 443 DEFINE_STATIC_LOCAL(AtomicString, outOfRange, ("out-of-range")); 440 444 441 445 static HashMap<AtomicStringImpl*, CSSSelector::PseudoType>* nameToPseudoType = 0; … … 553 557 nameToPseudoType->set(fullScreenDocument.impl(), CSSSelector::PseudoFullScreenDocument); 554 558 #endif 559 nameToPseudoType->set(inRange.impl(), CSSSelector::PseudoInRange); 560 nameToPseudoType->set(outOfRange.impl(), CSSSelector::PseudoOutOfRange); 555 561 } 556 562 return nameToPseudoType; … … 686 692 case PseudoFullScreenDocument: 687 693 #endif 694 case PseudoInRange: 695 case PseudoOutOfRange: 688 696 break; 689 697 case PseudoFirstPage: -
trunk/WebCore/css/CSSSelector.h
r66251 r74744 222 222 PseudoFullScreenDocument, 223 223 #endif 224 PseudoInRange, 225 PseudoOutOfRange, 224 226 }; 225 227 -
trunk/WebCore/css/CSSStyleSelector.cpp
r74649 r74744 1016 1016 if (willValidate && (s->isValidFormControlElement() != m_element->isValidFormControlElement())) 1017 1017 return false; 1018 1019 if (s->isInRange() != m_element->isInRange()) 1020 return false; 1021 1022 if (s->isOutOfRange() != m_element->isOutOfRange()) 1023 return false; 1018 1024 } 1019 1025 … … 2673 2679 return true; 2674 2680 #endif 2681 case CSSSelector::PseudoInRange: 2682 if (!e) 2683 return false; 2684 e->document()->setContainsValidityStyleRules(); 2685 return e->isInRange(); 2686 case CSSSelector::PseudoOutOfRange: 2687 if (!e) 2688 return false; 2689 e->document()->setContainsValidityStyleRules(); 2690 return e->isOutOfRange(); 2675 2691 case CSSSelector::PseudoUnknown: 2676 2692 case CSSSelector::PseudoNotParsed: -
trunk/WebCore/dom/Element.h
r74715 r74744 305 305 virtual bool isValidFormControlElement() { return false; } 306 306 virtual bool hasUnacceptableValue() const { return false; } 307 virtual bool isInRange() const { return false; } 308 virtual bool isOutOfRange() const { return false; } 307 309 308 310 virtual bool formControlValueMatchesRenderer() const { return false; } -
trunk/WebCore/html/BaseDateAndTimeInputType.cpp
r74549 r74744 95 95 } 96 96 97 bool BaseDateAndTimeInputType::supportsRangeLimitation() const 98 { 99 return true; 100 } 101 97 102 double BaseDateAndTimeInputType::defaultValueForStepUp() const 98 103 { -
trunk/WebCore/html/BaseDateAndTimeInputType.h
r74549 r74744 56 56 virtual bool rangeUnderflow(const String&) const; 57 57 virtual bool rangeOverflow(const String&) const; 58 virtual bool supportsRangeLimitation() const; 58 59 virtual double defaultValueForStepUp() const; 59 60 virtual bool stepMismatch(const String&, double) const; -
trunk/WebCore/html/HTMLInputElement.cpp
r74549 r74744 1488 1488 } 1489 1489 1490 bool HTMLInputElement::isInRange() const 1491 { 1492 return m_inputType->supportsRangeLimitation() && !rangeUnderflow(value()) && !rangeOverflow(value()); 1493 } 1494 1495 bool HTMLInputElement::isOutOfRange() const 1496 { 1497 return m_inputType->supportsRangeLimitation() && (rangeUnderflow(value()) || rangeOverflow(value())); 1498 } 1499 1490 1500 bool HTMLInputElement::needsActivationCallback() 1491 1501 { -
trunk/WebCore/html/HTMLInputElement.h
r74549 r74744 313 313 virtual bool hasUnacceptableValue() const; 314 314 315 virtual bool isInRange() const; 316 virtual bool isOutOfRange() const; 317 315 318 virtual void documentDidBecomeActive(); 316 319 -
trunk/WebCore/html/InputType.cpp
r74549 r74744 221 221 } 222 222 223 bool InputType::supportsRangeLimitation() const 224 { 225 return false; 226 } 227 223 228 double InputType::defaultValueForStepUp() const 224 229 { -
trunk/WebCore/html/InputType.h
r74549 r74744 94 94 virtual bool rangeUnderflow(const String&) const; 95 95 virtual bool rangeOverflow(const String&) const; 96 virtual bool supportsRangeLimitation() const; 96 97 virtual double defaultValueForStepUp() const; 97 98 virtual double minimum() const; -
trunk/WebCore/html/NumberInputType.cpp
r74549 r74744 111 111 } 112 112 113 bool NumberInputType::supportsRangeLimitation() const 114 { 115 return true; 116 } 117 113 118 double NumberInputType::minimum() const 114 119 { … … 230 235 } 231 236 232 233 237 } // namespace WebCore -
trunk/WebCore/html/NumberInputType.h
r74549 r74744 49 49 virtual bool rangeUnderflow(const String&) const; 50 50 virtual bool rangeOverflow(const String&) const; 51 virtual bool supportsRangeLimitation() const; 51 52 virtual double minimum() const; 52 53 virtual double maximum() const; -
trunk/WebCore/html/RangeInputType.cpp
r74549 r74744 93 93 ASSERT_UNUSED(value, parseToDouble(value, numeric_limits<double>::quiet_NaN()) <= maximum()); 94 94 return false; 95 } 96 97 bool RangeInputType::supportsRangeLimitation() const 98 { 99 return true; 95 100 } 96 101 -
trunk/WebCore/html/RangeInputType.h
r74549 r74744 49 49 virtual bool rangeUnderflow(const String&) const; 50 50 virtual bool rangeOverflow(const String&) const; 51 virtual bool supportsRangeLimitation() const; 51 52 virtual double minimum() const; 52 53 virtual double maximum() const;
Note: See TracChangeset
for help on using the changeset viewer.