Changeset 51163 in webkit
- Timestamp:
- Nov 18, 2009 6:15:17 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 18 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r51159 r51163 1 2009-11-18 Kent Tamura <tkent@chromium.org> 2 3 Reviewed by Darin Adler. 4 5 Tests for ValidityState.typeMismatch for the following types of INPUT element: 6 date, datetime, datetime-local, month, time and week 7 https://bugs.webkit.org/show_bug.cgi?id=31342 8 9 * fast/forms/ValidityState-typeMismatch-date-expected.txt: Added. 10 * fast/forms/ValidityState-typeMismatch-date.html: Added. 11 * fast/forms/ValidityState-typeMismatch-datetime-expected.txt: Added. 12 * fast/forms/ValidityState-typeMismatch-datetime.html: Added. 13 * fast/forms/ValidityState-typeMismatch-datetimelocal-expected.txt: Added. 14 * fast/forms/ValidityState-typeMismatch-datetimelocal.html: Added. 15 * fast/forms/ValidityState-typeMismatch-month-expected.txt: Added. 16 * fast/forms/ValidityState-typeMismatch-month.html: Added. 17 * fast/forms/ValidityState-typeMismatch-time-expected.txt: Added. 18 * fast/forms/ValidityState-typeMismatch-time.html: Added. 19 * fast/forms/ValidityState-typeMismatch-week-expected.txt: Added. 20 * fast/forms/ValidityState-typeMismatch-week.html: Added. 21 * fast/forms/script-tests/ValidityState-typeMismatch-date.js: Added. 22 * fast/forms/script-tests/ValidityState-typeMismatch-datetime.js: Added. 23 * fast/forms/script-tests/ValidityState-typeMismatch-datetimelocal.js: Added. 24 * fast/forms/script-tests/ValidityState-typeMismatch-month.js: Added. 25 * fast/forms/script-tests/ValidityState-typeMismatch-time.js: Added. 26 * fast/forms/script-tests/ValidityState-typeMismatch-week.js: Added. 27 1 28 2009-11-18 Kent Tamura <tkent@chromium.org> 2 29 -
trunk/WebCore/ChangeLog
r51162 r51163 1 2009-11-18 Kent Tamura <tkent@chromium.org> 2 3 Reviewed by Darin Adler. 4 5 Add support for ValidityState.typeMismatch for the following INPUT types: 6 date datetime datetime-local month time week 7 https://bugs.webkit.org/show_bug.cgi?id=31342 8 9 Tests: fast/forms/ValidityState-typeMismatch-date.html 10 fast/forms/ValidityState-typeMismatch-datetime.html 11 fast/forms/ValidityState-typeMismatch-datetimelocal.html 12 fast/forms/ValidityState-typeMismatch-month.html 13 fast/forms/ValidityState-typeMismatch-time.html 14 fast/forms/ValidityState-typeMismatch-week.html 15 16 * html/HTMLInputElement.cpp: 17 (WebCore::HTMLInputElement::formStringToISODateTime): Check the type 18 validity of the specified type and string using the ISODateTime class. 19 * html/HTMLInputElement.h: 20 * html/ValidityState.cpp: 21 (WebCore::ValidityState::typeMismatch): Check the type validity 22 for date, datetime, datetime-local, month, time and week with 23 HTMLInputElemtn::formStringToISODateTime() 24 1 25 2009-11-18 Maciej Stachowiak <mjs@apple.com> 2 26 -
trunk/WebCore/html/HTMLInputElement.cpp
r51159 r51163 46 46 #include "HTMLNames.h" 47 47 #include "HTMLOptionElement.h" 48 #include "ISODateTime.h" 48 49 #include "ScriptEventListener.h" 49 50 #include "KeyboardEvent.h" … … 2008 2009 } 2009 2010 2011 bool HTMLInputElement::formStringToISODateTime(InputType type, const String& formString, ISODateTime* out) 2012 { 2013 ISODateTime ignoredResult; 2014 if (!out) 2015 out = &ignoredResult; 2016 const UChar* characters = formString.characters(); 2017 unsigned length = formString.length(); 2018 unsigned end; 2019 2020 switch (type) { 2021 case DATE: 2022 return out->parseDate(characters, length, 0, end) && end == length; 2023 case DATETIME: 2024 return out->parseDateTime(characters, length, 0, end) && end == length; 2025 case DATETIMELOCAL: 2026 return out->parseDateTimeLocal(characters, length, 0, end) && end == length; 2027 case MONTH: 2028 return out->parseMonth(characters, length, 0, end) && end == length; 2029 case WEEK: 2030 return out->parseWeek(characters, length, 0, end) && end == length; 2031 case TIME: 2032 return out->parseTime(characters, length, 0, end) && end == length; 2033 default: 2034 ASSERT_NOT_REACHED(); 2035 return false; 2036 } 2037 } 2038 2010 2039 #if ENABLE(DATALIST) 2011 2040 HTMLElement* HTMLInputElement::list() const -
trunk/WebCore/html/HTMLInputElement.h
r51159 r51163 35 35 class HTMLImageLoader; 36 36 class HTMLOptionElement; 37 class ISODateTime; 37 38 class KURL; 38 39 class VisibleSelection; … … 248 249 // The double* parameter may be 0. 249 250 static bool formStringToDouble(const String&, double*); 251 // Parses the specified string as the InputType, and returns true if it is successfully parsed. 252 // An instance pointed by the ISODateTime* parameter will have parsed values and be 253 // modified even if the parsing fails. The ISODateTime* parameter may be 0. 254 static bool formStringToISODateTime(InputType, const String&, ISODateTime*); 250 255 251 256 protected: -
trunk/WebCore/html/ValidityState.cpp
r51159 r51163 75 75 return false; 76 76 } 77 case HTMLInputElement::DATE: 78 case HTMLInputElement::DATETIME: 79 case HTMLInputElement::DATETIMELOCAL: 80 case HTMLInputElement::MONTH: 81 case HTMLInputElement::TIME: 82 case HTMLInputElement::WEEK: 83 return !HTMLInputElement::formStringToISODateTime(input->inputType(), value, 0); 77 84 default: 78 85 return false;
Note: See TracChangeset
for help on using the changeset viewer.