| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 #include "core/frame/UseCounter.h" | 53 #include "core/frame/UseCounter.h" |
| 54 #include "core/rendering/RenderTextControl.h" | 54 #include "core/rendering/RenderTextControl.h" |
| 55 #include "platform/UserGestureIndicator.h" | 55 #include "platform/UserGestureIndicator.h" |
| 56 | 56 |
| 57 using namespace std; | 57 using namespace std; |
| 58 | 58 |
| 59 namespace WebCore { | 59 namespace WebCore { |
| 60 | 60 |
| 61 using namespace HTMLNames; | 61 using namespace HTMLNames; |
| 62 | 62 |
| 63 HTMLFormElement::HTMLFormElement(const QualifiedName& tagName, Document& documen
t) | 63 HTMLFormElement::HTMLFormElement(Document& document) |
| 64 : HTMLElement(tagName, document) | 64 : HTMLElement(formTag, document) |
| 65 , m_associatedElementsBeforeIndex(0) | 65 , m_associatedElementsBeforeIndex(0) |
| 66 , m_associatedElementsAfterIndex(0) | 66 , m_associatedElementsAfterIndex(0) |
| 67 , m_wasUserSubmitted(false) | 67 , m_wasUserSubmitted(false) |
| 68 , m_isSubmittingOrPreparingForSubmission(false) | 68 , m_isSubmittingOrPreparingForSubmission(false) |
| 69 , m_shouldSubmit(false) | 69 , m_shouldSubmit(false) |
| 70 , m_isInResetFunction(false) | 70 , m_isInResetFunction(false) |
| 71 , m_wasDemoted(false) | 71 , m_wasDemoted(false) |
| 72 , m_requestAutocompleteTimer(this, &HTMLFormElement::requestAutocompleteTime
rFired) | 72 , m_requestAutocompleteTimer(this, &HTMLFormElement::requestAutocompleteTime
rFired) |
| 73 { | 73 { |
| 74 ASSERT(hasTagName(formTag)); | |
| 75 ScriptWrappable::init(this); | 74 ScriptWrappable::init(this); |
| 76 } | 75 } |
| 77 | 76 |
| 78 PassRefPtr<HTMLFormElement> HTMLFormElement::create(Document& document) | 77 PassRefPtr<HTMLFormElement> HTMLFormElement::create(Document& document) |
| 79 { | 78 { |
| 80 UseCounter::count(document, UseCounter::FormElement); | 79 UseCounter::count(document, UseCounter::FormElement); |
| 81 return adoptRef(new HTMLFormElement(formTag, document)); | 80 return adoptRef(new HTMLFormElement(document)); |
| 82 } | |
| 83 | |
| 84 PassRefPtr<HTMLFormElement> HTMLFormElement::create(const QualifiedName& tagName
, Document& document) | |
| 85 { | |
| 86 UseCounter::count(document, UseCounter::FormElement); | |
| 87 return adoptRef(new HTMLFormElement(tagName, document)); | |
| 88 } | 81 } |
| 89 | 82 |
| 90 HTMLFormElement::~HTMLFormElement() | 83 HTMLFormElement::~HTMLFormElement() |
| 91 { | 84 { |
| 92 document().formController()->willDeleteForm(this); | 85 document().formController()->willDeleteForm(this); |
| 93 | 86 |
| 94 for (unsigned i = 0; i < m_associatedElements.size(); ++i) | 87 for (unsigned i = 0; i < m_associatedElements.size(); ++i) |
| 95 m_associatedElements[i]->formWillBeDestroyed(); | 88 m_associatedElements[i]->formWillBeDestroyed(); |
| 96 for (unsigned i = 0; i < m_imageElements.size(); ++i) | 89 for (unsigned i = 0; i < m_imageElements.size(); ++i) |
| 97 m_imageElements[i]->m_form = 0; | 90 m_imageElements[i]->m_form = 0; |
| (...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 821 } | 814 } |
| 822 | 815 |
| 823 void HTMLFormElement::setDemoted(bool demoted) | 816 void HTMLFormElement::setDemoted(bool demoted) |
| 824 { | 817 { |
| 825 if (demoted) | 818 if (demoted) |
| 826 UseCounter::count(document(), UseCounter::DemotedFormElement); | 819 UseCounter::count(document(), UseCounter::DemotedFormElement); |
| 827 m_wasDemoted = demoted; | 820 m_wasDemoted = demoted; |
| 828 } | 821 } |
| 829 | 822 |
| 830 } // namespace | 823 } // namespace |
| OLD | NEW |