| 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 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 115 |
| 116 if (!currentAssociatedForm) | 116 if (!currentAssociatedForm) |
| 117 return element->findFormAncestor(); | 117 return element->findFormAncestor(); |
| 118 | 118 |
| 119 return currentAssociatedForm; | 119 return currentAssociatedForm; |
| 120 } | 120 } |
| 121 | 121 |
| 122 void FormAssociatedElement::formRemovedFromTree(const Node* formRoot) | 122 void FormAssociatedElement::formRemovedFromTree(const Node* formRoot) |
| 123 { | 123 { |
| 124 ASSERT(m_form); | 124 ASSERT(m_form); |
| 125 if (toHTMLElement(this)->highestAncestor() != formRoot) | 125 if (toHTMLElement(this)->highestAncestor() == formRoot) |
| 126 setForm(0); | 126 return; |
| 127 RefPtr<HTMLElement> protector(toHTMLElement(this)); |
| 128 setForm(0); |
| 127 } | 129 } |
| 128 | 130 |
| 129 void FormAssociatedElement::setForm(HTMLFormElement* newForm) | 131 void FormAssociatedElement::setForm(HTMLFormElement* newForm) |
| 130 { | 132 { |
| 131 if (m_form == newForm) | 133 if (m_form == newForm) |
| 132 return; | 134 return; |
| 133 willChangeForm(); | 135 willChangeForm(); |
| 134 if (m_form) | 136 if (m_form) |
| 135 m_form->removeFormElement(this); | 137 m_form->removeFormElement(this); |
| 136 m_form = newForm; | 138 m_form = newForm; |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 , m_element(element) | 299 , m_element(element) |
| 298 { | 300 { |
| 299 } | 301 } |
| 300 | 302 |
| 301 void FormAttributeTargetObserver::idTargetChanged() | 303 void FormAttributeTargetObserver::idTargetChanged() |
| 302 { | 304 { |
| 303 m_element->formAttributeTargetChanged(); | 305 m_element->formAttributeTargetChanged(); |
| 304 } | 306 } |
| 305 | 307 |
| 306 } // namespace Webcore | 308 } // namespace Webcore |
| OLD | NEW |