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

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: Created 6 years, 11 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 if (!element().formControlValueMatchesRenderer())
Ilya Sherman 2014/02/08 01:22:18 Why is it relevant whether the form control's valu
ziran.sun 2014/02/10 18:21:09 Done.
ziran.sun 2014/02/10 18:21:09 I noticed this check in updateView() in TextFieldI
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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 clearButton->setInlineStyleProperty(CSSPropertyPointerEvents, CSSValueNo ne); 606 clearButton->setInlineStyleProperty(CSSPropertyPointerEvents, CSSValueNo ne);
603 } else { 607 } else {
604 clearButton->removeInlineStyleProperty(CSSPropertyOpacity); 608 clearButton->removeInlineStyleProperty(CSSPropertyOpacity);
605 clearButton->removeInlineStyleProperty(CSSPropertyPointerEvents); 609 clearButton->removeInlineStyleProperty(CSSPropertyPointerEvents);
606 } 610 }
607 } 611 }
608 612
609 } // namespace WebCore 613 } // namespace WebCore
610 614
611 #endif 615 #endif
OLDNEW
« no previous file with comments | « LayoutTests/fast/forms/suggested-value-expected.txt ('k') | Source/core/html/forms/MonthInputType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698