| 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 | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights |
| 6 * reserved. | 6 * reserved. |
| 7 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 7 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 } | 340 } |
| 341 } | 341 } |
| 342 | 342 |
| 343 void HTMLFormElement::submit(Event* event, | 343 void HTMLFormElement::submit(Event* event, |
| 344 HTMLFormControlElement* submitButton) { | 344 HTMLFormControlElement* submitButton) { |
| 345 FrameView* view = document().view(); | 345 FrameView* view = document().view(); |
| 346 LocalFrame* frame = document().frame(); | 346 LocalFrame* frame = document().frame(); |
| 347 if (!view || !frame || !frame->page()) | 347 if (!view || !frame || !frame->page()) |
| 348 return; | 348 return; |
| 349 | 349 |
| 350 // https://html.spec.whatwg.org/multipage/forms.html#form-submission-algorithm | 350 // See crbug.com/586749. |
| 351 // 2. If form document is not connected, has no associated browsing context, | |
| 352 // or its active sandboxing flag set has its sandboxed forms browsing | |
| 353 // context flag set, then abort these steps without doing anything. | |
| 354 if (!isConnected()) | 351 if (!isConnected()) |
| 355 return; | 352 UseCounter::count(document(), UseCounter::FormSubmissionNotInDocumentTree); |
| 356 | 353 |
| 357 if (m_isSubmitting) | 354 if (m_isSubmitting) |
| 358 return; | 355 return; |
| 359 | 356 |
| 360 // Delay dispatching 'close' to dialog until done submitting. | 357 // Delay dispatching 'close' to dialog until done submitting. |
| 361 EventQueueScope scopeForDialogClose; | 358 EventQueueScope scopeForDialogClose; |
| 362 AutoReset<bool> submitScope(&m_isSubmitting, true); | 359 AutoReset<bool> submitScope(&m_isSubmitting, true); |
| 363 | 360 |
| 364 if (event && !submitButton) { | 361 if (event && !submitButton) { |
| 365 // In a case of implicit submission without a submit button, 'submit' | 362 // In a case of implicit submission without a submit button, 'submit' |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 809 for (const auto& control : associatedElements()) { | 806 for (const auto& control : associatedElements()) { |
| 810 if (!control->isFormControlElement()) | 807 if (!control->isFormControlElement()) |
| 811 continue; | 808 continue; |
| 812 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton()) | 809 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton()) |
| 813 toHTMLFormControlElement(control)->pseudoStateChanged( | 810 toHTMLFormControlElement(control)->pseudoStateChanged( |
| 814 CSSSelector::PseudoDefault); | 811 CSSSelector::PseudoDefault); |
| 815 } | 812 } |
| 816 } | 813 } |
| 817 | 814 |
| 818 } // namespace blink | 815 } // namespace blink |
| OLD | NEW |