Index: WebCore/html/HTMLFormControlElement.cpp |
=================================================================== |
--- WebCore/html/HTMLFormControlElement.cpp (revision 78370) |
+++ WebCore/html/HTMLFormControlElement.cpp (working copy) |
@@ -162,6 +162,7 @@ |
void HTMLFormControlElement::insertedIntoTree(bool deep) |
{ |
if (fastHasAttribute(formAttr)) { |
+ document()->registerFormElementWithFormAttribute(this); |
Element* element = document()->getElementById(fastGetAttribute(formAttr)); |
if (element && element->hasTagName(formTag)) { |
if (m_form) |
@@ -195,6 +196,9 @@ |
void HTMLFormControlElement::removedFromTree(bool deep) |
{ |
+ if (fastHasAttribute(formAttr)) |
+ document()->unregisterFormElementWithFormAttribute(this); |
+ |
// If the form and element are both in the same tree, preserve the connection to the form. |
// Otherwise, null out our form and remove ourselves from the form's list of elements. |
if (m_form && findRoot(this) != findRoot(m_form)) { |
@@ -205,18 +209,6 @@ |
HTMLElement::removedFromTree(deep); |
} |
-void HTMLFormControlElement::insertedIntoDocument() |
-{ |
- if (fastHasAttribute(formAttr)) |
- document()->registerFormElementWithFormAttribute(this); |
-} |
- |
-void HTMLFormControlElement::removedFromDocument() |
-{ |
- if (fastHasAttribute(formAttr)) |
- document()->unregisterFormElementWithFormAttribute(this); |
-} |
- |
const AtomicString& HTMLFormControlElement::formControlName() const |
{ |
const AtomicString& name = fastGetAttribute(nameAttr); |