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 18 matching lines...) Expand all Loading... |
29 #include "bindings/core/v8/ScriptEventListener.h" | 29 #include "bindings/core/v8/ScriptEventListener.h" |
30 #include "core/HTMLNames.h" | 30 #include "core/HTMLNames.h" |
31 #include "core/dom/Attribute.h" | 31 #include "core/dom/Attribute.h" |
32 #include "core/dom/Document.h" | 32 #include "core/dom/Document.h" |
33 #include "core/dom/ElementTraversal.h" | 33 #include "core/dom/ElementTraversal.h" |
34 #include "core/dom/NodeListsNodeData.h" | 34 #include "core/dom/NodeListsNodeData.h" |
35 #include "core/events/Event.h" | 35 #include "core/events/Event.h" |
36 #include "core/events/ScopedEventQueue.h" | 36 #include "core/events/ScopedEventQueue.h" |
37 #include "core/frame/LocalDOMWindow.h" | 37 #include "core/frame/LocalDOMWindow.h" |
38 #include "core/frame/LocalFrame.h" | 38 #include "core/frame/LocalFrame.h" |
| 39 #include "core/frame/RemoteFrame.h" |
39 #include "core/frame/UseCounter.h" | 40 #include "core/frame/UseCounter.h" |
40 #include "core/frame/csp/ContentSecurityPolicy.h" | 41 #include "core/frame/csp/ContentSecurityPolicy.h" |
41 #include "core/html/HTMLCollection.h" | 42 #include "core/html/HTMLCollection.h" |
42 #include "core/html/HTMLDialogElement.h" | 43 #include "core/html/HTMLDialogElement.h" |
43 #include "core/html/HTMLFormControlsCollection.h" | 44 #include "core/html/HTMLFormControlsCollection.h" |
44 #include "core/html/HTMLImageElement.h" | 45 #include "core/html/HTMLImageElement.h" |
45 #include "core/html/HTMLInputElement.h" | 46 #include "core/html/HTMLInputElement.h" |
46 #include "core/html/HTMLObjectElement.h" | 47 #include "core/html/HTMLObjectElement.h" |
47 #include "core/html/RadioNodeList.h" | 48 #include "core/html/RadioNodeList.h" |
48 #include "core/html/forms/FormController.h" | 49 #include "core/html/forms/FormController.h" |
49 #include "core/inspector/ConsoleMessage.h" | 50 #include "core/inspector/ConsoleMessage.h" |
| 51 #include "core/loader/FormSubmission.h" |
50 #include "core/loader/FrameLoader.h" | 52 #include "core/loader/FrameLoader.h" |
51 #include "core/loader/FrameLoaderClient.h" | 53 #include "core/loader/FrameLoaderClient.h" |
52 #include "core/loader/MixedContentChecker.h" | 54 #include "core/loader/MixedContentChecker.h" |
53 #include "core/loader/NavigationScheduler.h" | 55 #include "core/loader/NavigationScheduler.h" |
54 #include "platform/UserGestureIndicator.h" | 56 #include "platform/UserGestureIndicator.h" |
55 #include "public/platform/WebInsecureRequestPolicy.h" | 57 #include "public/platform/WebInsecureRequestPolicy.h" |
56 #include "wtf/text/AtomicString.h" | 58 #include "wtf/text/AtomicString.h" |
57 #include <limits> | 59 #include <limits> |
58 | 60 |
59 namespace blink { | 61 namespace blink { |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 } else { | 415 } else { |
414 submission->clearTarget(); | 416 submission->clearTarget(); |
415 } | 417 } |
416 if (!targetFrame->host()) | 418 if (!targetFrame->host()) |
417 return; | 419 return; |
418 | 420 |
419 UseCounter::count(document(), UseCounter::FormsSubmitted); | 421 UseCounter::count(document(), UseCounter::FormsSubmitted); |
420 if (MixedContentChecker::isMixedFormAction(document().frame(), submission->a
ction())) | 422 if (MixedContentChecker::isMixedFormAction(document().frame(), submission->a
ction())) |
421 UseCounter::count(document().frame(), UseCounter::MixedContentFormsSubmi
tted); | 423 UseCounter::count(document().frame(), UseCounter::MixedContentFormsSubmi
tted); |
422 | 424 |
423 // FIXME: Plumb form submission for remote frames. | 425 // TODO(lukasza): Investigate if the code below can uniformly handle remote |
424 if (targetFrame->isLocalFrame()) | 426 // and local frames (i.e. by calling virtual Frame::navigate from a timer). |
| 427 // See also https://goo.gl/95d2KA. |
| 428 if (targetFrame->isLocalFrame()) { |
425 toLocalFrame(targetFrame)->navigationScheduler().scheduleFormSubmission(
&document(), submission); | 429 toLocalFrame(targetFrame)->navigationScheduler().scheduleFormSubmission(
&document(), submission); |
| 430 } else { |
| 431 FrameLoadRequest frameLoadRequest = submission->createFrameLoadRequest(&
document()); |
| 432 toRemoteFrame(targetFrame)->navigate(frameLoadRequest); |
| 433 } |
426 } | 434 } |
427 | 435 |
428 void HTMLFormElement::reset() | 436 void HTMLFormElement::reset() |
429 { | 437 { |
430 LocalFrame* frame = document().frame(); | 438 LocalFrame* frame = document().frame(); |
431 if (m_isInResetFunction || !frame) | 439 if (m_isInResetFunction || !frame) |
432 return; | 440 return; |
433 | 441 |
434 m_isInResetFunction = true; | 442 m_isInResetFunction = true; |
435 | 443 |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 { | 784 { |
777 for (const auto& control : associatedElements()) { | 785 for (const auto& control : associatedElements()) { |
778 if (!control->isFormControlElement()) | 786 if (!control->isFormControlElement()) |
779 continue; | 787 continue; |
780 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton()) | 788 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton()) |
781 toHTMLFormControlElement(control)->pseudoStateChanged(CSSSelector::P
seudoDefault); | 789 toHTMLFormControlElement(control)->pseudoStateChanged(CSSSelector::P
seudoDefault); |
782 } | 790 } |
783 } | 791 } |
784 | 792 |
785 } // namespace blink | 793 } // namespace blink |
OLD | NEW |