diff options
author | Steve Block <steveblock@google.com> | 2011-02-16 13:06:58 +0000 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2011-02-16 13:10:08 +0000 |
commit | f7f6d6409be37f76dc308902285d24806dc87ef2 (patch) | |
tree | f2cb1de65a785a078cb6b0df502f22f31e56f7f4 /WebCore/html/HTMLFormControlElement.cpp | |
parent | a38cdf7feffba4f61bd533e43fcacec7418ea150 (diff) | |
download | external_webkit-f7f6d6409be37f76dc308902285d24806dc87ef2.zip external_webkit-f7f6d6409be37f76dc308902285d24806dc87ef2.tar.gz external_webkit-f7f6d6409be37f76dc308902285d24806dc87ef2.tar.bz2 |
Merge WebKit at Chromium 9.0.597.106: Initial merge by Git
Note that we are tracking the Chromium 9.0.597 release branch,
which is WebKit r72805 + stability cherry picks.
This corresponds to r78455 on the 597 release branch.
Change-Id: I72375d9b61a767449086f0c9dc4105b2a6b62ddc
Diffstat (limited to 'WebCore/html/HTMLFormControlElement.cpp')
-rw-r--r-- | WebCore/html/HTMLFormControlElement.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/WebCore/html/HTMLFormControlElement.cpp b/WebCore/html/HTMLFormControlElement.cpp index daf4b93..88b47ac 100644 --- a/WebCore/html/HTMLFormControlElement.cpp +++ b/WebCore/html/HTMLFormControlElement.cpp @@ -162,7 +162,6 @@ void HTMLFormControlElement::willMoveToNewOwnerDocument() 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) @@ -196,9 +195,6 @@ static inline Node* findRoot(Node* n) 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)) { @@ -209,6 +205,20 @@ void HTMLFormControlElement::removedFromTree(bool deep) HTMLElement::removedFromTree(deep); } +void HTMLFormControlElement::insertedIntoDocument() +{ + if (fastHasAttribute(formAttr)) + document()->registerFormElementWithFormAttribute(this); + HTMLElement::insertedIntoDocument(); +} + +void HTMLFormControlElement::removedFromDocument() +{ + if (fastHasAttribute(formAttr)) + document()->unregisterFormElementWithFormAttribute(this); + HTMLElement::removedFromDocument(); +} + const AtomicString& HTMLFormControlElement::formControlName() const { const AtomicString& name = fastGetAttribute(nameAttr); |