OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * Copyright (C) 2011 Apple Inc. All rights reserved. | 3 * Copyright (C) 2011 Apple Inc. All rights reserved. |
4 * Copyright (C) 2012 Samsung Electronics. All rights reserved. | 4 * Copyright (C) 2012 Samsung Electronics. All rights reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions are | 7 * modification, are permitted provided that the following conditions are |
8 * met: | 8 * met: |
9 * | 9 * |
10 * * Redistributions of source code must retain the above copyright | 10 * * Redistributions of source code must retain the above copyright |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
189 virtual bool isCheckable(); | 189 virtual bool isCheckable(); |
190 virtual bool isSteppable() const; | 190 virtual bool isSteppable() const; |
191 virtual bool shouldRespectHeightAndWidthAttributes(); | 191 virtual bool shouldRespectHeightAndWidthAttributes(); |
192 virtual bool supportsPlaceholder() const; | 192 virtual bool supportsPlaceholder() const; |
193 virtual bool supportsReadOnly() const; | 193 virtual bool supportsReadOnly() const; |
194 virtual void updatePlaceholderText(); | 194 virtual void updatePlaceholderText(); |
195 virtual String defaultToolTip() const; | 195 virtual String defaultToolTip() const; |
196 virtual Decimal findClosestTickMarkValue(const Decimal&); | 196 virtual Decimal findClosestTickMarkValue(const Decimal&); |
197 virtual void handleDOMActivateEvent(Event*); | 197 virtual void handleDOMActivateEvent(Event*); |
198 | 198 |
199 // Parses the specified string for the type, and return | 199 // Parses the first string argument for the input type, and return |
200 // the Decimal value for the parsing result if the parsing | 200 // the Decimal value for the parsing result if the parsing |
201 // succeeds; Returns defaultValue otherwise. This function can | 201 // succeeds. If not, that parsing is attempted for the second |
202 // return NaN or Infinity only if defaultValue is NaN or Infinity. | 202 // argument. If that also fails, it returns defaultValue. This |
203 virtual Decimal parseToNumber(const String&, const Decimal& defaultValue) co nst; | 203 // function can return NaN or Infinity only if defaultValue is NaN |
204 // or Infinity. | |
205 virtual Decimal parseToNumber(const String&, const String&, const Decimal& d efaultValue) const; | |
sof
2013/11/22 12:50:49
FYI - I went back & forth a bit on whether or not
tkent
2013/11/24 22:34:23
I don't think adding another argument to parseToNu
yosin_UTC9
2013/11/25 01:26:41
Agree with tkent@. It is confusing having alternat
sof
2013/11/26 17:59:05
Thanks, added a helper InputType::findStepBase(con
| |
204 | 206 |
205 // Parses the specified string for this InputType, and returns true if it | 207 // Parses the specified string for this InputType, and returns true if it |
206 // is successfully parsed. An instance pointed by the DateComponents* | 208 // is successfully parsed. An instance pointed by the DateComponents* |
207 // parameter will have parsed values and be modified even if the parsing | 209 // parameter will have parsed values and be modified even if the parsing |
208 // fails. The DateComponents* parameter may be 0. | 210 // fails. The DateComponents* parameter may be 0. |
209 virtual bool parseToDateComponents(const String&, DateComponents*) const; | 211 virtual bool parseToDateComponents(const String&, DateComponents*) const; |
210 | 212 |
211 // Create a string representation of the specified Decimal value for the | 213 // Create a string representation of the specified Decimal value for the |
212 // input type. If NaN or Infinity is specified, this returns an empty | 214 // input type. If NaN or Infinity is specified, this returns an empty |
213 // string. This should not be called for types without valueAsNumber. | 215 // string. This should not be called for types without valueAsNumber. |
(...skipping 23 matching lines...) Expand all Loading... | |
237 Decimal parseToNumberOrNaN(const String&) const; | 239 Decimal parseToNumberOrNaN(const String&) const; |
238 void countUsageIfVisible(UseCounter::Feature) const; | 240 void countUsageIfVisible(UseCounter::Feature) const; |
239 | 241 |
240 private: | 242 private: |
241 // Helper for stepUp()/stepDown(). Adds step value * count to the current va lue. | 243 // Helper for stepUp()/stepDown(). Adds step value * count to the current va lue. |
242 void applyStep(int count, AnyStepHandling, TextFieldEventBehavior, Exception State&); | 244 void applyStep(int count, AnyStepHandling, TextFieldEventBehavior, Exception State&); |
243 }; | 245 }; |
244 | 246 |
245 } // namespace WebCore | 247 } // namespace WebCore |
246 #endif | 248 #endif |
OLD | NEW |