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

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

Issue 130213005: Add autofill preview support for <month> input fields (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase TestExpectations file Created 6 years, 9 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 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 496
497 void BaseMultipleFieldsDateAndTimeInputType::updateView() 497 void BaseMultipleFieldsDateAndTimeInputType::updateView()
498 { 498 {
499 DateTimeEditElement* edit = dateTimeEditElement(); 499 DateTimeEditElement* edit = dateTimeEditElement();
500 if (!edit) 500 if (!edit)
501 return; 501 return;
502 502
503 DateTimeEditElement::LayoutParameters layoutParameters(element().locale(), c reateStepRange(AnyIsDefaultStep)); 503 DateTimeEditElement::LayoutParameters layoutParameters(element().locale(), c reateStepRange(AnyIsDefaultStep));
504 504
505 DateComponents date; 505 DateComponents date;
506 const bool hasValue = parseToDateComponents(element().value(), &date); 506 bool hasValue = false;
507 if (!element().suggestedValue().isNull())
508 hasValue = parseToDateComponents(element().suggestedValue(), &date);
509 else
510 hasValue = parseToDateComponents(element().value(), &date);
507 if (!hasValue) 511 if (!hasValue)
508 setMillisecondToDateComponents(layoutParameters.stepRange.minimum().toDo uble(), &date); 512 setMillisecondToDateComponents(layoutParameters.stepRange.minimum().toDo uble(), &date);
509 513
510 setupLayoutParameters(layoutParameters, date); 514 setupLayoutParameters(layoutParameters, date);
511 515
512 const AtomicString pattern = edit->fastGetAttribute(HTMLNames::patternAttr); 516 const AtomicString pattern = edit->fastGetAttribute(HTMLNames::patternAttr);
513 if (!pattern.isEmpty()) 517 if (!pattern.isEmpty())
514 layoutParameters.dateTimeFormat = pattern; 518 layoutParameters.dateTimeFormat = pattern;
515 519
516 if (!DateTimeFormatValidator().validateFormat(layoutParameters.dateTimeForma t, *this)) 520 if (!DateTimeFormatValidator().validateFormat(layoutParameters.dateTimeForma t, *this))
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 clearButton->setInlineStyleProperty(CSSPropertyPointerEvents, CSSValueNo ne); 604 clearButton->setInlineStyleProperty(CSSPropertyPointerEvents, CSSValueNo ne);
601 } else { 605 } else {
602 clearButton->removeInlineStyleProperty(CSSPropertyOpacity); 606 clearButton->removeInlineStyleProperty(CSSPropertyOpacity);
603 clearButton->removeInlineStyleProperty(CSSPropertyPointerEvents); 607 clearButton->removeInlineStyleProperty(CSSPropertyPointerEvents);
604 } 608 }
605 } 609 }
606 610
607 } // namespace WebCore 611 } // namespace WebCore
608 612
609 #endif 613 #endif
OLDNEW
« no previous file with comments | « Source/core/html/forms/BaseChooserOnlyDateAndTimeInputType.cpp ('k') | Source/core/html/forms/MonthInputType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698