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

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

Issue 23886003: Have HTMLElements / SVGElements constructors take a Document reference in argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Another Android build fix Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/HTMLFormElement.h ('k') | Source/core/html/HTMLFrameElement.h » ('j') | 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 #include "core/page/Frame.h" 49 #include "core/page/Frame.h"
50 #include "core/page/UseCounter.h" 50 #include "core/page/UseCounter.h"
51 #include "core/rendering/RenderTextControl.h" 51 #include "core/rendering/RenderTextControl.h"
52 52
53 using namespace std; 53 using namespace std;
54 54
55 namespace WebCore { 55 namespace WebCore {
56 56
57 using namespace HTMLNames; 57 using namespace HTMLNames;
58 58
59 HTMLFormElement::HTMLFormElement(const QualifiedName& tagName, Document* documen t) 59 HTMLFormElement::HTMLFormElement(const QualifiedName& tagName, Document& documen t)
60 : HTMLElement(tagName, document) 60 : HTMLElement(tagName, document)
61 , m_associatedElementsBeforeIndex(0) 61 , m_associatedElementsBeforeIndex(0)
62 , m_associatedElementsAfterIndex(0) 62 , m_associatedElementsAfterIndex(0)
63 , m_wasUserSubmitted(false) 63 , m_wasUserSubmitted(false)
64 , m_isSubmittingOrPreparingForSubmission(false) 64 , m_isSubmittingOrPreparingForSubmission(false)
65 , m_shouldSubmit(false) 65 , m_shouldSubmit(false)
66 , m_isInResetFunction(false) 66 , m_isInResetFunction(false)
67 , m_wasDemoted(false) 67 , m_wasDemoted(false)
68 , m_requestAutocompleteTimer(this, &HTMLFormElement::requestAutocompleteTime rFired) 68 , m_requestAutocompleteTimer(this, &HTMLFormElement::requestAutocompleteTime rFired)
69 { 69 {
70 ASSERT(hasTagName(formTag)); 70 ASSERT(hasTagName(formTag));
71 ScriptWrappable::init(this); 71 ScriptWrappable::init(this);
72 } 72 }
73 73
74 PassRefPtr<HTMLFormElement> HTMLFormElement::create(Document* document) 74 PassRefPtr<HTMLFormElement> HTMLFormElement::create(Document& document)
75 { 75 {
76 UseCounter::count(document, UseCounter::FormElement); 76 UseCounter::count(&document, UseCounter::FormElement);
77 return adoptRef(new HTMLFormElement(formTag, document)); 77 return adoptRef(new HTMLFormElement(formTag, document));
78 } 78 }
79 79
80 PassRefPtr<HTMLFormElement> HTMLFormElement::create(const QualifiedName& tagName , Document* document) 80 PassRefPtr<HTMLFormElement> HTMLFormElement::create(const QualifiedName& tagName , Document& document)
81 { 81 {
82 UseCounter::count(document, UseCounter::FormElement); 82 UseCounter::count(&document, UseCounter::FormElement);
83 return adoptRef(new HTMLFormElement(tagName, document)); 83 return adoptRef(new HTMLFormElement(tagName, document));
84 } 84 }
85 85
86 HTMLFormElement::~HTMLFormElement() 86 HTMLFormElement::~HTMLFormElement()
87 { 87 {
88 document().formController()->willDeleteForm(this); 88 document().formController()->willDeleteForm(this);
89 89
90 for (unsigned i = 0; i < m_associatedElements.size(); ++i) 90 for (unsigned i = 0; i < m_associatedElements.size(); ++i)
91 m_associatedElements[i]->formWillBeDestroyed(); 91 m_associatedElements[i]->formWillBeDestroyed();
92 for (unsigned i = 0; i < m_imageElements.size(); ++i) 92 for (unsigned i = 0; i < m_imageElements.size(); ++i)
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 } 757 }
758 758
759 void HTMLFormElement::setDemoted(bool demoted) 759 void HTMLFormElement::setDemoted(bool demoted)
760 { 760 {
761 if (demoted) 761 if (demoted)
762 UseCounter::count(&document(), UseCounter::DemotedFormElement); 762 UseCounter::count(&document(), UseCounter::DemotedFormElement);
763 m_wasDemoted = demoted; 763 m_wasDemoted = demoted;
764 } 764 }
765 765
766 } // namespace 766 } // namespace
OLDNEW
« no previous file with comments | « Source/core/html/HTMLFormElement.h ('k') | Source/core/html/HTMLFrameElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698