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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #include "core/dom/shadow/InsertionPoint.h" | 42 #include "core/dom/shadow/InsertionPoint.h" |
43 #include "core/dom/shadow/ShadowRoot.h" | 43 #include "core/dom/shadow/ShadowRoot.h" |
44 #include "core/editing/FrameSelection.h" | 44 #include "core/editing/FrameSelection.h" |
45 #include "core/editing/SpellChecker.h" | 45 #include "core/editing/SpellChecker.h" |
46 #include "core/events/BeforeTextInsertedEvent.h" | 46 #include "core/events/BeforeTextInsertedEvent.h" |
47 #include "core/events/KeyboardEvent.h" | 47 #include "core/events/KeyboardEvent.h" |
48 #include "core/events/MouseEvent.h" | 48 #include "core/events/MouseEvent.h" |
49 #include "core/events/ScopedEventQueue.h" | 49 #include "core/events/ScopedEventQueue.h" |
50 #include "core/events/TouchEvent.h" | 50 #include "core/events/TouchEvent.h" |
51 #include "core/fileapi/FileList.h" | 51 #include "core/fileapi/FileList.h" |
| 52 #include "core/frame/EventHandlerRegistry.h" |
52 #include "core/frame/FrameHost.h" | 53 #include "core/frame/FrameHost.h" |
53 #include "core/frame/FrameView.h" | 54 #include "core/frame/FrameView.h" |
54 #include "core/frame/LocalFrame.h" | 55 #include "core/frame/LocalFrame.h" |
55 #include "core/frame/UseCounter.h" | 56 #include "core/frame/UseCounter.h" |
56 #include "core/html/HTMLCollection.h" | 57 #include "core/html/HTMLCollection.h" |
57 #include "core/html/HTMLDataListElement.h" | 58 #include "core/html/HTMLDataListElement.h" |
58 #include "core/html/HTMLFormElement.h" | 59 #include "core/html/HTMLFormElement.h" |
59 #include "core/html/HTMLImageLoader.h" | 60 #include "core/html/HTMLImageLoader.h" |
60 #include "core/html/HTMLOptionElement.h" | 61 #include "core/html/HTMLOptionElement.h" |
61 #include "core/html/forms/ColorInputType.h" | 62 #include "core/html/forms/ColorInputType.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 HTMLInputElement::~HTMLInputElement() | 167 HTMLInputElement::~HTMLInputElement() |
167 { | 168 { |
168 #if !ENABLE(OILPAN) | 169 #if !ENABLE(OILPAN) |
169 // Need to remove form association while this is still an HTMLInputElement | 170 // Need to remove form association while this is still an HTMLInputElement |
170 // so that virtual functions are called correctly. | 171 // so that virtual functions are called correctly. |
171 setForm(0); | 172 setForm(0); |
172 // setForm(0) may register this to a document-level radio button group. | 173 // setForm(0) may register this to a document-level radio button group. |
173 // We should unregister it to avoid accessing a deleted object. | 174 // We should unregister it to avoid accessing a deleted object. |
174 if (isRadioButton()) | 175 if (isRadioButton()) |
175 document().formController().radioButtonGroupScope().removeButton(this); | 176 document().formController().radioButtonGroupScope().removeButton(this); |
176 if (m_hasTouchEventHandler) | 177 if (m_hasTouchEventHandler && document().frameHost()) |
177 document().didRemoveTouchEventHandler(this); | 178 document().frameHost()->eventHandlerRegistry().didRemoveEventHandler(*th
is, EventHandlerRegistry::TouchEvent); |
178 #endif | 179 #endif |
179 } | 180 } |
180 | 181 |
181 const AtomicString& HTMLInputElement::name() const | 182 const AtomicString& HTMLInputElement::name() const |
182 { | 183 { |
183 return m_name.isNull() ? emptyAtom : m_name; | 184 return m_name.isNull() ? emptyAtom : m_name; |
184 } | 185 } |
185 | 186 |
186 Vector<FileChooserFileInfo> HTMLInputElement::filesFromFileInputFormControlState
(const FormControlState& state) | 187 Vector<FileChooserFileInfo> HTMLInputElement::filesFromFileInputFormControlState
(const FormControlState& state) |
187 { | 188 { |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 | 419 |
419 m_inputType = newType.release(); | 420 m_inputType = newType.release(); |
420 if (hasAuthorShadowRoot()) | 421 if (hasAuthorShadowRoot()) |
421 m_inputTypeView = InputTypeView::create(*this); | 422 m_inputTypeView = InputTypeView::create(*this); |
422 else | 423 else |
423 m_inputTypeView = m_inputType; | 424 m_inputTypeView = m_inputType; |
424 m_inputTypeView->createShadowSubtree(); | 425 m_inputTypeView->createShadowSubtree(); |
425 | 426 |
426 bool hasTouchEventHandler = m_inputTypeView->hasTouchEventHandler(); | 427 bool hasTouchEventHandler = m_inputTypeView->hasTouchEventHandler(); |
427 if (hasTouchEventHandler != m_hasTouchEventHandler) { | 428 if (hasTouchEventHandler != m_hasTouchEventHandler) { |
428 if (hasTouchEventHandler) | 429 if (document().frameHost()) { |
429 document().didAddTouchEventHandler(this); | 430 EventHandlerRegistry* registry = &document().frameHost()->eventHandl
erRegistry(); |
430 else | 431 if (hasTouchEventHandler) |
431 document().didRemoveTouchEventHandler(this); | 432 registry->didAddEventHandler(*this, EventHandlerRegistry::TouchE
vent); |
| 433 else |
| 434 registry->didRemoveEventHandler(*this, EventHandlerRegistry::Tou
chEvent); |
| 435 } |
432 m_hasTouchEventHandler = hasTouchEventHandler; | 436 m_hasTouchEventHandler = hasTouchEventHandler; |
433 } | 437 } |
434 | 438 |
435 setNeedsWillValidateCheck(); | 439 setNeedsWillValidateCheck(); |
436 | 440 |
437 bool willStoreValue = m_inputType->storesValueSeparateFromAttribute(); | 441 bool willStoreValue = m_inputType->storesValueSeparateFromAttribute(); |
438 | 442 |
439 if (didStoreValue && !willStoreValue && hasDirtyValue()) { | 443 if (didStoreValue && !willStoreValue && hasDirtyValue()) { |
440 setAttribute(valueAttr, AtomicString(m_valueIfDirty)); | 444 setAttribute(valueAttr, AtomicString(m_valueIfDirty)); |
441 m_valueIfDirty = String(); | 445 m_valueIfDirty = String(); |
(...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1427 resetListAttributeTargetObserver(); | 1431 resetListAttributeTargetObserver(); |
1428 } | 1432 } |
1429 | 1433 |
1430 void HTMLInputElement::didMoveToNewDocument(Document& oldDocument) | 1434 void HTMLInputElement::didMoveToNewDocument(Document& oldDocument) |
1431 { | 1435 { |
1432 if (hasImageLoader()) | 1436 if (hasImageLoader()) |
1433 imageLoader()->elementDidMoveToNewDocument(); | 1437 imageLoader()->elementDidMoveToNewDocument(); |
1434 | 1438 |
1435 if (isRadioButton()) | 1439 if (isRadioButton()) |
1436 oldDocument.formController().radioButtonGroupScope().removeButton(this); | 1440 oldDocument.formController().radioButtonGroupScope().removeButton(this); |
1437 if (m_hasTouchEventHandler) | |
1438 oldDocument.didRemoveTouchEventHandler(this); | |
1439 | |
1440 if (m_hasTouchEventHandler) | |
1441 document().didAddTouchEventHandler(this); | |
1442 | 1441 |
1443 HTMLTextFormControlElement::didMoveToNewDocument(oldDocument); | 1442 HTMLTextFormControlElement::didMoveToNewDocument(oldDocument); |
1444 } | 1443 } |
1445 | 1444 |
1446 void HTMLInputElement::removeAllEventListeners() | 1445 void HTMLInputElement::removeAllEventListeners() |
1447 { | 1446 { |
1448 HTMLTextFormControlElement::removeAllEventListeners(); | 1447 HTMLTextFormControlElement::removeAllEventListeners(); |
1449 m_hasTouchEventHandler = false; | 1448 m_hasTouchEventHandler = false; |
1450 } | 1449 } |
1451 | 1450 |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1857 return m_inputTypeView->customStyleForRenderer(originalStyleForRenderer()); | 1856 return m_inputTypeView->customStyleForRenderer(originalStyleForRenderer()); |
1858 } | 1857 } |
1859 #endif | 1858 #endif |
1860 | 1859 |
1861 bool HTMLInputElement::shouldDispatchFormControlChangeEvent(String& oldValue, St
ring& newValue) | 1860 bool HTMLInputElement::shouldDispatchFormControlChangeEvent(String& oldValue, St
ring& newValue) |
1862 { | 1861 { |
1863 return m_inputType->shouldDispatchFormControlChangeEvent(oldValue, newValue)
; | 1862 return m_inputType->shouldDispatchFormControlChangeEvent(oldValue, newValue)
; |
1864 } | 1863 } |
1865 | 1864 |
1866 } // namespace | 1865 } // namespace |
OLD | NEW |