OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
7 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) | 7 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) |
8 * Copyright (C) 2009, 2010, 2011, 2012 Google Inc. All rights reserved. | 8 * Copyright (C) 2009, 2010, 2011, 2012 Google Inc. All rights reserved. |
9 * Copyright (C) 2012 Samsung Electronics. All rights reserved. | 9 * Copyright (C) 2012 Samsung Electronics. All rights reserved. |
10 * | 10 * |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 #include "core/html/forms/WeekInputType.h" | 66 #include "core/html/forms/WeekInputType.h" |
67 #include "core/html/parser/HTMLParserIdioms.h" | 67 #include "core/html/parser/HTMLParserIdioms.h" |
68 #include "core/rendering/RenderTheme.h" | 68 #include "core/rendering/RenderTheme.h" |
69 #include "platform/text/PlatformLocale.h" | 69 #include "platform/text/PlatformLocale.h" |
70 #include "platform/text/TextBreakIterator.h" | 70 #include "platform/text/TextBreakIterator.h" |
71 | 71 |
72 namespace WebCore { | 72 namespace WebCore { |
73 | 73 |
74 using blink::WebLocalizedString; | 74 using blink::WebLocalizedString; |
75 using namespace HTMLNames; | 75 using namespace HTMLNames; |
76 using namespace std; | |
77 | 76 |
78 typedef PassRefPtrWillBeRawPtr<InputType> (*InputTypeFactoryFunction)(HTMLInputE
lement&); | 77 typedef PassRefPtrWillBeRawPtr<InputType> (*InputTypeFactoryFunction)(HTMLInputE
lement&); |
79 typedef HashMap<AtomicString, InputTypeFactoryFunction, CaseFoldingHash> InputTy
peFactoryMap; | 78 typedef HashMap<AtomicString, InputTypeFactoryFunction, CaseFoldingHash> InputTy
peFactoryMap; |
80 | 79 |
81 static PassOwnPtr<InputTypeFactoryMap> createInputTypeFactoryMap() | 80 static PassOwnPtr<InputTypeFactoryMap> createInputTypeFactoryMap() |
82 { | 81 { |
83 OwnPtr<InputTypeFactoryMap> map = adoptPtr(new InputTypeFactoryMap); | 82 OwnPtr<InputTypeFactoryMap> map = adoptPtr(new InputTypeFactoryMap); |
84 map->add(InputTypeNames::button, ButtonInputType::create); | 83 map->add(InputTypeNames::button, ButtonInputType::create); |
85 map->add(InputTypeNames::checkbox, CheckboxInputType::create); | 84 map->add(InputTypeNames::checkbox, CheckboxInputType::create); |
86 map->add(InputTypeNames::color, ColorInputType::create); | 85 map->add(InputTypeNames::color, ColorInputType::create); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 return DateComponents::invalidMilliseconds(); | 192 return DateComponents::invalidMilliseconds(); |
194 } | 193 } |
195 | 194 |
196 void InputType::setValueAsDate(double, ExceptionState& exceptionState) const | 195 void InputType::setValueAsDate(double, ExceptionState& exceptionState) const |
197 { | 196 { |
198 exceptionState.throwDOMException(InvalidStateError, "This input element does
not support Date values."); | 197 exceptionState.throwDOMException(InvalidStateError, "This input element does
not support Date values."); |
199 } | 198 } |
200 | 199 |
201 double InputType::valueAsDouble() const | 200 double InputType::valueAsDouble() const |
202 { | 201 { |
203 return numeric_limits<double>::quiet_NaN(); | 202 return std::numeric_limits<double>::quiet_NaN(); |
204 } | 203 } |
205 | 204 |
206 void InputType::setValueAsDouble(double doubleValue, TextFieldEventBehavior even
tBehavior, ExceptionState& exceptionState) const | 205 void InputType::setValueAsDouble(double doubleValue, TextFieldEventBehavior even
tBehavior, ExceptionState& exceptionState) const |
207 { | 206 { |
208 exceptionState.throwDOMException(InvalidStateError, "This input element does
not support Number values."); | 207 exceptionState.throwDOMException(InvalidStateError, "This input element does
not support Number values."); |
209 } | 208 } |
210 | 209 |
211 void InputType::setValueAsDecimal(const Decimal& newValue, TextFieldEventBehavio
r eventBehavior, ExceptionState&) const | 210 void InputType::setValueAsDecimal(const Decimal& newValue, TextFieldEventBehavio
r eventBehavior, ExceptionState&) const |
212 { | 211 { |
213 element().setValue(serialize(newValue), eventBehavior); | 212 element().setValue(serialize(newValue), eventBehavior); |
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
968 StepRange InputType::createStepRange(AnyStepHandling anyStepHandling, const Deci
mal& stepBaseDefault, const Decimal& minimumDefault, const Decimal& maximumDefau
lt, const StepRange::StepDescription& stepDescription) const | 967 StepRange InputType::createStepRange(AnyStepHandling anyStepHandling, const Deci
mal& stepBaseDefault, const Decimal& minimumDefault, const Decimal& maximumDefau
lt, const StepRange::StepDescription& stepDescription) const |
969 { | 968 { |
970 const Decimal stepBase = findStepBase(stepBaseDefault); | 969 const Decimal stepBase = findStepBase(stepBaseDefault); |
971 const Decimal minimum = parseToNumber(element().fastGetAttribute(minAttr), m
inimumDefault); | 970 const Decimal minimum = parseToNumber(element().fastGetAttribute(minAttr), m
inimumDefault); |
972 const Decimal maximum = parseToNumber(element().fastGetAttribute(maxAttr), m
aximumDefault); | 971 const Decimal maximum = parseToNumber(element().fastGetAttribute(maxAttr), m
aximumDefault); |
973 const Decimal step = StepRange::parseStep(anyStepHandling, stepDescription,
element().fastGetAttribute(stepAttr)); | 972 const Decimal step = StepRange::parseStep(anyStepHandling, stepDescription,
element().fastGetAttribute(stepAttr)); |
974 return StepRange(stepBase, minimum, maximum, step, stepDescription); | 973 return StepRange(stepBase, minimum, maximum, step, stepDescription); |
975 } | 974 } |
976 | 975 |
977 } // namespace WebCore | 976 } // namespace WebCore |
OLD | NEW |