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

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

Issue 2701993002: DO NOT COMMIT: Results of running new (proposed) clang-format on Blink (Closed)
Patch Set: Created 3 years, 10 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 notifyFormRemovedFromTree(images, root); 178 notifyFormRemovedFromTree(images, root);
179 } 179 }
180 } 180 }
181 document().formController().willDeleteForm(this); 181 document().formController().willDeleteForm(this);
182 HTMLElement::removedFrom(insertionPoint); 182 HTMLElement::removedFrom(insertionPoint);
183 } 183 }
184 184
185 void HTMLFormElement::handleLocalEvents(Event& event) { 185 void HTMLFormElement::handleLocalEvents(Event& event) {
186 Node* targetNode = event.target()->toNode(); 186 Node* targetNode = event.target()->toNode();
187 if (event.eventPhase() != Event::kCapturingPhase && targetNode && 187 if (event.eventPhase() != Event::kCapturingPhase && targetNode &&
188 targetNode != this && (event.type() == EventTypeNames::submit || 188 targetNode != this &&
189 event.type() == EventTypeNames::reset)) { 189 (event.type() == EventTypeNames::submit ||
190 event.type() == EventTypeNames::reset)) {
190 event.stopPropagation(); 191 event.stopPropagation();
191 return; 192 return;
192 } 193 }
193 HTMLElement::handleLocalEvents(event); 194 HTMLElement::handleLocalEvents(event);
194 } 195 }
195 196
196 unsigned HTMLFormElement::length() const { 197 unsigned HTMLFormElement::length() const {
197 unsigned len = 0; 198 unsigned len = 0;
198 for (const auto& element : listedElements()) { 199 for (const auto& element : listedElements()) {
199 if (element->isEnumeratable()) 200 if (element->isEnumeratable())
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 // https://github.com/whatwg/html/issues/2253 295 // https://github.com/whatwg/html/issues/2253
295 for (const auto& element : listedElements()) { 296 for (const auto& element : listedElements()) {
296 if (element->isFormControlElement() && 297 if (element->isFormControlElement() &&
297 toHTMLFormControlElement(element)->blocksFormSubmission()) { 298 toHTMLFormControlElement(element)->blocksFormSubmission()) {
298 UseCounter::count(document(), 299 UseCounter::count(document(),
299 UseCounter::FormSubmittedWithUnclosedFormControl); 300 UseCounter::FormSubmittedWithUnclosedFormControl);
300 if (RuntimeEnabledFeatures::unclosedFormControlIsInvalidEnabled()) { 301 if (RuntimeEnabledFeatures::unclosedFormControlIsInvalidEnabled()) {
301 String tagName = toHTMLFormControlElement(element)->tagName(); 302 String tagName = toHTMLFormControlElement(element)->tagName();
302 document().addConsoleMessage(ConsoleMessage::create( 303 document().addConsoleMessage(ConsoleMessage::create(
303 SecurityMessageSource, ErrorMessageLevel, 304 SecurityMessageSource, ErrorMessageLevel,
304 "Form submission failed, as the <" + tagName + "> element named " 305 "Form submission failed, as the <" + tagName +
305 "'" + 306 "> element named "
307 "'" +
306 element->name() + 308 element->name() +
307 "' was implicitly closed by reaching " 309 "' was implicitly closed by reaching "
308 "the end of the file. Please add an explicit end tag " 310 "the end of the file. Please add an explicit end tag "
309 "('</" + 311 "('</" +
310 tagName + ">')")); 312 tagName + ">')"));
311 dispatchEvent(Event::create(EventTypeNames::error)); 313 dispatchEvent(Event::create(EventTypeNames::error));
312 return; 314 return;
313 } 315 }
314 } 316 }
315 } 317 }
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
829 for (const auto& control : listedElements()) { 831 for (const auto& control : listedElements()) {
830 if (!control->isFormControlElement()) 832 if (!control->isFormControlElement())
831 continue; 833 continue;
832 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton()) 834 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton())
833 toHTMLFormControlElement(control)->pseudoStateChanged( 835 toHTMLFormControlElement(control)->pseudoStateChanged(
834 CSSSelector::PseudoDefault); 836 CSSSelector::PseudoDefault);
835 } 837 }
836 } 838 }
837 839
838 } // namespace blink 840 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLElement.cpp ('k') | third_party/WebKit/Source/core/html/HTMLHRElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698