| 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 | 213 |
| 214 bool DateTimeFieldElement::supportsFocus() const | 214 bool DateTimeFieldElement::supportsFocus() const |
| 215 { | 215 { |
| 216 return !isDisabled() && !isFieldOwnerDisabled(); | 216 return !isDisabled() && !isFieldOwnerDisabled(); |
| 217 } | 217 } |
| 218 | 218 |
| 219 void DateTimeFieldElement::updateVisibleValue(EventBehavior eventBehavior) | 219 void DateTimeFieldElement::updateVisibleValue(EventBehavior eventBehavior) |
| 220 { | 220 { |
| 221 Text* const textNode = toText(firstChild()); | 221 Text* const textNode = toText(firstChild()); |
| 222 const String newVisibleValue = visibleValue(); | 222 const String newVisibleValue = visibleValue(); |
| 223 ASSERT(newVisibleValue.length() > 0); | 223 DCHECK_GT(newVisibleValue.length(), 0u); |
| 224 | 224 |
| 225 if (textNode->wholeText() == newVisibleValue) | 225 if (textNode->wholeText() == newVisibleValue) |
| 226 return; | 226 return; |
| 227 | 227 |
| 228 textNode->replaceWholeText(newVisibleValue); | 228 textNode->replaceWholeText(newVisibleValue); |
| 229 if (hasValue()) { | 229 if (hasValue()) { |
| 230 setAttribute(aria_valuetextAttr, AtomicString(newVisibleValue)); | 230 setAttribute(aria_valuetextAttr, AtomicString(newVisibleValue)); |
| 231 setAttribute(aria_valuenowAttr, AtomicString::number(valueForARIAValueNo
w())); | 231 setAttribute(aria_valuenowAttr, AtomicString::number(valueForARIAValueNo
w())); |
| 232 } else { | 232 } else { |
| 233 setAttribute(aria_valuetextAttr, AtomicString(emptyValueAXText())); | 233 setAttribute(aria_valuetextAttr, AtomicString(emptyValueAXText())); |
| 234 removeAttribute(aria_valuenowAttr); | 234 removeAttribute(aria_valuenowAttr); |
| 235 } | 235 } |
| 236 | 236 |
| 237 if (eventBehavior == DispatchEvent && m_fieldOwner) | 237 if (eventBehavior == DispatchEvent && m_fieldOwner) |
| 238 m_fieldOwner->fieldValueChanged(); | 238 m_fieldOwner->fieldValueChanged(); |
| 239 } | 239 } |
| 240 | 240 |
| 241 int DateTimeFieldElement::valueForARIAValueNow() const | 241 int DateTimeFieldElement::valueForARIAValueNow() const |
| 242 { | 242 { |
| 243 return valueAsInteger(); | 243 return valueAsInteger(); |
| 244 } | 244 } |
| 245 | 245 |
| 246 } // namespace blink | 246 } // namespace blink |
| 247 | 247 |
| OLD | NEW |