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

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

Issue 26317004: Merge 158428 "Fix a crash in HTMLFormElement::prepareForSubmission." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/1650/
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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 String message("An invalid form control with name='%name' is not foc usable."); 251 String message("An invalid form control with name='%name' is not foc usable.");
252 message.replace("%name", unhandledAssociatedElement->name()); 252 message.replace("%name", unhandledAssociatedElement->name());
253 document().addConsoleMessage(RenderingMessageSource, ErrorMessageLev el, message); 253 document().addConsoleMessage(RenderingMessageSource, ErrorMessageLev el, message);
254 } 254 }
255 } 255 }
256 return false; 256 return false;
257 } 257 }
258 258
259 bool HTMLFormElement::prepareForSubmission(Event* event) 259 bool HTMLFormElement::prepareForSubmission(Event* event)
260 { 260 {
261 RefPtr<HTMLFormElement> protector(this);
261 Frame* frame = document().frame(); 262 Frame* frame = document().frame();
262 if (m_isSubmittingOrPreparingForSubmission || !frame) 263 if (m_isSubmittingOrPreparingForSubmission || !frame)
263 return m_isSubmittingOrPreparingForSubmission; 264 return m_isSubmittingOrPreparingForSubmission;
264 265
265 m_isSubmittingOrPreparingForSubmission = true; 266 m_isSubmittingOrPreparingForSubmission = true;
266 m_shouldSubmit = false; 267 m_shouldSubmit = false;
267 268
268 // Interactive validation must be done before dispatching the submit event. 269 // Interactive validation must be done before dispatching the submit event.
269 if (!validateInteractively(event)) { 270 if (!validateInteractively(event)) {
270 m_isSubmittingOrPreparingForSubmission = false; 271 m_isSubmittingOrPreparingForSubmission = false;
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 } 787 }
787 788
788 void HTMLFormElement::setDemoted(bool demoted) 789 void HTMLFormElement::setDemoted(bool demoted)
789 { 790 {
790 if (demoted) 791 if (demoted)
791 UseCounter::count(&document(), UseCounter::DemotedFormElement); 792 UseCounter::count(&document(), UseCounter::DemotedFormElement);
792 m_wasDemoted = demoted; 793 m_wasDemoted = demoted;
793 } 794 }
794 795
795 } // namespace 796 } // 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