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

Unified Diff: Source/WebCore/html/FormAssociatedElement.cpp

Issue 6476015: Merge 77114 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/648/
Patch Set: Created 9 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/html/FormAssociatedElement.h ('k') | Source/WebCore/html/HTMLFormControlElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/html/FormAssociatedElement.cpp
===================================================================
--- Source/WebCore/html/FormAssociatedElement.cpp (revision 78154)
+++ Source/WebCore/html/FormAssociatedElement.cpp (working copy)
@@ -59,11 +59,24 @@
element->document()->unregisterFormElementWithFormAttribute(this);
}
+void FormAssociatedElement::insertedIntoDocument()
+{
+ HTMLElement* element = toHTMLElement(this);
+ if (element->fastHasAttribute(formAttr))
+ element->document()->registerFormElementWithFormAttribute(this);
+}
+
+void FormAssociatedElement::removedFromDocument()
+{
+ HTMLElement* element = toHTMLElement(this);
+ if (element->fastHasAttribute(formAttr))
+ element->document()->unregisterFormElementWithFormAttribute(this);
+}
+
void FormAssociatedElement::insertedIntoTree()
{
HTMLElement* element = toHTMLElement(this);
if (element->fastHasAttribute(formAttr)) {
- element->document()->registerFormElementWithFormAttribute(this);
Element* formElement = element->document()->getElementById(element->fastGetAttribute(formAttr));
if (formElement && formElement->hasTagName(formTag)) {
if (m_form)
@@ -94,8 +107,6 @@
void FormAssociatedElement::removedFromTree()
{
HTMLElement* element = toHTMLElement(this);
- if (element->fastHasAttribute(formAttr))
- element->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.
« no previous file with comments | « Source/WebCore/html/FormAssociatedElement.h ('k') | Source/WebCore/html/HTMLFormControlElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698