| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 resetFormAttributeTargetObserver(); | 88 resetFormAttributeTargetObserver(); |
| 89 } | 89 } |
| 90 | 90 |
| 91 void FormAssociatedElement::removedFrom(ContainerNode* insertionPoint) { | 91 void FormAssociatedElement::removedFrom(ContainerNode* insertionPoint) { |
| 92 HTMLElement* element = toHTMLElement(this); | 92 HTMLElement* element = toHTMLElement(this); |
| 93 if (insertionPoint->isConnected() && element->fastHasAttribute(formAttr)) { | 93 if (insertionPoint->isConnected() && element->fastHasAttribute(formAttr)) { |
| 94 setFormAttributeTargetObserver(nullptr); | 94 setFormAttributeTargetObserver(nullptr); |
| 95 resetFormOwner(); | 95 resetFormOwner(); |
| 96 return; | 96 return; |
| 97 } | 97 } |
| 98 // If the form and element are both in the same tree, preserve the connection
to the form. | 98 // If the form and element are both in the same tree, preserve the connection |
| 99 // Otherwise, null out our form and remove ourselves from the form's list of e
lements. | 99 // to the form. Otherwise, null out our form and remove ourselves from the |
| 100 // form's list of elements. |
| 100 if (m_form && | 101 if (m_form && |
| 101 NodeTraversal::highestAncestorOrSelf(*element) != | 102 NodeTraversal::highestAncestorOrSelf(*element) != |
| 102 NodeTraversal::highestAncestorOrSelf(*m_form.get())) | 103 NodeTraversal::highestAncestorOrSelf(*m_form.get())) |
| 103 resetFormOwner(); | 104 resetFormOwner(); |
| 104 } | 105 } |
| 105 | 106 |
| 106 HTMLFormElement* FormAssociatedElement::findAssociatedForm( | 107 HTMLFormElement* FormAssociatedElement::findAssociatedForm( |
| 107 const HTMLElement* element) { | 108 const HTMLElement* element) { |
| 108 const AtomicString& formId(element->fastGetAttribute(formAttr)); | 109 const AtomicString& formId(element->fastGetAttribute(formAttr)); |
| 109 // 3. If the element is reassociateable, has a form content attribute, and | 110 // 3. If the element is reassociateable, has a form content attribute, and |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 DEFINE_TRACE(FormAttributeTargetObserver) { | 320 DEFINE_TRACE(FormAttributeTargetObserver) { |
| 320 visitor->trace(m_element); | 321 visitor->trace(m_element); |
| 321 IdTargetObserver::trace(visitor); | 322 IdTargetObserver::trace(visitor); |
| 322 } | 323 } |
| 323 | 324 |
| 324 void FormAttributeTargetObserver::idTargetChanged() { | 325 void FormAttributeTargetObserver::idTargetChanged() { |
| 325 m_element->formAttributeTargetChanged(); | 326 m_element->formAttributeTargetChanged(); |
| 326 } | 327 } |
| 327 | 328 |
| 328 } // namespace blink | 329 } // namespace blink |
| OLD | NEW |