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

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

Issue 2712313002: Merge "INPUT element: Implicit form submission should reset setTextAsOfLastFormControlChangeEvent."… (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 1259 matching lines...) Expand 10 before | Expand all | Expand 10 after
1270 createSameThreadTask(&HTMLInputElement::onSearch, 1270 createSameThreadTask(&HTMLInputElement::onSearch,
1271 wrapPersistent(this))); 1271 wrapPersistent(this)));
1272 // Form submission finishes editing, just as loss of focus does. 1272 // Form submission finishes editing, just as loss of focus does.
1273 // If there was a change, send the event now. 1273 // If there was a change, send the event now.
1274 if (wasChangedSinceLastFormControlChangeEvent()) 1274 if (wasChangedSinceLastFormControlChangeEvent())
1275 dispatchFormControlChangeEvent(); 1275 dispatchFormControlChangeEvent();
1276 1276
1277 HTMLFormElement* formForSubmission = m_inputTypeView->formForSubmission(); 1277 HTMLFormElement* formForSubmission = m_inputTypeView->formForSubmission();
1278 // Form may never have been present, or may have been destroyed by code 1278 // Form may never have been present, or may have been destroyed by code
1279 // responding to the change event. 1279 // responding to the change event.
1280 if (formForSubmission) 1280 if (formForSubmission) {
1281 formForSubmission->submitImplicitly(evt, canTriggerImplicitSubmission()); 1281 formForSubmission->submitImplicitly(evt, canTriggerImplicitSubmission());
1282 // We treat implicit submission is something like blur()-then-focus(). So
1283 // we reset the last value. crbug.com/695349.
1284 setTextAsOfLastFormControlChangeEvent(value());
1285 }
1282 1286
1283 evt->setDefaultHandled(); 1287 evt->setDefaultHandled();
1284 return; 1288 return;
1285 } 1289 }
1286 1290
1287 if (evt->isBeforeTextInsertedEvent()) 1291 if (evt->isBeforeTextInsertedEvent())
1288 m_inputTypeView->handleBeforeTextInsertedEvent( 1292 m_inputTypeView->handleBeforeTextInsertedEvent(
1289 static_cast<BeforeTextInsertedEvent*>(evt)); 1293 static_cast<BeforeTextInsertedEvent*>(evt));
1290 1294
1291 if (evt->isMouseEvent() && evt->type() == EventTypeNames::mousedown) { 1295 if (evt->isMouseEvent() && evt->type() == EventTypeNames::mousedown) {
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
1887 1891
1888 bool HTMLInputElement::hasFallbackContent() const { 1892 bool HTMLInputElement::hasFallbackContent() const {
1889 return m_inputTypeView->hasFallbackContent(); 1893 return m_inputTypeView->hasFallbackContent();
1890 } 1894 }
1891 1895
1892 void HTMLInputElement::setFilesFromPaths(const Vector<String>& paths) { 1896 void HTMLInputElement::setFilesFromPaths(const Vector<String>& paths) {
1893 return m_inputType->setFilesFromPaths(paths); 1897 return m_inputType->setFilesFromPaths(paths);
1894 } 1898 }
1895 1899
1896 } // namespace blink 1900 } // 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