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

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

Issue 2405973003: M54: Revert r414590 (Closed)
Patch Set: Created 4 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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 } 333 }
334 } 334 }
335 335
336 void HTMLFormElement::submit(Event* event, HTMLFormControlElement* submitButton) 336 void HTMLFormElement::submit(Event* event, HTMLFormControlElement* submitButton)
337 { 337 {
338 FrameView* view = document().view(); 338 FrameView* view = document().view();
339 LocalFrame* frame = document().frame(); 339 LocalFrame* frame = document().frame();
340 if (!view || !frame || !frame->page()) 340 if (!view || !frame || !frame->page())
341 return; 341 return;
342 342
343 // https://html.spec.whatwg.org/multipage/forms.html#form-submission-algorit hm 343 // See crbug.com/586749.
344 // 2. If form document is not connected, has no associated browsing context,
345 // or its active sandboxing flag set has its sandboxed forms browsing
346 // context flag set, then abort these steps without doing anything.
347 if (!isConnected()) 344 if (!isConnected())
348 return; 345 UseCounter::count(document(), UseCounter::FormSubmissionNotInDocumentTre e);
349 346
350 if (m_isSubmitting) 347 if (m_isSubmitting)
351 return; 348 return;
352 349
353 // Delay dispatching 'close' to dialog until done submitting. 350 // Delay dispatching 'close' to dialog until done submitting.
354 EventQueueScope scopeForDialogClose; 351 EventQueueScope scopeForDialogClose;
355 AutoReset<bool> submitScope(&m_isSubmitting, true); 352 AutoReset<bool> submitScope(&m_isSubmitting, true);
356 353
357 if (event && !submitButton) { 354 if (event && !submitButton) {
358 // In a case of implicit submission without a submit button, 'submit' 355 // In a case of implicit submission without a submit button, 'submit'
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 { 779 {
783 for (const auto& control : associatedElements()) { 780 for (const auto& control : associatedElements()) {
784 if (!control->isFormControlElement()) 781 if (!control->isFormControlElement())
785 continue; 782 continue;
786 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton()) 783 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton())
787 toHTMLFormControlElement(control)->pseudoStateChanged(CSSSelector::P seudoDefault); 784 toHTMLFormControlElement(control)->pseudoStateChanged(CSSSelector::P seudoDefault);
788 } 785 }
789 } 786 }
790 787
791 } // namespace blink 788 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698