Commit a17bbb37 authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

Android: input[type=date]: Update view if the value is updated by defaultValue setter

Thew new test is added to SmokeTests in order that Android build bots
run it.

Bug: 838898
Change-Id: I18f8320550a82fb5fddc0c98f0b8f0417f1e4d80
Reviewed-on: https://chromium-review.googlesource.com/1056947Reviewed-by: default avatarYoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558667}
parent 7bcc2ea7
...@@ -539,6 +539,7 @@ fast/forms/button/button-value.html ...@@ -539,6 +539,7 @@ fast/forms/button/button-value.html
fast/forms/checkbox/checkbox-checked-state-affected-by-default-state.html fast/forms/checkbox/checkbox-checked-state-affected-by-default-state.html
fast/forms/color/color-setrangetext.html fast/forms/color/color-setrangetext.html
fast/forms/datalist/slider-appearance-with-ticks-crash.html fast/forms/datalist/slider-appearance-with-ticks-crash.html
fast/forms/date/date-chooseronly-defaultValue.html
fast/forms/date/date-format-warning.html fast/forms/date/date-format-warning.html
fast/forms/date-multiple-fields/date-multiple-fields-ax-value-changed-notification.html fast/forms/date-multiple-fields/date-multiple-fields-ax-value-changed-notification.html
fast/forms/datetimelocal/datetimelocal-input-type.html fast/forms/datetimelocal/datetimelocal-input-type.html
......
<!DOCTYPE html>
<body>
<input type="date" value="2015-07-25">
</body>
<!DOCTYPE html>
<!-- A test for crbug.com/838898. defaultValue setter should invalidate view. -->
<body>
<input type="date">
<script>
document.querySelector('input').defaultValue = '2015-07-25';
</script>
</body>
...@@ -109,6 +109,11 @@ void ChooserOnlyTemporalInputTypeView::UpdateView() { ...@@ -109,6 +109,11 @@ void ChooserOnlyTemporalInputTypeView::UpdateView() {
ToHTMLElement(node)->setTextContent(display_value); ToHTMLElement(node)->setTextContent(display_value);
} }
void ChooserOnlyTemporalInputTypeView::ValueAttributeChanged() {
if (!GetElement().HasDirtyValue())
UpdateView();
}
void ChooserOnlyTemporalInputTypeView::DidSetValue(const String& value, void ChooserOnlyTemporalInputTypeView::DidSetValue(const String& value,
bool value_changed) { bool value_changed) {
if (value_changed) if (value_changed)
......
...@@ -54,6 +54,7 @@ class ChooserOnlyTemporalInputTypeView final ...@@ -54,6 +54,7 @@ class ChooserOnlyTemporalInputTypeView final
// InputTypeView functions: // InputTypeView functions:
void CreateShadowSubtree() override; void CreateShadowSubtree() override;
void ClosePopupView() override; void ClosePopupView() override;
void ValueAttributeChanged() override;
void DidSetValue(const String&, bool value_changed) override; void DidSetValue(const String&, bool value_changed) override;
void HandleDOMActivateEvent(Event*) override; void HandleDOMActivateEvent(Event*) override;
void UpdateView() override; void UpdateView() override;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment