| OLD | NEW |
| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 return locale().queryString(WebLocalizedString::ValidationRangeOverflowDateT
ime, localizeValue(serialize(maximum))); | 83 return locale().queryString(WebLocalizedString::ValidationRangeOverflowDateT
ime, localizeValue(serialize(maximum))); |
| 84 } | 84 } |
| 85 | 85 |
| 86 String BaseDateAndTimeInputType::rangeUnderflowText(const Decimal& minimum) cons
t | 86 String BaseDateAndTimeInputType::rangeUnderflowText(const Decimal& minimum) cons
t |
| 87 { | 87 { |
| 88 return locale().queryString(WebLocalizedString::ValidationRangeUnderflowDate
Time, localizeValue(serialize(minimum))); | 88 return locale().queryString(WebLocalizedString::ValidationRangeUnderflowDate
Time, localizeValue(serialize(minimum))); |
| 89 } | 89 } |
| 90 | 90 |
| 91 Decimal BaseDateAndTimeInputType::defaultValueForStepUp() const | 91 Decimal BaseDateAndTimeInputType::defaultValueForStepUp() const |
| 92 { | 92 { |
| 93 double ms = currentTimeMS(); | 93 return Decimal::fromDouble(convertToLocalTime(currentTimeMS())); |
| 94 double utcOffset = calculateUTCOffset(); | |
| 95 double dstOffset = calculateDSTOffset(ms, utcOffset); | |
| 96 int offset = static_cast<int>((utcOffset + dstOffset) / msPerMinute); | |
| 97 return Decimal::fromDouble(ms + (offset * msPerMinute)); | |
| 98 } | 94 } |
| 99 | 95 |
| 100 bool BaseDateAndTimeInputType::isSteppable() const | 96 bool BaseDateAndTimeInputType::isSteppable() const |
| 101 { | 97 { |
| 102 return true; | 98 return true; |
| 103 } | 99 } |
| 104 | 100 |
| 105 Decimal BaseDateAndTimeInputType::parseToNumber(const String& source, const Deci
mal& defaultValue) const | 101 Decimal BaseDateAndTimeInputType::parseToNumber(const String& source, const Deci
mal& defaultValue) const |
| 106 { | 102 { |
| 107 DateComponents date; | 103 DateComponents date; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 { | 179 { |
| 184 return element().isRequired() && value.isEmpty(); | 180 return element().isRequired() && value.isEmpty(); |
| 185 } | 181 } |
| 186 | 182 |
| 187 bool BaseDateAndTimeInputType::shouldShowFocusRingOnMouseFocus() const | 183 bool BaseDateAndTimeInputType::shouldShowFocusRingOnMouseFocus() const |
| 188 { | 184 { |
| 189 return true; | 185 return true; |
| 190 } | 186 } |
| 191 | 187 |
| 192 } // namespace blink | 188 } // namespace blink |
| OLD | NEW |