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 11 matching lines...) Expand all Loading... |
22 * | 22 * |
23 */ | 23 */ |
24 | 24 |
25 #include "core/html/FormAssociatedElement.h" | 25 #include "core/html/FormAssociatedElement.h" |
26 | 26 |
27 #include "core/HTMLNames.h" | 27 #include "core/HTMLNames.h" |
28 #include "core/dom/IdTargetObserver.h" | 28 #include "core/dom/IdTargetObserver.h" |
29 #include "core/dom/NodeTraversal.h" | 29 #include "core/dom/NodeTraversal.h" |
30 #include "core/html/HTMLFormControlElement.h" | 30 #include "core/html/HTMLFormControlElement.h" |
31 #include "core/html/HTMLFormElement.h" | 31 #include "core/html/HTMLFormElement.h" |
32 #include "core/html/HTMLLabelElement.h" | |
33 #include "core/html/HTMLObjectElement.h" | 32 #include "core/html/HTMLObjectElement.h" |
34 #include "core/html/ValidityState.h" | 33 #include "core/html/ValidityState.h" |
35 | 34 |
36 namespace blink { | 35 namespace blink { |
37 | 36 |
38 using namespace HTMLNames; | 37 using namespace HTMLNames; |
39 | 38 |
40 class FormAttributeTargetObserver : public IdTargetObserver { | 39 class FormAttributeTargetObserver : public IdTargetObserver { |
41 public: | 40 public: |
42 static FormAttributeTargetObserver* create(const AtomicString& id, FormAssoc
iatedElement*); | 41 static FormAttributeTargetObserver* create(const AtomicString& id, FormAssoc
iatedElement*); |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 | 303 |
305 bool FormAssociatedElement::isFormControlElementWithState() const | 304 bool FormAssociatedElement::isFormControlElementWithState() const |
306 { | 305 { |
307 return false; | 306 return false; |
308 } | 307 } |
309 | 308 |
310 const HTMLElement& toHTMLElement(const FormAssociatedElement& associatedElement) | 309 const HTMLElement& toHTMLElement(const FormAssociatedElement& associatedElement) |
311 { | 310 { |
312 if (associatedElement.isFormControlElement()) | 311 if (associatedElement.isFormControlElement()) |
313 return toHTMLFormControlElement(associatedElement); | 312 return toHTMLFormControlElement(associatedElement); |
314 if (associatedElement.isLabelElement()) | |
315 return toHTMLLabelElement(associatedElement); | |
316 return toHTMLObjectElement(associatedElement); | 313 return toHTMLObjectElement(associatedElement); |
317 } | 314 } |
318 | 315 |
319 const HTMLElement* toHTMLElement(const FormAssociatedElement* associatedElement) | 316 const HTMLElement* toHTMLElement(const FormAssociatedElement* associatedElement) |
320 { | 317 { |
321 ASSERT(associatedElement); | 318 ASSERT(associatedElement); |
322 return &toHTMLElement(*associatedElement); | 319 return &toHTMLElement(*associatedElement); |
323 } | 320 } |
324 | 321 |
325 HTMLElement* toHTMLElement(FormAssociatedElement* associatedElement) | 322 HTMLElement* toHTMLElement(FormAssociatedElement* associatedElement) |
(...skipping 22 matching lines...) Expand all Loading... |
348 visitor->trace(m_element); | 345 visitor->trace(m_element); |
349 IdTargetObserver::trace(visitor); | 346 IdTargetObserver::trace(visitor); |
350 } | 347 } |
351 | 348 |
352 void FormAttributeTargetObserver::idTargetChanged() | 349 void FormAttributeTargetObserver::idTargetChanged() |
353 { | 350 { |
354 m_element->formAttributeTargetChanged(); | 351 m_element->formAttributeTargetChanged(); |
355 } | 352 } |
356 | 353 |
357 } // namespace blink | 354 } // namespace blink |
OLD | NEW |