Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(721)

Side by Side Diff: Source/core/html/forms/DateTimeLocalInputType.cpp

Issue 136783006: Upgrade stepUp()/stepDown() implementation to match spec. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: applyStep(): add missing EventQueueScope Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/html/forms/DateInputType.cpp ('k') | Source/core/html/forms/InputType.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 void DateTimeLocalInputType::setValueAsDate(double value, ExceptionState& except ionState) const 74 void DateTimeLocalInputType::setValueAsDate(double value, ExceptionState& except ionState) const
75 { 75 {
76 // valueAsDate doesn't work for the datetime-local type according to the sta ndard. 76 // valueAsDate doesn't work for the datetime-local type according to the sta ndard.
77 InputType::setValueAsDate(value, exceptionState); 77 InputType::setValueAsDate(value, exceptionState);
78 } 78 }
79 79
80 StepRange DateTimeLocalInputType::createStepRange(AnyStepHandling anyStepHandlin g) const 80 StepRange DateTimeLocalInputType::createStepRange(AnyStepHandling anyStepHandlin g) const
81 { 81 {
82 DEFINE_STATIC_LOCAL(const StepRange::StepDescription, stepDescription, (date TimeLocalDefaultStep, dateTimeLocalDefaultStepBase, dateTimeLocalStepScaleFactor , StepRange::ScaledStepValueShouldBeInteger)); 82 DEFINE_STATIC_LOCAL(const StepRange::StepDescription, stepDescription, (date TimeLocalDefaultStep, dateTimeLocalDefaultStepBase, dateTimeLocalStepScaleFactor , StepRange::ScaledStepValueShouldBeInteger));
83 83
84 return InputType::createStepRange(anyStepHandling, 0, Decimal::fromDouble(Da teComponents::minimumDateTime()), Decimal::fromDouble(DateComponents::maximumDat eTime()), stepDescription); 84 return InputType::createStepRange(anyStepHandling, dateTimeLocalDefaultStepB ase, Decimal::fromDouble(DateComponents::minimumDateTime()), Decimal::fromDouble (DateComponents::maximumDateTime()), stepDescription);
85 } 85 }
86 86
87 bool DateTimeLocalInputType::parseToDateComponentsInternal(const String& string, DateComponents* out) const 87 bool DateTimeLocalInputType::parseToDateComponentsInternal(const String& string, DateComponents* out) const
88 { 88 {
89 ASSERT(out); 89 ASSERT(out);
90 unsigned end; 90 unsigned end;
91 return out->parseDateTimeLocal(string, 0, end) && end == string.length(); 91 return out->parseDateTimeLocal(string, 0, end) && end == string.length();
92 } 92 }
93 93
94 bool DateTimeLocalInputType::setMillisecondToDateComponents(double value, DateCo mponents* date) const 94 bool DateTimeLocalInputType::setMillisecondToDateComponents(double value, DateCo mponents* date) const
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 layoutParameters.placeholderForYear = locale().queryString(WebLocalizedStrin g::PlaceholderForYearField); 158 layoutParameters.placeholderForYear = locale().queryString(WebLocalizedStrin g::PlaceholderForYearField);
159 } 159 }
160 160
161 bool DateTimeLocalInputType::isValidFormat(bool hasYear, bool hasMonth, bool has Week, bool hasDay, bool hasAMPM, bool hasHour, bool hasMinute, bool hasSecond) c onst 161 bool DateTimeLocalInputType::isValidFormat(bool hasYear, bool hasMonth, bool has Week, bool hasDay, bool hasAMPM, bool hasHour, bool hasMinute, bool hasSecond) c onst
162 { 162 {
163 return hasYear && hasMonth && hasDay && hasAMPM && hasHour && hasMinute; 163 return hasYear && hasMonth && hasDay && hasAMPM && hasHour && hasMinute;
164 } 164 }
165 #endif 165 #endif
166 166
167 } // namespace WebCore 167 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/forms/DateInputType.cpp ('k') | Source/core/html/forms/InputType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698