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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 m_form = 0; | 156 m_form = 0; |
157 didChangeForm(); | 157 didChangeForm(); |
158 } | 158 } |
159 | 159 |
160 void FormAssociatedElement::resetFormOwner() | 160 void FormAssociatedElement::resetFormOwner() |
161 { | 161 { |
162 HTMLFormElement* originalForm = m_form; | 162 HTMLFormElement* originalForm = m_form; |
163 setForm(findAssociatedForm(toHTMLElement(this), m_form)); | 163 setForm(findAssociatedForm(toHTMLElement(this), m_form)); |
164 HTMLElement* element = toHTMLElement(this); | 164 HTMLElement* element = toHTMLElement(this); |
165 if (m_form && m_form != originalForm && m_form->inDocument()) | 165 if (m_form && m_form != originalForm && m_form->inDocument()) |
166 element->document()->didAssociateFormControl(element); | 166 element->document().didAssociateFormControl(element); |
167 } | 167 } |
168 | 168 |
169 void FormAssociatedElement::formAttributeChanged() | 169 void FormAssociatedElement::formAttributeChanged() |
170 { | 170 { |
171 HTMLElement* element = toHTMLElement(this); | 171 HTMLElement* element = toHTMLElement(this); |
172 if (!element->fastHasAttribute(formAttr)) { | 172 if (!element->fastHasAttribute(formAttr)) { |
173 // The form attribute removed. We need to reset form owner here. | 173 // The form attribute removed. We need to reset form owner here. |
174 HTMLFormElement* originalForm = m_form; | 174 HTMLFormElement* originalForm = m_form; |
175 setForm(element->findFormAncestor()); | 175 setForm(element->findFormAncestor()); |
176 HTMLElement* element = toHTMLElement(this); | 176 HTMLElement* element = toHTMLElement(this); |
177 if (m_form && m_form != originalForm && m_form->inDocument()) | 177 if (m_form && m_form != originalForm && m_form->inDocument()) |
178 element->document()->didAssociateFormControl(element); | 178 element->document().didAssociateFormControl(element); |
179 m_formAttributeTargetObserver = nullptr; | 179 m_formAttributeTargetObserver = nullptr; |
180 } else { | 180 } else { |
181 resetFormOwner(); | 181 resetFormOwner(); |
182 if (element->inDocument()) | 182 if (element->inDocument()) |
183 resetFormAttributeTargetObserver(); | 183 resetFormAttributeTargetObserver(); |
184 } | 184 } |
185 } | 185 } |
186 | 186 |
187 bool FormAssociatedElement::customError() const | 187 bool FormAssociatedElement::customError() const |
188 { | 188 { |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 , m_element(element) | 299 , m_element(element) |
300 { | 300 { |
301 } | 301 } |
302 | 302 |
303 void FormAttributeTargetObserver::idTargetChanged() | 303 void FormAttributeTargetObserver::idTargetChanged() |
304 { | 304 { |
305 m_element->formAttributeTargetChanged(); | 305 m_element->formAttributeTargetChanged(); |
306 } | 306 } |
307 | 307 |
308 } // namespace Webcore | 308 } // namespace Webcore |
OLD | NEW |