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

Side by Side Diff: Source/core/html/forms/DateInputType.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
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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 const AtomicString& DateInputType::formControlType() const 66 const AtomicString& DateInputType::formControlType() const
67 { 67 {
68 return InputTypeNames::date; 68 return InputTypeNames::date;
69 } 69 }
70 70
71 StepRange DateInputType::createStepRange(AnyStepHandling anyStepHandling) const 71 StepRange DateInputType::createStepRange(AnyStepHandling anyStepHandling) const
72 { 72 {
73 DEFINE_STATIC_LOCAL(const StepRange::StepDescription, stepDescription, (date DefaultStep, dateDefaultStepBase, dateStepScaleFactor, StepRange::ParsedStepValu eShouldBeInteger)); 73 DEFINE_STATIC_LOCAL(const StepRange::StepDescription, stepDescription, (date DefaultStep, dateDefaultStepBase, dateStepScaleFactor, StepRange::ParsedStepValu eShouldBeInteger));
74 74
75 return InputType::createStepRange(anyStepHandling, 0, Decimal::fromDouble(Da teComponents::minimumDate()), Decimal::fromDouble(DateComponents::maximumDate()) , stepDescription); 75 return InputType::createStepRange(anyStepHandling, dateDefaultStepBase, Deci mal::fromDouble(DateComponents::minimumDate()), Decimal::fromDouble(DateComponen ts::maximumDate()), stepDescription);
76 } 76 }
77 77
78 bool DateInputType::parseToDateComponentsInternal(const String& string, DateComp onents* out) const 78 bool DateInputType::parseToDateComponentsInternal(const String& string, DateComp onents* out) const
79 { 79 {
80 ASSERT(out); 80 ASSERT(out);
81 unsigned end; 81 unsigned end;
82 return out->parseDate(string, 0, end) && end == string.length(); 82 return out->parseDate(string, 0, end) && end == string.length();
83 } 83 }
84 84
85 bool DateInputType::setMillisecondToDateComponents(double value, DateComponents* date) const 85 bool DateInputType::setMillisecondToDateComponents(double value, DateComponents* date) const
(...skipping 29 matching lines...) Expand all
115 layoutParameters.placeholderForYear = locale().queryString(WebLocalizedStrin g::PlaceholderForYearField); 115 layoutParameters.placeholderForYear = locale().queryString(WebLocalizedStrin g::PlaceholderForYearField);
116 } 116 }
117 117
118 bool DateInputType::isValidFormat(bool hasYear, bool hasMonth, bool hasWeek, boo l hasDay, bool hasAMPM, bool hasHour, bool hasMinute, bool hasSecond) const 118 bool DateInputType::isValidFormat(bool hasYear, bool hasMonth, bool hasWeek, boo l hasDay, bool hasAMPM, bool hasHour, bool hasMinute, bool hasSecond) const
119 { 119 {
120 return hasYear && hasMonth && hasDay; 120 return hasYear && hasMonth && hasDay;
121 } 121 }
122 #endif 122 #endif
123 123
124 } // namespace WebCore 124 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/forms/week/week-stepup-stepdown-expected.txt ('k') | Source/core/html/forms/DateTimeLocalInputType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698