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: third_party/WebKit/Source/core/html/HTMLInputElement.cpp

Issue 2452903002: INPUT element: Updating value to the previous defaultValue should dispatch "change" event. (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/forms/text/text-change-event-after-updating-default.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
6 * rights reserved. 6 * rights reserved.
7 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 7 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
8 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) 8 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org)
9 * Copyright (C) 2010 Google Inc. All rights reserved. 9 * Copyright (C) 2010 Google Inc. All rights reserved.
10 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. 10 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved.
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 } else if (name == typeAttr) { 711 } else if (name == typeAttr) {
712 updateType(); 712 updateType();
713 } else if (name == valueAttr) { 713 } else if (name == valueAttr) {
714 // We only need to setChanged if the form is looking at the default value 714 // We only need to setChanged if the form is looking at the default value
715 // right now. 715 // right now.
716 if (!hasDirtyValue()) { 716 if (!hasDirtyValue()) {
717 updatePlaceholderVisibility(); 717 updatePlaceholderVisibility();
718 setNeedsStyleRecalc( 718 setNeedsStyleRecalc(
719 SubtreeStyleChange, 719 SubtreeStyleChange,
720 StyleChangeReasonForTracing::fromAttribute(valueAttr)); 720 StyleChangeReasonForTracing::fromAttribute(valueAttr));
721 if (m_inputType->valueMode() == ValueMode::kValue)
722 setTextAsOfLastFormControlChangeEvent(sanitizeValue(value));
721 } 723 }
722 m_needsToUpdateViewValue = true; 724 m_needsToUpdateViewValue = true;
723 setNeedsValidityCheck(); 725 setNeedsValidityCheck();
724 m_valueAttributeWasUpdatedAfterParsing = !m_parsingInProgress; 726 m_valueAttributeWasUpdatedAfterParsing = !m_parsingInProgress;
725 m_inputType->warnIfValueIsInvalidAndElementIsVisible(value); 727 m_inputType->warnIfValueIsInvalidAndElementIsVisible(value);
726 m_inputTypeView->valueAttributeChanged(); 728 m_inputTypeView->valueAttributeChanged();
727 } else if (name == checkedAttr) { 729 } else if (name == checkedAttr) {
728 // Another radio button in the same group might be checked by state 730 // Another radio button in the same group might be checked by state
729 // restore. We shouldn't call setChecked() even if this has the checked 731 // restore. We shouldn't call setChecked() even if this has the checked
730 // attribute. So, delay the setChecked() call until 732 // attribute. So, delay the setChecked() call until
(...skipping 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after
1931 1933
1932 bool HTMLInputElement::hasFallbackContent() const { 1934 bool HTMLInputElement::hasFallbackContent() const {
1933 return m_inputTypeView->hasFallbackContent(); 1935 return m_inputTypeView->hasFallbackContent();
1934 } 1936 }
1935 1937
1936 void HTMLInputElement::setFilesFromPaths(const Vector<String>& paths) { 1938 void HTMLInputElement::setFilesFromPaths(const Vector<String>& paths) {
1937 return m_inputType->setFilesFromPaths(paths); 1939 return m_inputType->setFilesFromPaths(paths);
1938 } 1940 }
1939 1941
1940 } // namespace blink 1942 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/forms/text/text-change-event-after-updating-default.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698