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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLInputElement.cpp

Issue 2749513003: INPUT element: Implicit form submission should reset setTextAsOfLastFormControlChangeEvent even if … (Closed)
Patch Set: . Created 3 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/forms/text/text-change-event-after-clear-in-submit.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 1248 matching lines...) Expand 10 before | Expand all | Expand 10 after
1259 wrapPersistent(this))); 1259 wrapPersistent(this)));
1260 } 1260 }
1261 // Form submission finishes editing, just as loss of focus does. 1261 // Form submission finishes editing, just as loss of focus does.
1262 // If there was a change, send the event now. 1262 // If there was a change, send the event now.
1263 if (wasChangedSinceLastFormControlChangeEvent()) 1263 if (wasChangedSinceLastFormControlChangeEvent())
1264 dispatchFormControlChangeEvent(); 1264 dispatchFormControlChangeEvent();
1265 1265
1266 HTMLFormElement* formForSubmission = m_inputTypeView->formForSubmission(); 1266 HTMLFormElement* formForSubmission = m_inputTypeView->formForSubmission();
1267 // Form may never have been present, or may have been destroyed by code 1267 // Form may never have been present, or may have been destroyed by code
1268 // responding to the change event. 1268 // responding to the change event.
1269 if (formForSubmission) { 1269 if (formForSubmission)
1270 formForSubmission->submitImplicitly(evt, canTriggerImplicitSubmission()); 1270 formForSubmission->submitImplicitly(evt, canTriggerImplicitSubmission());
1271 // We treat implicit submission is something like blur()-then-focus(). So 1271
1272 // we reset the last value. crbug.com/695349. 1272 // We treat implicit submission is something like blur()-then-focus(). So
1273 setTextAsOfLastFormControlChangeEvent(value()); 1273 // we reset the last value. crbug.com/695349 and crbug.com/700842.
1274 } 1274 setTextAsOfLastFormControlChangeEvent(value());
1275 1275
1276 evt->setDefaultHandled(); 1276 evt->setDefaultHandled();
1277 return; 1277 return;
1278 } 1278 }
1279 1279
1280 if (evt->isBeforeTextInsertedEvent()) 1280 if (evt->isBeforeTextInsertedEvent())
1281 m_inputTypeView->handleBeforeTextInsertedEvent( 1281 m_inputTypeView->handleBeforeTextInsertedEvent(
1282 static_cast<BeforeTextInsertedEvent*>(evt)); 1282 static_cast<BeforeTextInsertedEvent*>(evt));
1283 1283
1284 if (evt->isMouseEvent() && evt->type() == EventTypeNames::mousedown) { 1284 if (evt->isMouseEvent() && evt->type() == EventTypeNames::mousedown) {
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
1880 1880
1881 bool HTMLInputElement::hasFallbackContent() const { 1881 bool HTMLInputElement::hasFallbackContent() const {
1882 return m_inputTypeView->hasFallbackContent(); 1882 return m_inputTypeView->hasFallbackContent();
1883 } 1883 }
1884 1884
1885 void HTMLInputElement::setFilesFromPaths(const Vector<String>& paths) { 1885 void HTMLInputElement::setFilesFromPaths(const Vector<String>& paths) {
1886 return m_inputType->setFilesFromPaths(paths); 1886 return m_inputType->setFilesFromPaths(paths);
1887 } 1887 }
1888 1888
1889 } // namespace blink 1889 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/forms/text/text-change-event-after-clear-in-submit.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698