OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 if (index < 0) | 80 if (index < 0) |
81 return; | 81 return; |
82 setValueAsInteger(index, DispatchEvent); | 82 setValueAsInteger(index, DispatchEvent); |
83 } | 83 } |
84 | 84 |
85 bool DateTimeSymbolicFieldElement::hasValue() const | 85 bool DateTimeSymbolicFieldElement::hasValue() const |
86 { | 86 { |
87 return m_selectedIndex >= 0; | 87 return m_selectedIndex >= 0; |
88 } | 88 } |
89 | 89 |
90 int DateTimeSymbolicFieldElement::maximum() const | 90 void DateTimeSymbolicFieldElement::initialize(const AtomicString& pseudo, const
String& axHelpText) |
91 { | 91 { |
92 return static_cast<int>(m_symbols.size()); | 92 // The minimum and maximum below are exposed to users, and 1-based numbers |
93 } | 93 // are natural for symbolic fields. For example, the minimum value of a |
94 | 94 // month field should be 1, not 0. |
95 int DateTimeSymbolicFieldElement::minimum() const | 95 DateTimeFieldElement::initialize(pseudo, axHelpText, 1, static_cast<int>(m_s
ymbols.size())); |
96 { | |
97 return 1; | |
98 } | 96 } |
99 | 97 |
100 void DateTimeSymbolicFieldElement::setEmptyValue(EventBehavior eventBehavior) | 98 void DateTimeSymbolicFieldElement::setEmptyValue(EventBehavior eventBehavior) |
101 { | 99 { |
102 if (isReadOnly()) | 100 if (isReadOnly()) |
103 return; | 101 return; |
104 m_selectedIndex = invalidIndex; | 102 m_selectedIndex = invalidIndex; |
105 updateVisibleValue(eventBehavior); | 103 updateVisibleValue(eventBehavior); |
106 } | 104 } |
107 | 105 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 } | 153 } |
156 | 154 |
157 String DateTimeSymbolicFieldElement::optionAtIndex(int index) const | 155 String DateTimeSymbolicFieldElement::optionAtIndex(int index) const |
158 { | 156 { |
159 return m_symbols[index]; | 157 return m_symbols[index]; |
160 } | 158 } |
161 | 159 |
162 } // namespace WebCore | 160 } // namespace WebCore |
163 | 161 |
164 #endif | 162 #endif |
OLD | NEW |