| 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 20 matching lines...) Expand all Loading... |
| 31 #include "core/html/HTMLFormElement.h" | 31 #include "core/html/HTMLFormElement.h" |
| 32 #include "core/html/HTMLLabelElement.h" | 32 #include "core/html/HTMLLabelElement.h" |
| 33 #include "core/html/HTMLObjectElement.h" | 33 #include "core/html/HTMLObjectElement.h" |
| 34 #include "core/html/ValidityState.h" | 34 #include "core/html/ValidityState.h" |
| 35 | 35 |
| 36 namespace blink { | 36 namespace blink { |
| 37 | 37 |
| 38 using namespace HTMLNames; | 38 using namespace HTMLNames; |
| 39 | 39 |
| 40 class FormAttributeTargetObserver : public IdTargetObserver { | 40 class FormAttributeTargetObserver : public IdTargetObserver { |
| 41 USING_FAST_MALLOC_WILL_BE_REMOVED(FormAttributeTargetObserver); | |
| 42 public: | 41 public: |
| 43 static PassOwnPtrWillBeRawPtr<FormAttributeTargetObserver> create(const Atom
icString& id, FormAssociatedElement*); | 42 static RawPtr<FormAttributeTargetObserver> create(const AtomicString& id, Fo
rmAssociatedElement*); |
| 44 DECLARE_VIRTUAL_TRACE(); | 43 DECLARE_VIRTUAL_TRACE(); |
| 45 void idTargetChanged() override; | 44 void idTargetChanged() override; |
| 46 | 45 |
| 47 private: | 46 private: |
| 48 FormAttributeTargetObserver(const AtomicString& id, FormAssociatedElement*); | 47 FormAttributeTargetObserver(const AtomicString& id, FormAssociatedElement*); |
| 49 | 48 |
| 50 RawPtrWillBeMember<FormAssociatedElement> m_element; | 49 Member<FormAssociatedElement> m_element; |
| 51 }; | 50 }; |
| 52 | 51 |
| 53 FormAssociatedElement::FormAssociatedElement() | 52 FormAssociatedElement::FormAssociatedElement() |
| 54 : m_formWasSetByParser(false) | 53 : m_formWasSetByParser(false) |
| 55 { | 54 { |
| 56 } | 55 } |
| 57 | 56 |
| 58 FormAssociatedElement::~FormAssociatedElement() | 57 FormAssociatedElement::~FormAssociatedElement() |
| 59 { | 58 { |
| 60 // We can't call setForm here because it contains virtual calls. | 59 // We can't call setForm here because it contains virtual calls. |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 String FormAssociatedElement::validationSubMessage() const | 271 String FormAssociatedElement::validationSubMessage() const |
| 273 { | 272 { |
| 274 return String(); | 273 return String(); |
| 275 } | 274 } |
| 276 | 275 |
| 277 void FormAssociatedElement::setCustomValidity(const String& error) | 276 void FormAssociatedElement::setCustomValidity(const String& error) |
| 278 { | 277 { |
| 279 m_customValidationMessage = error; | 278 m_customValidationMessage = error; |
| 280 } | 279 } |
| 281 | 280 |
| 282 void FormAssociatedElement::setFormAttributeTargetObserver(PassOwnPtrWillBeRawPt
r<FormAttributeTargetObserver> newObserver) | 281 void FormAssociatedElement::setFormAttributeTargetObserver(RawPtr<FormAttributeT
argetObserver> newObserver) |
| 283 { | 282 { |
| 284 if (m_formAttributeTargetObserver) | 283 if (m_formAttributeTargetObserver) |
| 285 m_formAttributeTargetObserver->unregister(); | 284 m_formAttributeTargetObserver->unregister(); |
| 286 m_formAttributeTargetObserver = newObserver; | 285 m_formAttributeTargetObserver = newObserver; |
| 287 } | 286 } |
| 288 | 287 |
| 289 void FormAssociatedElement::resetFormAttributeTargetObserver() | 288 void FormAssociatedElement::resetFormAttributeTargetObserver() |
| 290 { | 289 { |
| 291 HTMLElement* element = toHTMLElement(this); | 290 HTMLElement* element = toHTMLElement(this); |
| 292 const AtomicString& formId(element->fastGetAttribute(formAttr)); | 291 const AtomicString& formId(element->fastGetAttribute(formAttr)); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 HTMLElement* toHTMLElement(FormAssociatedElement* associatedElement) | 329 HTMLElement* toHTMLElement(FormAssociatedElement* associatedElement) |
| 331 { | 330 { |
| 332 return const_cast<HTMLElement*>(toHTMLElement(static_cast<const FormAssociat
edElement*>(associatedElement))); | 331 return const_cast<HTMLElement*>(toHTMLElement(static_cast<const FormAssociat
edElement*>(associatedElement))); |
| 333 } | 332 } |
| 334 | 333 |
| 335 HTMLElement& toHTMLElement(FormAssociatedElement& associatedElement) | 334 HTMLElement& toHTMLElement(FormAssociatedElement& associatedElement) |
| 336 { | 335 { |
| 337 return const_cast<HTMLElement&>(toHTMLElement(static_cast<const FormAssociat
edElement&>(associatedElement))); | 336 return const_cast<HTMLElement&>(toHTMLElement(static_cast<const FormAssociat
edElement&>(associatedElement))); |
| 338 } | 337 } |
| 339 | 338 |
| 340 PassOwnPtrWillBeRawPtr<FormAttributeTargetObserver> FormAttributeTargetObserver:
:create(const AtomicString& id, FormAssociatedElement* element) | 339 RawPtr<FormAttributeTargetObserver> FormAttributeTargetObserver::create(const At
omicString& id, FormAssociatedElement* element) |
| 341 { | 340 { |
| 342 return adoptPtrWillBeNoop(new FormAttributeTargetObserver(id, element)); | 341 return new FormAttributeTargetObserver(id, element); |
| 343 } | 342 } |
| 344 | 343 |
| 345 FormAttributeTargetObserver::FormAttributeTargetObserver(const AtomicString& id,
FormAssociatedElement* element) | 344 FormAttributeTargetObserver::FormAttributeTargetObserver(const AtomicString& id,
FormAssociatedElement* element) |
| 346 : IdTargetObserver(toHTMLElement(element)->treeScope().idTargetObserverRegis
try(), id) | 345 : IdTargetObserver(toHTMLElement(element)->treeScope().idTargetObserverRegis
try(), id) |
| 347 , m_element(element) | 346 , m_element(element) |
| 348 { | 347 { |
| 349 } | 348 } |
| 350 | 349 |
| 351 DEFINE_TRACE(FormAttributeTargetObserver) | 350 DEFINE_TRACE(FormAttributeTargetObserver) |
| 352 { | 351 { |
| 353 visitor->trace(m_element); | 352 visitor->trace(m_element); |
| 354 IdTargetObserver::trace(visitor); | 353 IdTargetObserver::trace(visitor); |
| 355 } | 354 } |
| 356 | 355 |
| 357 void FormAttributeTargetObserver::idTargetChanged() | 356 void FormAttributeTargetObserver::idTargetChanged() |
| 358 { | 357 { |
| 359 m_element->formAttributeTargetChanged(); | 358 m_element->formAttributeTargetChanged(); |
| 360 } | 359 } |
| 361 | 360 |
| 362 } // namespace blink | 361 } // namespace blink |
| OLD | NEW |