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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 #include "HTMLOptionElement.h" | 47 #include "HTMLOptionElement.h" |
48 #include "HTMLParserIdioms.h" | 48 #include "HTMLParserIdioms.h" |
49 #include "IdTargetObserver.h" | 49 #include "IdTargetObserver.h" |
50 #include "InputType.h" | 50 #include "InputType.h" |
51 #include "KeyboardEvent.h" | 51 #include "KeyboardEvent.h" |
52 #include "LocalizedStrings.h" | 52 #include "LocalizedStrings.h" |
53 #include "MouseEvent.h" | 53 #include "MouseEvent.h" |
54 #include "NumberInputType.h" | 54 #include "NumberInputType.h" |
55 #include "RenderTextControlSingleLine.h" | 55 #include "RenderTextControlSingleLine.h" |
56 #include "RenderTheme.h" | 56 #include "RenderTheme.h" |
| 57 #include "ScopedEventQueue.h" |
57 #include "SearchInputType.h" | 58 #include "SearchInputType.h" |
58 #include "ShadowRoot.h" | 59 #include "ShadowRoot.h" |
59 #include "ScriptEventListener.h" | 60 #include "ScriptEventListener.h" |
60 #include <wtf/MathExtras.h> | 61 #include <wtf/MathExtras.h> |
61 #include <wtf/StdLibExtras.h> | 62 #include <wtf/StdLibExtras.h> |
62 | 63 |
63 #if ENABLE(INPUT_TYPE_COLOR) | 64 #if ENABLE(INPUT_TYPE_COLOR) |
64 #include "ColorInputType.h" | 65 #include "ColorInputType.h" |
65 #endif | 66 #endif |
66 | 67 |
(...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1005 | 1006 |
1006 dispatchInputEvent(); | 1007 dispatchInputEvent(); |
1007 } | 1008 } |
1008 | 1009 |
1009 void HTMLInputElement::setValue(const String& value, TextFieldEventBehavior even
tBehavior) | 1010 void HTMLInputElement::setValue(const String& value, TextFieldEventBehavior even
tBehavior) |
1010 { | 1011 { |
1011 if (!m_inputType->canSetValue(value)) | 1012 if (!m_inputType->canSetValue(value)) |
1012 return; | 1013 return; |
1013 | 1014 |
1014 RefPtr<HTMLInputElement> protector(this); | 1015 RefPtr<HTMLInputElement> protector(this); |
| 1016 EventQueueScope scope; |
1015 String sanitizedValue = sanitizeValue(value); | 1017 String sanitizedValue = sanitizeValue(value); |
1016 bool valueChanged = sanitizedValue != this->value(); | 1018 bool valueChanged = sanitizedValue != this->value(); |
1017 | 1019 |
1018 setLastChangeWasNotUserEdit(); | 1020 setLastChangeWasNotUserEdit(); |
1019 setFormControlValueMatchesRenderer(false); | 1021 setFormControlValueMatchesRenderer(false); |
1020 m_suggestedValue = String(); // Prevent TextFieldInputType::setValue from us
ing the suggested value. | 1022 m_suggestedValue = String(); // Prevent TextFieldInputType::setValue from us
ing the suggested value. |
1021 m_inputType->setValue(sanitizedValue, valueChanged, eventBehavior); | 1023 m_inputType->setValue(sanitizedValue, valueChanged, eventBehavior); |
1022 | 1024 |
1023 if (!valueChanged) | 1025 if (!valueChanged) |
1024 return; | 1026 return; |
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1863 { | 1865 { |
1864 } | 1866 } |
1865 | 1867 |
1866 void ListAttributeTargetObserver::idTargetChanged() | 1868 void ListAttributeTargetObserver::idTargetChanged() |
1867 { | 1869 { |
1868 m_element->listAttributeTargetChanged(); | 1870 m_element->listAttributeTargetChanged(); |
1869 } | 1871 } |
1870 #endif | 1872 #endif |
1871 | 1873 |
1872 } // namespace | 1874 } // namespace |
OLD | NEW |