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

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

Issue 2040133003: Replace SecurityContext::InsecureRequestsPolicy with WebInsecureRequestPolicy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@combine-uir-block
Patch Set: Ugh. 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 #include "core/html/HTMLInputElement.h" 45 #include "core/html/HTMLInputElement.h"
46 #include "core/html/HTMLObjectElement.h" 46 #include "core/html/HTMLObjectElement.h"
47 #include "core/html/RadioNodeList.h" 47 #include "core/html/RadioNodeList.h"
48 #include "core/html/forms/FormController.h" 48 #include "core/html/forms/FormController.h"
49 #include "core/inspector/ConsoleMessage.h" 49 #include "core/inspector/ConsoleMessage.h"
50 #include "core/loader/FrameLoader.h" 50 #include "core/loader/FrameLoader.h"
51 #include "core/loader/FrameLoaderClient.h" 51 #include "core/loader/FrameLoaderClient.h"
52 #include "core/loader/MixedContentChecker.h" 52 #include "core/loader/MixedContentChecker.h"
53 #include "core/loader/NavigationScheduler.h" 53 #include "core/loader/NavigationScheduler.h"
54 #include "platform/UserGestureIndicator.h" 54 #include "platform/UserGestureIndicator.h"
55 #include "public/platform/WebInsecureRequestPolicy.h"
55 #include "wtf/text/AtomicString.h" 56 #include "wtf/text/AtomicString.h"
56 #include <limits> 57 #include <limits>
57 58
58 namespace blink { 59 namespace blink {
59 60
60 using namespace HTMLNames; 61 using namespace HTMLNames;
61 62
62 HTMLFormElement::HTMLFormElement(Document& document) 63 HTMLFormElement::HTMLFormElement(Document& document)
63 : HTMLElement(formTag, document) 64 : HTMLElement(formTag, document)
64 , m_associatedElementsAreDirty(false) 65 , m_associatedElementsAreDirty(false)
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 443
443 m_isInResetFunction = false; 444 m_isInResetFunction = false;
444 } 445 }
445 446
446 void HTMLFormElement::parseAttribute(const QualifiedName& name, const AtomicStri ng& oldValue, const AtomicString& value) 447 void HTMLFormElement::parseAttribute(const QualifiedName& name, const AtomicStri ng& oldValue, const AtomicString& value)
447 { 448 {
448 if (name == actionAttr) { 449 if (name == actionAttr) {
449 m_attributes.parseAction(value); 450 m_attributes.parseAction(value);
450 logUpdateAttributeIfIsolatedWorldAndInDocument("form", actionAttr, oldVa lue, value); 451 logUpdateAttributeIfIsolatedWorldAndInDocument("form", actionAttr, oldVa lue, value);
451 452
452 if (document().getInsecureRequestsPolicy() != SecurityContext::InsecureR equestsUpgrade) { 453 // If we're not upgrading insecure requests, and the new action attribut e is pointing to
453 // If we're not upgrading insecure requests, and the new action attr ibute is pointing to 454 // an insecure "action" location from a secure page it is marked as "pas sive" mixed content.
454 // an insecure "action" location from a secure page it is marked as "passive" mixed content. 455 if (document().getInsecureRequestPolicy() & kUpgradeInsecureRequests)
455 KURL actionURL = document().completeURL(m_attributes.action().isEmpt y() ? document().url().getString() : m_attributes.action()); 456 return;
456 if (MixedContentChecker::isMixedFormAction(document().frame(), actio nURL)) 457 KURL actionURL = document().completeURL(m_attributes.action().isEmpty() ? document().url().getString() : m_attributes.action());
457 UseCounter::count(document().frame(), UseCounter::MixedContentFo rmPresent); 458 if (MixedContentChecker::isMixedFormAction(document().frame(), actionURL ))
458 } 459 UseCounter::count(document().frame(), UseCounter::MixedContentFormPr esent);
459 } else if (name == targetAttr) { 460 } else if (name == targetAttr) {
460 m_attributes.setTarget(value); 461 m_attributes.setTarget(value);
461 } else if (name == methodAttr) { 462 } else if (name == methodAttr) {
462 m_attributes.updateMethodType(value); 463 m_attributes.updateMethodType(value);
463 } else if (name == enctypeAttr) { 464 } else if (name == enctypeAttr) {
464 m_attributes.updateEncodingType(value); 465 m_attributes.updateEncodingType(value);
465 } else if (name == accept_charsetAttr) { 466 } else if (name == accept_charsetAttr) {
466 m_attributes.setAcceptCharset(value); 467 m_attributes.setAcceptCharset(value);
467 } else { 468 } else {
468 HTMLElement::parseAttribute(name, oldValue, value); 469 HTMLElement::parseAttribute(name, oldValue, value);
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 { 773 {
773 for (const auto& control : associatedElements()) { 774 for (const auto& control : associatedElements()) {
774 if (!control->isFormControlElement()) 775 if (!control->isFormControlElement())
775 continue; 776 continue;
776 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton()) 777 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton())
777 toHTMLFormControlElement(control)->pseudoStateChanged(CSSSelector::P seudoDefault); 778 toHTMLFormControlElement(control)->pseudoStateChanged(CSSSelector::P seudoDefault);
778 } 779 }
779 } 780 }
780 781
781 } // namespace blink 782 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698