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

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

Issue 2421473004: CSP: Fire 'SecurityPolicyViolation' on the offending element. (Closed)
Patch Set: Test. Created 4 years, 2 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 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 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 "' because the form's frame is sandboxed and the 'allow-forms' " 407 "' because the form's frame is sandboxed and the 'allow-forms' "
408 "permission is not set.")); 408 "permission is not set."));
409 return; 409 return;
410 } 410 }
411 411
412 if (protocolIsJavaScript(submission->action())) { 412 if (protocolIsJavaScript(submission->action())) {
413 if (!document().contentSecurityPolicy()->allowFormAction( 413 if (!document().contentSecurityPolicy()->allowFormAction(
414 submission->action())) 414 submission->action()))
415 return; 415 return;
416 document().frame()->script().executeScriptIfJavaScriptURL( 416 document().frame()->script().executeScriptIfJavaScriptURL(
417 submission->action()); 417 submission->action(), this);
418 return; 418 return;
419 } 419 }
420 420
421 Frame* targetFrame = document().frame()->findFrameForNavigation( 421 Frame* targetFrame = document().frame()->findFrameForNavigation(
422 submission->target(), *document().frame()); 422 submission->target(), *document().frame());
423 if (!targetFrame) { 423 if (!targetFrame) {
424 if (!LocalDOMWindow::allowPopUp(*document().frame()) && 424 if (!LocalDOMWindow::allowPopUp(*document().frame()) &&
425 !UserGestureIndicator::utilizeUserGesture()) 425 !UserGestureIndicator::utilizeUserGesture())
426 return; 426 return;
427 targetFrame = document().frame(); 427 targetFrame = document().frame();
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 for (const auto& control : associatedElements()) { 806 for (const auto& control : associatedElements()) {
807 if (!control->isFormControlElement()) 807 if (!control->isFormControlElement())
808 continue; 808 continue;
809 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton()) 809 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton())
810 toHTMLFormControlElement(control)->pseudoStateChanged( 810 toHTMLFormControlElement(control)->pseudoStateChanged(
811 CSSSelector::PseudoDefault); 811 CSSSelector::PseudoDefault);
812 } 812 }
813 } 813 }
814 814
815 } // namespace blink 815 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698