OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |