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

Side by Side Diff: third_party/WebKit/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp

Issue 1844223002: Literal AtomicString construction can rely on strlen optimization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 bool hasValue = false; 518 bool hasValue = false;
519 if (!element().suggestedValue().isNull()) 519 if (!element().suggestedValue().isNull())
520 hasValue = parseToDateComponents(element().suggestedValue(), &date); 520 hasValue = parseToDateComponents(element().suggestedValue(), &date);
521 else 521 else
522 hasValue = parseToDateComponents(element().value(), &date); 522 hasValue = parseToDateComponents(element().value(), &date);
523 if (!hasValue) 523 if (!hasValue)
524 setMillisecondToDateComponents(layoutParameters.stepRange.minimum().toDo uble(), &date); 524 setMillisecondToDateComponents(layoutParameters.stepRange.minimum().toDo uble(), &date);
525 525
526 setupLayoutParameters(layoutParameters, date); 526 setupLayoutParameters(layoutParameters, date);
527 527
528 DEFINE_STATIC_LOCAL(AtomicString, datetimeformatAttr, ("datetimeformat", Ato micString::ConstructFromLiteral)); 528 DEFINE_STATIC_LOCAL(AtomicString, datetimeformatAttr, ("datetimeformat"));
529 edit->setAttribute(datetimeformatAttr, AtomicString(layoutParameters.dateTim eFormat), ASSERT_NO_EXCEPTION); 529 edit->setAttribute(datetimeformatAttr, AtomicString(layoutParameters.dateTim eFormat), ASSERT_NO_EXCEPTION);
530 const AtomicString pattern = edit->fastGetAttribute(HTMLNames::patternAttr); 530 const AtomicString pattern = edit->fastGetAttribute(HTMLNames::patternAttr);
531 if (!pattern.isEmpty()) 531 if (!pattern.isEmpty())
532 layoutParameters.dateTimeFormat = pattern; 532 layoutParameters.dateTimeFormat = pattern;
533 533
534 if (!DateTimeFormatValidator().validateFormat(layoutParameters.dateTimeForma t, *this)) 534 if (!DateTimeFormatValidator().validateFormat(layoutParameters.dateTimeForma t, *this))
535 layoutParameters.dateTimeFormat = layoutParameters.fallbackDateTimeForma t; 535 layoutParameters.dateTimeFormat = layoutParameters.fallbackDateTimeForma t;
536 536
537 if (hasValue) 537 if (hasValue)
538 edit->setValueAsDate(layoutParameters, date); 538 edit->setValueAsDate(layoutParameters, date);
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 AXObject* BaseMultipleFieldsDateAndTimeInputType::popupRootAXObject() 628 AXObject* BaseMultipleFieldsDateAndTimeInputType::popupRootAXObject()
629 { 629 {
630 if (PickerIndicatorElement* picker = pickerIndicatorElement()) 630 if (PickerIndicatorElement* picker = pickerIndicatorElement())
631 return picker->popupRootAXObject(); 631 return picker->popupRootAXObject();
632 return nullptr; 632 return nullptr;
633 } 633 }
634 634
635 } // namespace blink 635 } // namespace blink
636 636
637 #endif 637 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698