Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLFormElement.cpp

Issue 1999573003: OOPIFs: Fixing submitting forms targeting a remote frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@form-target-is-cross-site-frame
Patch Set: populate... -> createFrameLoadRequest + going through RemoteFrame::navigate(FrameLoadRequest&) Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 "wtf/text/AtomicString.h" 57 #include "wtf/text/AtomicString.h"
56 #include <limits> 58 #include <limits>
57 59
58 namespace blink { 60 namespace blink {
59 61
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 } else { 411 } else {
410 submission->clearTarget(); 412 submission->clearTarget();
411 } 413 }
412 if (!targetFrame->host()) 414 if (!targetFrame->host())
413 return; 415 return;
414 416
415 UseCounter::count(document(), UseCounter::FormsSubmitted); 417 UseCounter::count(document(), UseCounter::FormsSubmitted);
416 if (MixedContentChecker::isMixedFormAction(document().frame(), submission->a ction())) 418 if (MixedContentChecker::isMixedFormAction(document().frame(), submission->a ction()))
417 UseCounter::count(document().frame(), UseCounter::MixedContentFormsSubmi tted); 419 UseCounter::count(document().frame(), UseCounter::MixedContentFormsSubmi tted);
418 420
419 // FIXME: Plumb form submission for remote frames. 421 if (targetFrame->isLocalFrame()) {
420 if (targetFrame->isLocalFrame())
421 toLocalFrame(targetFrame)->navigationScheduler().scheduleFormSubmission( &document(), submission); 422 toLocalFrame(targetFrame)->navigationScheduler().scheduleFormSubmission( &document(), submission);
423 } else {
424 FrameLoadRequest frameLoadRequest = submission->createFrameLoadRequest(& document());
425 toRemoteFrame(targetFrame)->navigate(frameLoadRequest);
426 }
422 } 427 }
423 428
424 void HTMLFormElement::reset() 429 void HTMLFormElement::reset()
425 { 430 {
426 LocalFrame* frame = document().frame(); 431 LocalFrame* frame = document().frame();
427 if (m_isInResetFunction || !frame) 432 if (m_isInResetFunction || !frame)
428 return; 433 return;
429 434
430 m_isInResetFunction = true; 435 m_isInResetFunction = true;
431 436
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 { 777 {
773 for (const auto& control : associatedElements()) { 778 for (const auto& control : associatedElements()) {
774 if (!control->isFormControlElement()) 779 if (!control->isFormControlElement())
775 continue; 780 continue;
776 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton()) 781 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton())
777 toHTMLFormControlElement(control)->pseudoStateChanged(CSSSelector::P seudoDefault); 782 toHTMLFormControlElement(control)->pseudoStateChanged(CSSSelector::P seudoDefault);
778 } 783 }
779 } 784 }
780 785
781 } // namespace blink 786 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698