| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 return; | 92 return; |
| 93 | 93 |
| 94 HTMLElement* element = toHTMLElement(this); | 94 HTMLElement* element = toHTMLElement(this); |
| 95 if (element->fastHasAttribute(formAttr)) | 95 if (element->fastHasAttribute(formAttr)) |
| 96 resetFormAttributeTargetObserver(); | 96 resetFormAttributeTargetObserver(); |
| 97 } | 97 } |
| 98 | 98 |
| 99 void FormAssociatedElement::removedFrom(ContainerNode* insertionPoint) | 99 void FormAssociatedElement::removedFrom(ContainerNode* insertionPoint) |
| 100 { | 100 { |
| 101 HTMLElement* element = toHTMLElement(this); | 101 HTMLElement* element = toHTMLElement(this); |
| 102 if (insertionPoint->inDocument() && element->fastHasAttribute(formAttr)) | 102 if (insertionPoint->inDocument() && element->fastHasAttribute(formAttr)) { |
| 103 setFormAttributeTargetObserver(nullptr); | 103 setFormAttributeTargetObserver(nullptr); |
| 104 resetFormOwner(); |
| 105 return; |
| 106 } |
| 104 // If the form and element are both in the same tree, preserve the connectio
n to the form. | 107 // If the form and element are both in the same tree, preserve the connectio
n to the form. |
| 105 // Otherwise, null out our form and remove ourselves from the form's list of
elements. | 108 // Otherwise, null out our form and remove ourselves from the form's list of
elements. |
| 106 if (m_form && NodeTraversal::highestAncestorOrSelf(*element) != NodeTraversa
l::highestAncestorOrSelf(*m_form.get())) | 109 if (m_form && NodeTraversal::highestAncestorOrSelf(*element) != NodeTraversa
l::highestAncestorOrSelf(*m_form.get())) |
| 107 resetFormOwner(); | 110 resetFormOwner(); |
| 108 } | 111 } |
| 109 | 112 |
| 110 HTMLFormElement* FormAssociatedElement::findAssociatedForm(const HTMLElement* el
ement) | 113 HTMLFormElement* FormAssociatedElement::findAssociatedForm(const HTMLElement* el
ement) |
| 111 { | 114 { |
| 112 const AtomicString& formId(element->fastGetAttribute(formAttr)); | 115 const AtomicString& formId(element->fastGetAttribute(formAttr)); |
| 113 // 3. If the element is reassociateable, has a form content attribute, and | 116 // 3. If the element is reassociateable, has a form content attribute, and |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 visitor->trace(m_element); | 353 visitor->trace(m_element); |
| 351 IdTargetObserver::trace(visitor); | 354 IdTargetObserver::trace(visitor); |
| 352 } | 355 } |
| 353 | 356 |
| 354 void FormAttributeTargetObserver::idTargetChanged() | 357 void FormAttributeTargetObserver::idTargetChanged() |
| 355 { | 358 { |
| 356 m_element->formAttributeTargetChanged(); | 359 m_element->formAttributeTargetChanged(); |
| 357 } | 360 } |
| 358 | 361 |
| 359 } // namespace blink | 362 } // namespace blink |
| OLD | NEW |