Chromium Code Reviews| 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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 343 } | 343 } |
| 344 } | 344 } |
| 345 } | 345 } |
| 346 | 346 |
| 347 void HTMLFormElement::submit(Event* event, bool activateSubmitButton) | 347 void HTMLFormElement::submit(Event* event, bool activateSubmitButton) |
| 348 { | 348 { |
| 349 FrameView* view = document().view(); | 349 FrameView* view = document().view(); |
| 350 LocalFrame* frame = document().frame(); | 350 LocalFrame* frame = document().frame(); |
| 351 if (!view || !frame || !frame->page()) | 351 if (!view || !frame || !frame->page()) |
| 352 return; | 352 return; |
| 353 // See crbug.com/586749. | 353 |
| 354 // Do not submit if the form is not attached to the document. | |
| 355 // This matches the behaviour in fireFox. | |
|
iclelland
2016/08/23 17:46:23
Nit: "Firefox"
Also, you could put a reference to
lunalu1
2016/08/24 15:24:42
Done.
| |
| 354 if (!isConnected()) | 356 if (!isConnected()) |
| 355 UseCounter::count(document(), UseCounter::FormSubmissionNotInDocumentTre e); | 357 return; |
| 356 | 358 |
| 357 if (m_isSubmitting) | 359 if (m_isSubmitting) |
| 358 return; | 360 return; |
| 359 | 361 |
| 360 // Delay dispatching 'close' to dialog until done submitting. | 362 // Delay dispatching 'close' to dialog until done submitting. |
| 361 EventQueueScope scopeForDialogClose; | 363 EventQueueScope scopeForDialogClose; |
| 362 AutoReset<bool> submitScope(&m_isSubmitting, true); | 364 AutoReset<bool> submitScope(&m_isSubmitting, true); |
| 363 | 365 |
| 364 HTMLFormControlElement* firstSuccessfulSubmitButton = nullptr; | 366 HTMLFormControlElement* firstSuccessfulSubmitButton = nullptr; |
| 365 bool needButtonActivation = activateSubmitButton; // do we need to activate a submit button? | 367 bool needButtonActivation = activateSubmitButton; // do we need to activate a submit button? |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 795 { | 797 { |
| 796 for (const auto& control : associatedElements()) { | 798 for (const auto& control : associatedElements()) { |
| 797 if (!control->isFormControlElement()) | 799 if (!control->isFormControlElement()) |
| 798 continue; | 800 continue; |
| 799 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton()) | 801 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton()) |
| 800 toHTMLFormControlElement(control)->pseudoStateChanged(CSSSelector::P seudoDefault); | 802 toHTMLFormControlElement(control)->pseudoStateChanged(CSSSelector::P seudoDefault); |
| 801 } | 803 } |
| 802 } | 804 } |
| 803 | 805 |
| 804 } // namespace blink | 806 } // namespace blink |
| OLD | NEW |