equal
deleted
inserted
replaced
207 } |
207 } |
208 |
208 |
209 HTMLElement::removedFromDocument(); |
209 HTMLElement::removedFromDocument(); |
210 } |
210 } |
211 |
211 |
|
212 void HTMLImageElement::insertedIntoTree(bool deep) |
|
213 { |
|
214 if (!m_form) { |
|
215 // m_form can be non-null if it was set in constructor. |
|
216 for (Node* ancestor = parentNode(); ancestor; ancestor = ancestor->parentNode()) { |
|
217 if (ancestor->hasTagName(formTag)) { |
|
218 m_form = static_cast<HTMLFormElement*>(ancestor); |
|
219 m_form->registerImgElement(this); |
|
220 break; |
|
221 } |
|
222 } |
|
223 } |
|
224 |
|
225 HTMLElement::insertedIntoTree(deep); |
|
226 } |
|
227 |
|
228 void HTMLImageElement::removedFromTree(bool deep) |
|
229 { |
|
230 if (m_form) |
|
231 m_form->removeImgElement(this); |
|
232 m_form = 0; |
|
233 HTMLElement::removedFromTree(deep); |
|
234 } |
|
235 |
212 int HTMLImageElement::width(bool ignorePendingStylesheets) const |
236 int HTMLImageElement::width(bool ignorePendingStylesheets) const |
213 { |
237 { |
214 if (!renderer()) { |
238 if (!renderer()) { |
215 // check the attribute first for an explicit pixel value |
239 // check the attribute first for an explicit pixel value |
216 bool ok; |
240 bool ok; |