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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
276 kRenderingMessageSource, kErrorMessageLevel, message)); | 276 kRenderingMessageSource, kErrorMessageLevel, message)); |
277 } | 277 } |
278 } | 278 } |
279 return false; | 279 return false; |
280 } | 280 } |
281 | 281 |
282 void HTMLFormElement::PrepareForSubmission( | 282 void HTMLFormElement::PrepareForSubmission( |
283 Event* event, | 283 Event* event, |
284 HTMLFormControlElement* submit_button) { | 284 HTMLFormControlElement* submit_button) { |
285 LocalFrame* frame = GetDocument().GetFrame(); | 285 LocalFrame* frame = GetDocument().GetFrame(); |
286 if (!frame || is_submitting_ || in_user_js_submit_event_) | 286 if (!frame || is_submitting_ || in_user_js_submit_event_ || |
287 (submit_button && !submit_button->isConnected())) | |
tkent
2017/05/23 23:32:52
You don't need to check isConnected() of submit_bu
Shanmuga Pandi
2017/05/24 07:09:54
Done.
| |
287 return; | 288 return; |
288 | 289 |
289 if (GetDocument().IsSandboxed(kSandboxForms)) { | 290 if (GetDocument().IsSandboxed(kSandboxForms)) { |
290 GetDocument().AddConsoleMessage(ConsoleMessage::Create( | 291 GetDocument().AddConsoleMessage(ConsoleMessage::Create( |
291 kSecurityMessageSource, kErrorMessageLevel, | 292 kSecurityMessageSource, kErrorMessageLevel, |
292 "Blocked form submission to '" + attributes_.Action() + | 293 "Blocked form submission to '" + attributes_.Action() + |
293 "' because the form's frame is sandboxed and the 'allow-forms' " | 294 "' because the form's frame is sandboxed and the 'allow-forms' " |
294 "permission is not set.")); | 295 "permission is not set.")); |
295 return; | 296 return; |
296 } | 297 } |
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
842 for (const auto& control : ListedElements()) { | 843 for (const auto& control : ListedElements()) { |
843 if (!control->IsFormControlElement()) | 844 if (!control->IsFormControlElement()) |
844 continue; | 845 continue; |
845 if (ToHTMLFormControlElement(control)->CanBeSuccessfulSubmitButton()) | 846 if (ToHTMLFormControlElement(control)->CanBeSuccessfulSubmitButton()) |
846 ToHTMLFormControlElement(control)->PseudoStateChanged( | 847 ToHTMLFormControlElement(control)->PseudoStateChanged( |
847 CSSSelector::kPseudoDefault); | 848 CSSSelector::kPseudoDefault); |
848 } | 849 } |
849 } | 850 } |
850 | 851 |
851 } // namespace blink | 852 } // namespace blink |
OLD | NEW |