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

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: Fixing IWYU problem exposed by changes in FrameLoadRequest.h 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 "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
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 if (targetFrame->isLocalFrame()) {
424 if (targetFrame->isLocalFrame())
425 toLocalFrame(targetFrame)->navigationScheduler().scheduleFormSubmission( &document(), submission); 426 toLocalFrame(targetFrame)->navigationScheduler().scheduleFormSubmission( &document(), submission);
427 } else {
428 FrameLoadRequest frameLoadRequest = submission->createFrameLoadRequest(& document());
429 toRemoteFrame(targetFrame)->navigate(frameLoadRequest);
dcheng 2016/06/12 05:50:29 Crazy idea: is it possible to just call Frame::nav
Łukasz Anforowicz 2016/06/13 17:13:42 Hmmm. This does sound like something we should at
430 }
426 } 431 }
427 432
428 void HTMLFormElement::reset() 433 void HTMLFormElement::reset()
429 { 434 {
430 LocalFrame* frame = document().frame(); 435 LocalFrame* frame = document().frame();
431 if (m_isInResetFunction || !frame) 436 if (m_isInResetFunction || !frame)
432 return; 437 return;
433 438
434 m_isInResetFunction = true; 439 m_isInResetFunction = true;
435 440
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 { 781 {
777 for (const auto& control : associatedElements()) { 782 for (const auto& control : associatedElements()) {
778 if (!control->isFormControlElement()) 783 if (!control->isFormControlElement())
779 continue; 784 continue;
780 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton()) 785 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton())
781 toHTMLFormControlElement(control)->pseudoStateChanged(CSSSelector::P seudoDefault); 786 toHTMLFormControlElement(control)->pseudoStateChanged(CSSSelector::P seudoDefault);
782 } 787 }
783 } 788 }
784 789
785 } // namespace blink 790 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/RemoteFrame.cpp ('k') | third_party/WebKit/Source/core/loader/FormSubmission.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698