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 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 27 matching lines...) Expand all Loading... |
38 #include "HTMLCollection.h" | 38 #include "HTMLCollection.h" |
39 #include "HTMLDataListElement.h" | 39 #include "HTMLDataListElement.h" |
40 #include "HTMLFormElement.h" | 40 #include "HTMLFormElement.h" |
41 #include "HTMLNames.h" | 41 #include "HTMLNames.h" |
42 #include "HTMLOptionElement.h" | 42 #include "HTMLOptionElement.h" |
43 #include "HTMLParserIdioms.h" | 43 #include "HTMLParserIdioms.h" |
44 #include "InputType.h" | 44 #include "InputType.h" |
45 #include "KeyboardEvent.h" | 45 #include "KeyboardEvent.h" |
46 #include "LocalizedStrings.h" | 46 #include "LocalizedStrings.h" |
47 #include "MouseEvent.h" | 47 #include "MouseEvent.h" |
| 48 #include "PlatformMouseEvent.h" |
48 #include "RenderTextControlSingleLine.h" | 49 #include "RenderTextControlSingleLine.h" |
49 #include "RenderTheme.h" | 50 #include "RenderTheme.h" |
50 #include "RuntimeEnabledFeatures.h" | 51 #include "RuntimeEnabledFeatures.h" |
51 #include "ScriptEventListener.h" | 52 #include "ScriptEventListener.h" |
52 #include "WheelEvent.h" | 53 #include "WheelEvent.h" |
53 #include <wtf/MathExtras.h> | 54 #include <wtf/MathExtras.h> |
54 #include <wtf/StdLibExtras.h> | 55 #include <wtf/StdLibExtras.h> |
55 | 56 |
56 using namespace std; | 57 using namespace std; |
57 | 58 |
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
935 | 936 |
936 setFormControlValueMatchesRenderer(true); | 937 setFormControlValueMatchesRenderer(true); |
937 InputElement::notifyFormStateChanged(this); | 938 InputElement::notifyFormStateChanged(this); |
938 setNeedsValidityCheck(); | 939 setNeedsValidityCheck(); |
939 } | 940 } |
940 | 941 |
941 void* HTMLInputElement::preDispatchEventHandler(Event* event) | 942 void* HTMLInputElement::preDispatchEventHandler(Event* event) |
942 { | 943 { |
943 if (event->type() != eventNames().clickEvent) | 944 if (event->type() != eventNames().clickEvent) |
944 return 0; | 945 return 0; |
| 946 if (!event->isMouseEvent() || static_cast<MouseEvent*>(event)->button() != L
eftButton) |
| 947 return 0; |
945 // FIXME: Check whether there are any cases where this actually ends up leak
ing. | 948 // FIXME: Check whether there are any cases where this actually ends up leak
ing. |
946 return m_inputType->willDispatchClick().leakPtr(); | 949 return m_inputType->willDispatchClick().leakPtr(); |
947 } | 950 } |
948 | 951 |
949 void HTMLInputElement::postDispatchEventHandler(Event* event, void* dataFromPreD
ispatch) | 952 void HTMLInputElement::postDispatchEventHandler(Event* event, void* dataFromPreD
ispatch) |
950 { | 953 { |
951 OwnPtr<ClickHandlingState> state = adoptPtr(static_cast<ClickHandlingState*>
(dataFromPreDispatch)); | 954 OwnPtr<ClickHandlingState> state = adoptPtr(static_cast<ClickHandlingState*>
(dataFromPreDispatch)); |
952 if (event->type() != eventNames().clickEvent) | |
953 return; | |
954 if (!state) | 955 if (!state) |
955 return; | 956 return; |
956 m_inputType->didDispatchClick(event, *state); | 957 m_inputType->didDispatchClick(event, *state); |
957 } | 958 } |
958 | 959 |
959 void HTMLInputElement::defaultEventHandler(Event* evt) | 960 void HTMLInputElement::defaultEventHandler(Event* evt) |
960 { | 961 { |
961 if (evt->isMouseEvent() && evt->type() == eventNames().clickEvent) { | 962 if (evt->isMouseEvent() && evt->type() == eventNames().clickEvent && static_
cast<MouseEvent*>(evt)->button() == LeftButton) { |
962 m_inputType->handleClickEvent(static_cast<MouseEvent*>(evt)); | 963 m_inputType->handleClickEvent(static_cast<MouseEvent*>(evt)); |
963 if (evt->defaultHandled()) | 964 if (evt->defaultHandled()) |
964 return; | 965 return; |
965 } | 966 } |
966 | 967 |
967 if (evt->isKeyboardEvent() && evt->type() == eventNames().keydownEvent) { | 968 if (evt->isKeyboardEvent() && evt->type() == eventNames().keydownEvent) { |
968 m_inputType->handleKeydownEvent(static_cast<KeyboardEvent*>(evt)); | 969 m_inputType->handleKeydownEvent(static_cast<KeyboardEvent*>(evt)); |
969 if (evt->defaultHandled()) | 970 if (evt->defaultHandled()) |
970 return; | 971 return; |
971 } | 972 } |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1506 return formElement->checkedRadioButtons(); | 1507 return formElement->checkedRadioButtons(); |
1507 return document()->checkedRadioButtons(); | 1508 return document()->checkedRadioButtons(); |
1508 } | 1509 } |
1509 | 1510 |
1510 void HTMLInputElement::handleBeforeTextInsertedEvent(Event* event) | 1511 void HTMLInputElement::handleBeforeTextInsertedEvent(Event* event) |
1511 { | 1512 { |
1512 InputElement::handleBeforeTextInsertedEvent(m_data, this, this, event); | 1513 InputElement::handleBeforeTextInsertedEvent(m_data, this, this, event); |
1513 } | 1514 } |
1514 | 1515 |
1515 } // namespace | 1516 } // namespace |
OLD | NEW |