| 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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 } | 333 } |
| 334 } | 334 } |
| 335 } | 335 } |
| 336 | 336 |
| 337 void HTMLFormElement::submit(Event* event, bool activateSubmitButton) | 337 void HTMLFormElement::submit(Event* event, bool activateSubmitButton) |
| 338 { | 338 { |
| 339 FrameView* view = document().view(); | 339 FrameView* view = document().view(); |
| 340 LocalFrame* frame = document().frame(); | 340 LocalFrame* frame = document().frame(); |
| 341 if (!view || !frame || !frame->page()) | 341 if (!view || !frame || !frame->page()) |
| 342 return; | 342 return; |
| 343 // See crbug.com/586749. |
| 344 if (!inShadowIncludingDocument()) |
| 345 UseCounter::count(document(), UseCounter::FormSubmissionNotInDocumentTre
e); |
| 343 | 346 |
| 344 if (m_isSubmittingOrInUserJSSubmitEvent) { | 347 if (m_isSubmittingOrInUserJSSubmitEvent) { |
| 345 m_shouldSubmit = true; | 348 m_shouldSubmit = true; |
| 346 return; | 349 return; |
| 347 } | 350 } |
| 348 | 351 |
| 349 m_isSubmittingOrInUserJSSubmitEvent = true; | 352 m_isSubmittingOrInUserJSSubmitEvent = true; |
| 350 | 353 |
| 351 HTMLFormControlElement* firstSuccessfulSubmitButton = nullptr; | 354 HTMLFormControlElement* firstSuccessfulSubmitButton = nullptr; |
| 352 bool needButtonActivation = activateSubmitButton; // do we need to activate
a submit button? | 355 bool needButtonActivation = activateSubmitButton; // do we need to activate
a submit button? |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 773 { | 776 { |
| 774 for (const auto& control : associatedElements()) { | 777 for (const auto& control : associatedElements()) { |
| 775 if (!control->isFormControlElement()) | 778 if (!control->isFormControlElement()) |
| 776 continue; | 779 continue; |
| 777 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton()) | 780 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton()) |
| 778 toHTMLFormControlElement(control)->pseudoStateChanged(CSSSelector::P
seudoDefault); | 781 toHTMLFormControlElement(control)->pseudoStateChanged(CSSSelector::P
seudoDefault); |
| 779 } | 782 } |
| 780 } | 783 } |
| 781 | 784 |
| 782 } // namespace blink | 785 } // namespace blink |
| OLD | NEW |