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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 |
OLD | NEW |