OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 |
OLD | NEW |