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

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

Issue 2644633006: Add KURL::protocolIsJavascript member function (Closed)
Patch Set: Created 3 years, 11 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 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 "' because the form's frame is sandboxed and the 'allow-forms' " 426 "' because the form's frame is sandboxed and the 'allow-forms' "
427 "permission is not set.")); 427 "permission is not set."));
428 return; 428 return;
429 } 429 }
430 430
431 if (!document().contentSecurityPolicy()->allowFormAction( 431 if (!document().contentSecurityPolicy()->allowFormAction(
432 submission->action())) { 432 submission->action())) {
433 return; 433 return;
434 } 434 }
435 435
436 if (protocolIsJavaScript(submission->action())) { 436 if (submission->action().protocolIsJavaScript()) {
437 document().frame()->script().executeScriptIfJavaScriptURL( 437 document().frame()->script().executeScriptIfJavaScriptURL(
438 submission->action(), this); 438 submission->action(), this);
439 return; 439 return;
440 } 440 }
441 441
442 Frame* targetFrame = document().frame()->findFrameForNavigation( 442 Frame* targetFrame = document().frame()->findFrameForNavigation(
443 submission->target(), *document().frame()); 443 submission->target(), *document().frame());
444 if (!targetFrame) { 444 if (!targetFrame) {
445 if (!LocalDOMWindow::allowPopUp(*document().frame()) && 445 if (!LocalDOMWindow::allowPopUp(*document().frame()) &&
446 !UserGestureIndicator::utilizeUserGesture()) 446 !UserGestureIndicator::utilizeUserGesture())
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 for (const auto& control : listedElements()) { 826 for (const auto& control : listedElements()) {
827 if (!control->isFormControlElement()) 827 if (!control->isFormControlElement())
828 continue; 828 continue;
829 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton()) 829 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton())
830 toHTMLFormControlElement(control)->pseudoStateChanged( 830 toHTMLFormControlElement(control)->pseudoStateChanged(
831 CSSSelector::PseudoDefault); 831 CSSSelector::PseudoDefault);
832 } 832 }
833 } 833 }
834 834
835 } // namespace blink 835 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/Location.cpp ('k') | third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698