| 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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 } | 289 } |
| 290 return false; | 290 return false; |
| 291 } | 291 } |
| 292 | 292 |
| 293 void HTMLFormElement::prepareForSubmission(Event* event) | 293 void HTMLFormElement::prepareForSubmission(Event* event) |
| 294 { | 294 { |
| 295 LocalFrame* frame = document().frame(); | 295 LocalFrame* frame = document().frame(); |
| 296 if (!frame || m_isSubmittingOrInUserJSSubmitEvent) | 296 if (!frame || m_isSubmittingOrInUserJSSubmitEvent) |
| 297 return; | 297 return; |
| 298 | 298 |
| 299 if (document().isSandboxed(SandboxForms)) { |
| 300 document().addConsoleMessage(ConsoleMessage::create(SecurityMessageSourc
e, ErrorMessageLevel, "Blocked form submission to '" + m_attributes.action() + "
' because the form's frame is sandboxed and the 'allow-forms' permission is not
set.")); |
| 301 return; |
| 302 } |
| 303 |
| 299 bool skipValidation = !document().page() || noValidate(); | 304 bool skipValidation = !document().page() || noValidate(); |
| 300 ASSERT(event); | 305 ASSERT(event); |
| 301 HTMLFormControlElement* submitElement = submitElementFromEvent(event); | 306 HTMLFormControlElement* submitElement = submitElementFromEvent(event); |
| 302 if (submitElement && submitElement->formNoValidate()) | 307 if (submitElement && submitElement->formNoValidate()) |
| 303 skipValidation = true; | 308 skipValidation = true; |
| 304 | 309 |
| 305 UseCounter::count(document(), UseCounter::FormSubmissionStarted); | 310 UseCounter::count(document(), UseCounter::FormSubmissionStarted); |
| 306 // Interactive validation must be done before dispatching the submit event. | 311 // Interactive validation must be done before dispatching the submit event. |
| 307 if (!skipValidation && !validateInteractively()) | 312 if (!skipValidation && !validateInteractively()) |
| 308 return; | 313 return; |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 784 { | 789 { |
| 785 for (const auto& control : associatedElements()) { | 790 for (const auto& control : associatedElements()) { |
| 786 if (!control->isFormControlElement()) | 791 if (!control->isFormControlElement()) |
| 787 continue; | 792 continue; |
| 788 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton()) | 793 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton()) |
| 789 toHTMLFormControlElement(control)->pseudoStateChanged(CSSSelector::P
seudoDefault); | 794 toHTMLFormControlElement(control)->pseudoStateChanged(CSSSelector::P
seudoDefault); |
| 790 } | 795 } |
| 791 } | 796 } |
| 792 | 797 |
| 793 } // namespace blink | 798 } // namespace blink |
| OLD | NEW |