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

Side by Side Diff: Source/core/html/HTMLFormElement.cpp

Issue 26200002: Merge 158428 "Fix a crash in HTMLFormElement::prepareForSubmission." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/1599/
Patch Set: Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « LayoutTests/fast/forms/form-submission-crash-expected.txt ('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 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 String message("An invalid form control with name='%name' is not foc usable."); 249 String message("An invalid form control with name='%name' is not foc usable.");
250 message.replace("%name", unhandledAssociatedElement->name()); 250 message.replace("%name", unhandledAssociatedElement->name());
251 document()->addConsoleMessage(RenderingMessageSource, ErrorMessageLe vel, message); 251 document()->addConsoleMessage(RenderingMessageSource, ErrorMessageLe vel, message);
252 } 252 }
253 } 253 }
254 return false; 254 return false;
255 } 255 }
256 256
257 bool HTMLFormElement::prepareForSubmission(Event* event) 257 bool HTMLFormElement::prepareForSubmission(Event* event)
258 { 258 {
259 RefPtr<HTMLFormElement> protector(this);
259 Frame* frame = document()->frame(); 260 Frame* frame = document()->frame();
260 if (m_isSubmittingOrPreparingForSubmission || !frame) 261 if (m_isSubmittingOrPreparingForSubmission || !frame)
261 return m_isSubmittingOrPreparingForSubmission; 262 return m_isSubmittingOrPreparingForSubmission;
262 263
263 m_isSubmittingOrPreparingForSubmission = true; 264 m_isSubmittingOrPreparingForSubmission = true;
264 m_shouldSubmit = false; 265 m_shouldSubmit = false;
265 266
266 // Interactive validation must be done before dispatching the submit event. 267 // Interactive validation must be done before dispatching the submit event.
267 if (!validateInteractively(event)) { 268 if (!validateInteractively(event)) {
268 m_isSubmittingOrPreparingForSubmission = false; 269 m_isSubmittingOrPreparingForSubmission = false;
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 } 736 }
736 737
737 void HTMLFormElement::setDemoted(bool demoted) 738 void HTMLFormElement::setDemoted(bool demoted)
738 { 739 {
739 if (demoted) 740 if (demoted)
740 UseCounter::count(document(), UseCounter::DemotedFormElement); 741 UseCounter::count(document(), UseCounter::DemotedFormElement);
741 m_wasDemoted = demoted; 742 m_wasDemoted = demoted;
742 } 743 }
743 744
744 } // namespace 745 } // namespace
OLDNEW
« no previous file with comments | « LayoutTests/fast/forms/form-submission-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698