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

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

Issue 605453002: Merge 182515 "Revert "Mixed Content: Make MixedContentChecker co..." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/2167/
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/fetch/ResourceFetcher.cpp ('k') | Source/core/html/HTMLPlugInElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 if (!targetFrame) { 435 if (!targetFrame) {
436 if (!LocalDOMWindow::allowPopUp(*document().frame()) && !UserGestureIndi cator::processingUserGesture()) 436 if (!LocalDOMWindow::allowPopUp(*document().frame()) && !UserGestureIndi cator::processingUserGesture())
437 return; 437 return;
438 targetFrame = document().frame(); 438 targetFrame = document().frame();
439 } else { 439 } else {
440 submission->clearTarget(); 440 submission->clearTarget();
441 } 441 }
442 if (!targetFrame->page()) 442 if (!targetFrame->page())
443 return; 443 return;
444 444
445 UseCounter::count(document(), UseCounter::FormsSubmitted); 445 if (MixedContentChecker::isMixedContent(document().securityOrigin(), submiss ion->action())) {
446 if (MixedContentChecker::checkFormAction(document().frame(), submission->act ion()))
447 UseCounter::count(document(), UseCounter::MixedContentFormsSubmitted); 446 UseCounter::count(document(), UseCounter::MixedContentFormsSubmitted);
447 if (!document().frame()->loader().mixedContentChecker()->canSubmitToInse cureForm(document().securityOrigin(), submission->action()))
448 return;
449 } else {
450 UseCounter::count(document(), UseCounter::FormsSubmitted);
451 }
448 452
449 submission->setReferrer(Referrer(document().outgoingReferrer(), document().r eferrerPolicy())); 453 submission->setReferrer(Referrer(document().outgoingReferrer(), document().r eferrerPolicy()));
450 submission->setOrigin(document().outgoingOrigin()); 454 submission->setOrigin(document().outgoingOrigin());
451 455
452 targetFrame->navigationScheduler().scheduleFormSubmission(submission); 456 targetFrame->navigationScheduler().scheduleFormSubmission(submission);
453 } 457 }
454 458
455 void HTMLFormElement::reset() 459 void HTMLFormElement::reset()
456 { 460 {
457 LocalFrame* frame = document().frame(); 461 LocalFrame* frame = document().frame();
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 m_pendingAutocompleteEventsQueue->enqueueEvent(event.release()); 515 m_pendingAutocompleteEventsQueue->enqueueEvent(event.release());
512 } 516 }
513 517
514 void HTMLFormElement::parseAttribute(const QualifiedName& name, const AtomicStri ng& value) 518 void HTMLFormElement::parseAttribute(const QualifiedName& name, const AtomicStri ng& value)
515 { 519 {
516 if (name == actionAttr) { 520 if (name == actionAttr) {
517 m_attributes.parseAction(value); 521 m_attributes.parseAction(value);
518 // If the new action attribute is pointing to insecure "action" location from a secure page 522 // If the new action attribute is pointing to insecure "action" location from a secure page
519 // it is marked as "passive" mixed content. 523 // it is marked as "passive" mixed content.
520 KURL actionURL = document().completeURL(m_attributes.action().isEmpty() ? document().url().string() : m_attributes.action()); 524 KURL actionURL = document().completeURL(m_attributes.action().isEmpty() ? document().url().string() : m_attributes.action());
521 MixedContentChecker::checkFormAction(document().frame(), actionURL); 525 if (document().frame() && MixedContentChecker::isMixedContent(document() .securityOrigin(), actionURL))
526 document().frame()->loader().mixedContentChecker()->canSubmitToInsec ureForm(document().securityOrigin(), actionURL);
522 } else if (name == targetAttr) 527 } else if (name == targetAttr)
523 m_attributes.setTarget(value); 528 m_attributes.setTarget(value);
524 else if (name == methodAttr) 529 else if (name == methodAttr)
525 m_attributes.updateMethodType(value); 530 m_attributes.updateMethodType(value);
526 else if (name == enctypeAttr) 531 else if (name == enctypeAttr)
527 m_attributes.updateEncodingType(value); 532 m_attributes.updateEncodingType(value);
528 else if (name == accept_charsetAttr) 533 else if (name == accept_charsetAttr)
529 m_attributes.setAcceptCharset(value); 534 m_attributes.setAcceptCharset(value);
530 else if (name == onautocompleteAttr) 535 else if (name == onautocompleteAttr)
531 setAttributeEventListener(EventTypeNames::autocomplete, createAttributeE ventListener(this, name, value, eventParameterName())); 536 setAttributeEventListener(EventTypeNames::autocomplete, createAttributeE ventListener(this, name, value, eventParameterName()));
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
839 } 844 }
840 845
841 void HTMLFormElement::setDemoted(bool demoted) 846 void HTMLFormElement::setDemoted(bool demoted)
842 { 847 {
843 if (demoted) 848 if (demoted)
844 UseCounter::count(document(), UseCounter::DemotedFormElement); 849 UseCounter::count(document(), UseCounter::DemotedFormElement);
845 m_wasDemoted = demoted; 850 m_wasDemoted = demoted;
846 } 851 }
847 852
848 } // namespace 853 } // namespace
OLDNEW
« no previous file with comments | « Source/core/fetch/ResourceFetcher.cpp ('k') | Source/core/html/HTMLPlugInElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698