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, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
7 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) | 7 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) |
8 * Copyright (C) 2010 Google Inc. All rights reserved. | 8 * Copyright (C) 2010 Google Inc. All rights reserved. |
9 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 9 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
10 * Copyright (C) 2012 Samsung Electronics. All rights reserved. | 10 * Copyright (C) 2012 Samsung Electronics. All rights reserved. |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 #include "platform/PlatformMouseEvent.h" | 75 #include "platform/PlatformMouseEvent.h" |
76 #include "platform/text/PlatformLocale.h" | 76 #include "platform/text/PlatformLocale.h" |
77 #include "wtf/MathExtras.h" | 77 #include "wtf/MathExtras.h" |
78 | 78 |
79 using namespace std; | 79 using namespace std; |
80 | 80 |
81 namespace WebCore { | 81 namespace WebCore { |
82 | 82 |
83 using namespace HTMLNames; | 83 using namespace HTMLNames; |
84 | 84 |
85 class ListAttributeTargetObserver : IdTargetObserver { | 85 class ListAttributeTargetObserver : public IdTargetObserver { |
86 WTF_MAKE_FAST_ALLOCATED; | 86 WTF_MAKE_FAST_ALLOCATED; |
87 public: | 87 public: |
88 static PassOwnPtr<ListAttributeTargetObserver> create(const AtomicString& id
, HTMLInputElement*); | 88 static PassOwnPtr<ListAttributeTargetObserver> create(const AtomicString& id
, HTMLInputElement*); |
89 virtual void idTargetChanged() OVERRIDE; | 89 virtual void idTargetChanged() OVERRIDE; |
90 | 90 |
91 private: | 91 private: |
92 ListAttributeTargetObserver(const AtomicString& id, HTMLInputElement*); | 92 ListAttributeTargetObserver(const AtomicString& id, HTMLInputElement*); |
93 | 93 |
94 HTMLInputElement* m_element; | 94 HTMLInputElement* m_element; |
95 }; | 95 }; |
(...skipping 1396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1492 if (!dataList) | 1492 if (!dataList) |
1493 return false; | 1493 return false; |
1494 RefPtr<HTMLCollection> options = dataList->options(); | 1494 RefPtr<HTMLCollection> options = dataList->options(); |
1495 for (unsigned i = 0; HTMLOptionElement* option = toHTMLOptionElement(options
->item(i)); ++i) { | 1495 for (unsigned i = 0; HTMLOptionElement* option = toHTMLOptionElement(options
->item(i)); ++i) { |
1496 if (isValidValue(option->value())) | 1496 if (isValidValue(option->value())) |
1497 return true; | 1497 return true; |
1498 } | 1498 } |
1499 return false; | 1499 return false; |
1500 } | 1500 } |
1501 | 1501 |
| 1502 void HTMLInputElement::setListAttributeTargetObserver(PassOwnPtr<ListAttributeTa
rgetObserver> newObserver) |
| 1503 { |
| 1504 if (m_listAttributeTargetObserver) |
| 1505 m_listAttributeTargetObserver->unregister(); |
| 1506 m_listAttributeTargetObserver = newObserver; |
| 1507 } |
| 1508 |
1502 void HTMLInputElement::resetListAttributeTargetObserver() | 1509 void HTMLInputElement::resetListAttributeTargetObserver() |
1503 { | 1510 { |
1504 if (inDocument()) | 1511 if (inDocument()) |
1505 m_listAttributeTargetObserver = ListAttributeTargetObserver::create(fast
GetAttribute(listAttr), this); | 1512 setListAttributeTargetObserver(ListAttributeTargetObserver::create(fastG
etAttribute(listAttr), this)); |
1506 else | 1513 else |
1507 m_listAttributeTargetObserver = nullptr; | 1514 setListAttributeTargetObserver(nullptr); |
1508 } | 1515 } |
1509 | 1516 |
1510 void HTMLInputElement::listAttributeTargetChanged() | 1517 void HTMLInputElement::listAttributeTargetChanged() |
1511 { | 1518 { |
1512 m_inputTypeView->listAttributeTargetChanged(); | 1519 m_inputTypeView->listAttributeTargetChanged(); |
1513 } | 1520 } |
1514 | 1521 |
1515 bool HTMLInputElement::isSteppable() const | 1522 bool HTMLInputElement::isSteppable() const |
1516 { | 1523 { |
1517 return m_inputType->isSteppable(); | 1524 return m_inputType->isSteppable(); |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1853 } | 1860 } |
1854 | 1861 |
1855 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) | 1862 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) |
1856 PassRefPtr<RenderStyle> HTMLInputElement::customStyleForRenderer() | 1863 PassRefPtr<RenderStyle> HTMLInputElement::customStyleForRenderer() |
1857 { | 1864 { |
1858 return m_inputTypeView->customStyleForRenderer(originalStyleForRenderer()); | 1865 return m_inputTypeView->customStyleForRenderer(originalStyleForRenderer()); |
1859 } | 1866 } |
1860 #endif | 1867 #endif |
1861 | 1868 |
1862 } // namespace | 1869 } // namespace |
OLD | NEW |