OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |