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

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

Issue 2050973002: UseCounter: Count form submission in orphan tree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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
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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 } 332 }
333 } 333 }
334 } 334 }
335 335
336 void HTMLFormElement::submit(Event* event, bool activateSubmitButton) 336 void HTMLFormElement::submit(Event* event, bool activateSubmitButton)
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 // See crbug.com/586749.
343 if (!inShadowIncludingDocument())
344 UseCounter::count(document(), UseCounter::FormSubmissionNotInDocumentTre e);
342 345
343 if (m_isSubmittingOrInUserJSSubmitEvent) { 346 if (m_isSubmittingOrInUserJSSubmitEvent) {
344 m_shouldSubmit = true; 347 m_shouldSubmit = true;
345 return; 348 return;
346 } 349 }
347 350
348 m_isSubmittingOrInUserJSSubmitEvent = true; 351 m_isSubmittingOrInUserJSSubmitEvent = true;
349 352
350 HTMLFormControlElement* firstSuccessfulSubmitButton = nullptr; 353 HTMLFormControlElement* firstSuccessfulSubmitButton = nullptr;
351 bool needButtonActivation = activateSubmitButton; // do we need to activate a submit button? 354 bool needButtonActivation = activateSubmitButton; // do we need to activate a submit button?
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 { 775 {
773 for (const auto& control : associatedElements()) { 776 for (const auto& control : associatedElements()) {
774 if (!control->isFormControlElement()) 777 if (!control->isFormControlElement())
775 continue; 778 continue;
776 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton()) 779 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton())
777 toHTMLFormControlElement(control)->pseudoStateChanged(CSSSelector::P seudoDefault); 780 toHTMLFormControlElement(control)->pseudoStateChanged(CSSSelector::P seudoDefault);
778 } 781 }
779 } 782 }
780 783
781 } // namespace blink 784 } // 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