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

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

Issue 638253002: Revert "Mixed Content: Use a static method to check form actions." (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
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
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 // FIXME: Once we have a better feel for what the numbers are here, we c an decide
448 // whether we want to do more than degrade the UI (which is a side-effec t of
449 // checkFormAction.
450 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 } 451 }
452 452
453 targetFrame->navigationScheduler().scheduleFormSubmission(submission); 453 targetFrame->navigationScheduler().scheduleFormSubmission(submission);
454 } 454 }
455 455
456 void HTMLFormElement::reset() 456 void HTMLFormElement::reset()
457 { 457 {
458 LocalFrame* frame = document().frame(); 458 LocalFrame* frame = document().frame();
459 if (m_isInResetFunction || !frame) 459 if (m_isInResetFunction || !frame)
460 return; 460 return;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 m_pendingAutocompleteEventsQueue->enqueueEvent(event.release()); 512 m_pendingAutocompleteEventsQueue->enqueueEvent(event.release());
513 } 513 }
514 514
515 void HTMLFormElement::parseAttribute(const QualifiedName& name, const AtomicStri ng& value) 515 void HTMLFormElement::parseAttribute(const QualifiedName& name, const AtomicStri ng& value)
516 { 516 {
517 if (name == actionAttr) { 517 if (name == actionAttr) {
518 m_attributes.parseAction(value); 518 m_attributes.parseAction(value);
519 // If the new action attribute is pointing to insecure "action" location from a secure page 519 // If the new action attribute is pointing to insecure "action" location from a secure page
520 // it is marked as "passive" mixed content. 520 // it is marked as "passive" mixed content.
521 KURL actionURL = document().completeURL(m_attributes.action().isEmpty() ? document().url().string() : m_attributes.action()); 521 KURL actionURL = document().completeURL(m_attributes.action().isEmpty() ? document().url().string() : m_attributes.action());
522 MixedContentChecker::checkFormAction(document().frame(), actionURL); 522 if (document().frame() && MixedContentChecker::isMixedContent(document() .securityOrigin(), actionURL))
523 document().frame()->loader().mixedContentChecker()->canSubmitToInsec ureForm(document().securityOrigin(), actionURL);
523 } else if (name == targetAttr) 524 } else if (name == targetAttr)
524 m_attributes.setTarget(value); 525 m_attributes.setTarget(value);
525 else if (name == methodAttr) 526 else if (name == methodAttr)
526 m_attributes.updateMethodType(value); 527 m_attributes.updateMethodType(value);
527 else if (name == enctypeAttr) 528 else if (name == enctypeAttr)
528 m_attributes.updateEncodingType(value); 529 m_attributes.updateEncodingType(value);
529 else if (name == accept_charsetAttr) 530 else if (name == accept_charsetAttr)
530 m_attributes.setAcceptCharset(value); 531 m_attributes.setAcceptCharset(value);
531 else if (name == onautocompleteAttr) 532 else if (name == onautocompleteAttr)
532 setAttributeEventListener(EventTypeNames::autocomplete, createAttributeE ventListener(this, name, value, eventParameterName())); 533 setAttributeEventListener(EventTypeNames::autocomplete, createAttributeE ventListener(this, name, value, eventParameterName()));
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 } 841 }
841 842
842 void HTMLFormElement::setDemoted(bool demoted) 843 void HTMLFormElement::setDemoted(bool demoted)
843 { 844 {
844 if (demoted) 845 if (demoted)
845 UseCounter::count(document(), UseCounter::DemotedFormElement); 846 UseCounter::count(document(), UseCounter::DemotedFormElement);
846 m_wasDemoted = demoted; 847 m_wasDemoted = demoted;
847 } 848 }
848 849
849 } // namespace 850 } // namespace
OLDNEW
« no previous file with comments | « Source/core/fetch/ResourceFetcher.cpp ('k') | Source/core/html/parser/HTMLResourcePreloader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698