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

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

Issue 2623513005: Introduce Element::AttributeModificationParams (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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 // structure. 469 // structure.
470 ListedElement::List elements(listedElements()); 470 ListedElement::List elements(listedElements());
471 for (const auto& element : elements) { 471 for (const auto& element : elements) {
472 if (element->isFormControlElement()) 472 if (element->isFormControlElement())
473 toHTMLFormControlElement(element)->reset(); 473 toHTMLFormControlElement(element)->reset();
474 } 474 }
475 475
476 m_isInResetFunction = false; 476 m_isInResetFunction = false;
477 } 477 }
478 478
479 void HTMLFormElement::parseAttribute(const QualifiedName& name, 479 void HTMLFormElement::parseAttribute(
480 const AtomicString& oldValue, 480 const AttributeModificationParams& params) {
481 const AtomicString& value) { 481 const QualifiedName& name = params.name;
482 if (name == actionAttr) { 482 if (name == actionAttr) {
483 m_attributes.parseAction(value); 483 m_attributes.parseAction(params.newValue);
484 logUpdateAttributeIfIsolatedWorldAndInDocument("form", actionAttr, oldValue, 484 logUpdateAttributeIfIsolatedWorldAndInDocument("form", params);
485 value);
486 485
487 // If we're not upgrading insecure requests, and the new action attribute is 486 // If we're not upgrading insecure requests, and the new action attribute is
488 // pointing to an insecure "action" location from a secure page it is marked 487 // pointing to an insecure "action" location from a secure page it is marked
489 // as "passive" mixed content. 488 // as "passive" mixed content.
490 if (document().getInsecureRequestPolicy() & kUpgradeInsecureRequests) 489 if (document().getInsecureRequestPolicy() & kUpgradeInsecureRequests)
491 return; 490 return;
492 KURL actionURL = document().completeURL(m_attributes.action().isEmpty() 491 KURL actionURL = document().completeURL(m_attributes.action().isEmpty()
493 ? document().url().getString() 492 ? document().url().getString()
494 : m_attributes.action()); 493 : m_attributes.action());
495 if (MixedContentChecker::isMixedFormAction(document().frame(), actionURL)) 494 if (MixedContentChecker::isMixedFormAction(document().frame(), actionURL))
496 UseCounter::count(document().frame(), 495 UseCounter::count(document().frame(),
497 UseCounter::MixedContentFormPresent); 496 UseCounter::MixedContentFormPresent);
498 } else if (name == targetAttr) { 497 } else if (name == targetAttr) {
499 m_attributes.setTarget(value); 498 m_attributes.setTarget(params.newValue);
500 } else if (name == methodAttr) { 499 } else if (name == methodAttr) {
501 m_attributes.updateMethodType(value); 500 m_attributes.updateMethodType(params.newValue);
502 } else if (name == enctypeAttr) { 501 } else if (name == enctypeAttr) {
503 m_attributes.updateEncodingType(value); 502 m_attributes.updateEncodingType(params.newValue);
504 } else if (name == accept_charsetAttr) { 503 } else if (name == accept_charsetAttr) {
505 m_attributes.setAcceptCharset(value); 504 m_attributes.setAcceptCharset(params.newValue);
506 } else { 505 } else {
507 HTMLElement::parseAttribute(name, oldValue, value); 506 HTMLElement::parseAttribute(params);
508 } 507 }
509 } 508 }
510 509
511 void HTMLFormElement::associate(ListedElement& e) { 510 void HTMLFormElement::associate(ListedElement& e) {
512 m_listedElementsAreDirty = true; 511 m_listedElementsAreDirty = true;
513 m_listedElements.clear(); 512 m_listedElements.clear();
514 if (toHTMLElement(e).fastHasAttribute(formAttr)) 513 if (toHTMLElement(e).fastHasAttribute(formAttr))
515 m_hasElementsAssociatedByFormAttribute = true; 514 m_hasElementsAssociatedByFormAttribute = true;
516 } 515 }
517 516
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 for (const auto& control : listedElements()) { 806 for (const auto& control : listedElements()) {
808 if (!control->isFormControlElement()) 807 if (!control->isFormControlElement())
809 continue; 808 continue;
810 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton()) 809 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton())
811 toHTMLFormControlElement(control)->pseudoStateChanged( 810 toHTMLFormControlElement(control)->pseudoStateChanged(
812 CSSSelector::PseudoDefault); 811 CSSSelector::PseudoDefault);
813 } 812 }
814 } 813 }
815 814
816 } // namespace blink 815 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLFormElement.h ('k') | third_party/WebKit/Source/core/html/HTMLFrameElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698