| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 return isHTMLFormElement(newFormCandidate) ? toHTMLFormElement(newFormCa
ndidate) : 0; | 122 return isHTMLFormElement(newFormCandidate) ? toHTMLFormElement(newFormCa
ndidate) : 0; |
| 123 } | 123 } |
| 124 // 4. Otherwise, if the form-associated element in question has an ancestor | 124 // 4. Otherwise, if the form-associated element in question has an ancestor |
| 125 // form element, then associate the form-associated element with the nearest | 125 // form element, then associate the form-associated element with the nearest |
| 126 // such ancestor form element. | 126 // such ancestor form element. |
| 127 return element->findFormAncestor(); | 127 return element->findFormAncestor(); |
| 128 } | 128 } |
| 129 | 129 |
| 130 void FormAssociatedElement::formRemovedFromTree(const Node& formRoot) | 130 void FormAssociatedElement::formRemovedFromTree(const Node& formRoot) |
| 131 { | 131 { |
| 132 ASSERT(m_form); | 132 DCHECK(m_form); |
| 133 if (NodeTraversal::highestAncestorOrSelf(toHTMLElement(*this)) == formRoot) | 133 if (NodeTraversal::highestAncestorOrSelf(toHTMLElement(*this)) == formRoot) |
| 134 return; | 134 return; |
| 135 resetFormOwner(); | 135 resetFormOwner(); |
| 136 } | 136 } |
| 137 | 137 |
| 138 void FormAssociatedElement::associateByParser(HTMLFormElement* form) | 138 void FormAssociatedElement::associateByParser(HTMLFormElement* form) |
| 139 { | 139 { |
| 140 if (form && form->isConnected()) { | 140 if (form && form->isConnected()) { |
| 141 m_formWasSetByParser = true; | 141 m_formWasSetByParser = true; |
| 142 setForm(form); | 142 setForm(form); |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 | 308 |
| 309 const HTMLElement& toHTMLElement(const FormAssociatedElement& associatedElement) | 309 const HTMLElement& toHTMLElement(const FormAssociatedElement& associatedElement) |
| 310 { | 310 { |
| 311 if (associatedElement.isFormControlElement()) | 311 if (associatedElement.isFormControlElement()) |
| 312 return toHTMLFormControlElement(associatedElement); | 312 return toHTMLFormControlElement(associatedElement); |
| 313 return toHTMLObjectElement(associatedElement); | 313 return toHTMLObjectElement(associatedElement); |
| 314 } | 314 } |
| 315 | 315 |
| 316 const HTMLElement* toHTMLElement(const FormAssociatedElement* associatedElement) | 316 const HTMLElement* toHTMLElement(const FormAssociatedElement* associatedElement) |
| 317 { | 317 { |
| 318 ASSERT(associatedElement); | 318 DCHECK(associatedElement); |
| 319 return &toHTMLElement(*associatedElement); | 319 return &toHTMLElement(*associatedElement); |
| 320 } | 320 } |
| 321 | 321 |
| 322 HTMLElement* toHTMLElement(FormAssociatedElement* associatedElement) | 322 HTMLElement* toHTMLElement(FormAssociatedElement* associatedElement) |
| 323 { | 323 { |
| 324 return const_cast<HTMLElement*>(toHTMLElement(static_cast<const FormAssociat
edElement*>(associatedElement))); | 324 return const_cast<HTMLElement*>(toHTMLElement(static_cast<const FormAssociat
edElement*>(associatedElement))); |
| 325 } | 325 } |
| 326 | 326 |
| 327 HTMLElement& toHTMLElement(FormAssociatedElement& associatedElement) | 327 HTMLElement& toHTMLElement(FormAssociatedElement& associatedElement) |
| 328 { | 328 { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 345 visitor->trace(m_element); | 345 visitor->trace(m_element); |
| 346 IdTargetObserver::trace(visitor); | 346 IdTargetObserver::trace(visitor); |
| 347 } | 347 } |
| 348 | 348 |
| 349 void FormAttributeTargetObserver::idTargetChanged() | 349 void FormAttributeTargetObserver::idTargetChanged() |
| 350 { | 350 { |
| 351 m_element->formAttributeTargetChanged(); | 351 m_element->formAttributeTargetChanged(); |
| 352 } | 352 } |
| 353 | 353 |
| 354 } // namespace blink | 354 } // namespace blink |
| OLD | NEW |