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

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

Issue 2057013002: Merge "UseCounter: Count form submission in orphan tree." to M52 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 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
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | no next file » | 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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 } 333 }
334 } 334 }
335 } 335 }
336 336
337 void HTMLFormElement::submit(Event* event, bool activateSubmitButton) 337 void HTMLFormElement::submit(Event* event, bool activateSubmitButton)
338 { 338 {
339 FrameView* view = document().view(); 339 FrameView* view = document().view();
340 LocalFrame* frame = document().frame(); 340 LocalFrame* frame = document().frame();
341 if (!view || !frame || !frame->page()) 341 if (!view || !frame || !frame->page())
342 return; 342 return;
343 // See crbug.com/586749.
344 if (!inShadowIncludingDocument())
345 UseCounter::count(document(), UseCounter::FormSubmissionNotInDocumentTre e);
343 346
344 if (m_isSubmittingOrInUserJSSubmitEvent) { 347 if (m_isSubmittingOrInUserJSSubmitEvent) {
345 m_shouldSubmit = true; 348 m_shouldSubmit = true;
346 return; 349 return;
347 } 350 }
348 351
349 m_isSubmittingOrInUserJSSubmitEvent = true; 352 m_isSubmittingOrInUserJSSubmitEvent = true;
350 353
351 HTMLFormControlElement* firstSuccessfulSubmitButton = nullptr; 354 HTMLFormControlElement* firstSuccessfulSubmitButton = nullptr;
352 bool needButtonActivation = activateSubmitButton; // do we need to activate a submit button? 355 bool needButtonActivation = activateSubmitButton; // do we need to activate a submit button?
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 { 776 {
774 for (const auto& control : associatedElements()) { 777 for (const auto& control : associatedElements()) {
775 if (!control->isFormControlElement()) 778 if (!control->isFormControlElement())
776 continue; 779 continue;
777 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton()) 780 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton())
778 toHTMLFormControlElement(control)->pseudoStateChanged(CSSSelector::P seudoDefault); 781 toHTMLFormControlElement(control)->pseudoStateChanged(CSSSelector::P seudoDefault);
779 } 782 }
780 } 783 }
781 784
782 } // namespace blink 785 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698