| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 { | 112 { |
| 113 const AtomicString& formId(element->fastGetAttribute(formAttr)); | 113 const AtomicString& formId(element->fastGetAttribute(formAttr)); |
| 114 // 3. If the element is reassociateable, has a form content attribute, and | 114 // 3. If the element is reassociateable, has a form content attribute, and |
| 115 // is itself in a Document, then run these substeps: | 115 // is itself in a Document, then run these substeps: |
| 116 if (!formId.isNull() && element->inShadowIncludingDocument()) { | 116 if (!formId.isNull() && element->inShadowIncludingDocument()) { |
| 117 // 3.1. If the first element in the Document to have an ID that is | 117 // 3.1. If the first element in the Document to have an ID that is |
| 118 // case-sensitively equal to the element's form content attribute's | 118 // case-sensitively equal to the element's form content attribute's |
| 119 // value is a form element, then associate the form-associated element | 119 // value is a form element, then associate the form-associated element |
| 120 // with that form element. | 120 // with that form element. |
| 121 // 3.2. Abort the "reset the form owner" steps. | 121 // 3.2. Abort the "reset the form owner" steps. |
| 122 Element* newFormCandidate = element->treeScope().getElementById(formId); | 122 Element* newFormCandidate = element->treeScopeOrDocument().getElementByI
d(formId); |
| 123 return isHTMLFormElement(newFormCandidate) ? toHTMLFormElement(newFormCa
ndidate) : 0; | 123 return isHTMLFormElement(newFormCandidate) ? toHTMLFormElement(newFormCa
ndidate) : 0; |
| 124 } | 124 } |
| 125 // 4. Otherwise, if the form-associated element in question has an ancestor | 125 // 4. Otherwise, if the form-associated element in question has an ancestor |
| 126 // form element, then associate the form-associated element with the nearest | 126 // form element, then associate the form-associated element with the nearest |
| 127 // such ancestor form element. | 127 // such ancestor form element. |
| 128 return element->findFormAncestor(); | 128 return element->findFormAncestor(); |
| 129 } | 129 } |
| 130 | 130 |
| 131 void FormAssociatedElement::formRemovedFromTree(const Node& formRoot) | 131 void FormAssociatedElement::formRemovedFromTree(const Node& formRoot) |
| 132 { | 132 { |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 { | 335 { |
| 336 return const_cast<HTMLElement&>(toHTMLElement(static_cast<const FormAssociat
edElement&>(associatedElement))); | 336 return const_cast<HTMLElement&>(toHTMLElement(static_cast<const FormAssociat
edElement&>(associatedElement))); |
| 337 } | 337 } |
| 338 | 338 |
| 339 FormAttributeTargetObserver* FormAttributeTargetObserver::create(const AtomicStr
ing& id, FormAssociatedElement* element) | 339 FormAttributeTargetObserver* FormAttributeTargetObserver::create(const AtomicStr
ing& id, FormAssociatedElement* element) |
| 340 { | 340 { |
| 341 return new FormAttributeTargetObserver(id, element); | 341 return new FormAttributeTargetObserver(id, element); |
| 342 } | 342 } |
| 343 | 343 |
| 344 FormAttributeTargetObserver::FormAttributeTargetObserver(const AtomicString& id,
FormAssociatedElement* element) | 344 FormAttributeTargetObserver::FormAttributeTargetObserver(const AtomicString& id,
FormAssociatedElement* element) |
| 345 : IdTargetObserver(toHTMLElement(element)->treeScope().idTargetObserverRegis
try(), id) | 345 : IdTargetObserver(toHTMLElement(element)->treeScopeOrDocument().idTargetObs
erverRegistry(), id) |
| 346 , m_element(element) | 346 , m_element(element) |
| 347 { | 347 { |
| 348 } | 348 } |
| 349 | 349 |
| 350 DEFINE_TRACE(FormAttributeTargetObserver) | 350 DEFINE_TRACE(FormAttributeTargetObserver) |
| 351 { | 351 { |
| 352 visitor->trace(m_element); | 352 visitor->trace(m_element); |
| 353 IdTargetObserver::trace(visitor); | 353 IdTargetObserver::trace(visitor); |
| 354 } | 354 } |
| 355 | 355 |
| 356 void FormAttributeTargetObserver::idTargetChanged() | 356 void FormAttributeTargetObserver::idTargetChanged() |
| 357 { | 357 { |
| 358 m_element->formAttributeTargetChanged(); | 358 m_element->formAttributeTargetChanged(); |
| 359 } | 359 } |
| 360 | 360 |
| 361 } // namespace blink | 361 } // namespace blink |
| OLD | NEW |