Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(282)

Side by Side Diff: Source/WebCore/html/HTMLInputElement.cpp

Issue 11364206: Merge 132983 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1312/
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/WebCore/dom/Node.cpp ('k') | Source/WebCore/html/RangeInputType.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 947 matching lines...) Expand 10 before | Expand all | Expand 10 after
1014 } 1015 }
1015 setValue(value, eventBehavior); 1016 setValue(value, eventBehavior);
1016 } 1017 }
1017 1018
1018 void HTMLInputElement::setValue(const String& value, TextFieldEventBehavior even tBehavior) 1019 void HTMLInputElement::setValue(const String& value, TextFieldEventBehavior even tBehavior)
1019 { 1020 {
1020 if (!m_inputType->canSetValue(value)) 1021 if (!m_inputType->canSetValue(value))
1021 return; 1022 return;
1022 1023
1023 RefPtr<HTMLInputElement> protector(this); 1024 RefPtr<HTMLInputElement> protector(this);
1025 EventQueueScope scope;
1024 String sanitizedValue = sanitizeValue(value); 1026 String sanitizedValue = sanitizeValue(value);
1025 bool valueChanged = sanitizedValue != this->value(); 1027 bool valueChanged = sanitizedValue != this->value();
1026 1028
1027 setLastChangeWasNotUserEdit(); 1029 setLastChangeWasNotUserEdit();
1028 setFormControlValueMatchesRenderer(false); 1030 setFormControlValueMatchesRenderer(false);
1029 m_suggestedValue = String(); // Prevent TextFieldInputType::setValue from us ing the suggested value. 1031 m_suggestedValue = String(); // Prevent TextFieldInputType::setValue from us ing the suggested value.
1030 m_inputType->setValue(sanitizedValue, valueChanged, eventBehavior); 1032 m_inputType->setValue(sanitizedValue, valueChanged, eventBehavior);
1031 1033
1032 if (!valueChanged) 1034 if (!valueChanged)
1033 return; 1035 return;
(...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after
1900 { 1902 {
1901 if (!m_inputType->supportsSelectionAPI()) { 1903 if (!m_inputType->supportsSelectionAPI()) {
1902 ec = INVALID_STATE_ERR; 1904 ec = INVALID_STATE_ERR;
1903 return; 1905 return;
1904 } 1906 }
1905 1907
1906 HTMLTextFormControlElement::setRangeText(replacement, start, end, selectionM ode, ec); 1908 HTMLTextFormControlElement::setRangeText(replacement, start, end, selectionM ode, ec);
1907 } 1909 }
1908 1910
1909 } // namespace 1911 } // namespace
OLDNEW
« no previous file with comments | « Source/WebCore/dom/Node.cpp ('k') | Source/WebCore/html/RangeInputType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698