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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 { | 101 { |
102 const AtomicString& formId(element->fastGetAttribute(formAttr)); | 102 const AtomicString& formId(element->fastGetAttribute(formAttr)); |
103 // 3. If the element is reassociateable, has a form content attribute, and | 103 // 3. If the element is reassociateable, has a form content attribute, and |
104 // is itself in a Document, then run these substeps: | 104 // is itself in a Document, then run these substeps: |
105 if (!formId.isNull() && element->inDocument()) { | 105 if (!formId.isNull() && element->inDocument()) { |
106 // 3.1. If the first element in the Document to have an ID that is | 106 // 3.1. If the first element in the Document to have an ID that is |
107 // case-sensitively equal to the element's form content attribute's | 107 // case-sensitively equal to the element's form content attribute's |
108 // value is a form element, then associate the form-associated element | 108 // value is a form element, then associate the form-associated element |
109 // with that form element. | 109 // with that form element. |
110 // 3.2. Abort the "reset the form owner" steps. | 110 // 3.2. Abort the "reset the form owner" steps. |
111 HTMLFormElement* newForm = 0; | |
112 Element* newFormCandidate = element->treeScope().getElementById(formId); | 111 Element* newFormCandidate = element->treeScope().getElementById(formId); |
113 if (newFormCandidate && newFormCandidate->hasTagName(formTag)) | 112 return isHTMLFormElement(newFormCandidate) ? toHTMLFormElement(newFormCa
ndidate) : 0; |
114 newForm = toHTMLFormElement(newFormCandidate); | |
115 return newForm; | |
116 } | 113 } |
117 // 4. Otherwise, if the form-associated element in question has an ancestor | 114 // 4. Otherwise, if the form-associated element in question has an ancestor |
118 // form element, then associate the form-associated element with the nearest | 115 // form element, then associate the form-associated element with the nearest |
119 // such ancestor form element. | 116 // such ancestor form element. |
120 return element->findFormAncestor(); | 117 return element->findFormAncestor(); |
121 } | 118 } |
122 | 119 |
123 void FormAssociatedElement::formRemovedFromTree(const Node& formRoot) | 120 void FormAssociatedElement::formRemovedFromTree(const Node& formRoot) |
124 { | 121 { |
125 ASSERT(m_form); | 122 ASSERT(m_form); |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 , m_element(element) | 313 , m_element(element) |
317 { | 314 { |
318 } | 315 } |
319 | 316 |
320 void FormAttributeTargetObserver::idTargetChanged() | 317 void FormAttributeTargetObserver::idTargetChanged() |
321 { | 318 { |
322 m_element->formAttributeTargetChanged(); | 319 m_element->formAttributeTargetChanged(); |
323 } | 320 } |
324 | 321 |
325 } // namespace Webcore | 322 } // namespace Webcore |
OLD | NEW |