Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(661)

Side by Side Diff: third_party/WebKit/Source/core/html/shadow/DateTimeFieldElement.cpp

Issue 2259173002: Fix style errors in core/html/shadow/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698