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

Side by Side Diff: Source/web/WebInputElement.cpp

Issue 133443011: Add text field change handling for autofill preview in textarea element. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update documentation as per tkent's review comments Created 6 years, 9 months 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/web/WebFormControlElement.cpp ('k') | Source/web/tests/WebViewTest.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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 void WebInputElement::setValue(const WebString& value, bool sendChangeEvent) 105 void WebInputElement::setValue(const WebString& value, bool sendChangeEvent)
106 { 106 {
107 unwrap<HTMLInputElement>()->setValue(value, sendChangeEvent ? DispatchChange Event : DispatchNoEvent); 107 unwrap<HTMLInputElement>()->setValue(value, sendChangeEvent ? DispatchChange Event : DispatchNoEvent);
108 } 108 }
109 109
110 WebString WebInputElement::value() const 110 WebString WebInputElement::value() const
111 { 111 {
112 return constUnwrap<HTMLInputElement>()->value(); 112 return constUnwrap<HTMLInputElement>()->value();
113 } 113 }
114 114
115 WebString WebInputElement::editingValue() const
116 {
117 return constUnwrap<HTMLInputElement>()->innerTextValue();
118 }
119
120 void WebInputElement::setEditingValue(const WebString& value) 115 void WebInputElement::setEditingValue(const WebString& value)
121 { 116 {
122 unwrap<HTMLInputElement>()->setEditingValue(value); 117 unwrap<HTMLInputElement>()->setEditingValue(value);
123 } 118 }
124 119
125 void WebInputElement::setSuggestedValue(const WebString& value) 120 void WebInputElement::setSuggestedValue(const WebString& value)
126 { 121 {
127 unwrap<HTMLInputElement>()->setSuggestedValue(value); 122 unwrap<HTMLInputElement>()->setSuggestedValue(value);
128 } 123 }
129 124
130 WebString WebInputElement::suggestedValue() const 125 WebString WebInputElement::suggestedValue() const
131 { 126 {
132 return constUnwrap<HTMLInputElement>()->suggestedValue(); 127 return constUnwrap<HTMLInputElement>()->suggestedValue();
133 } 128 }
134 129
135 void WebInputElement::setSelectionRange(int start, int end) 130 void WebInputElement::setSelectionRange(int start, int end)
136 { 131 {
137 unwrap<HTMLInputElement>()->setSelectionRange(start, end); 132 unwrap<HTMLInputElement>()->setSelectionRange(start, end);
138 } 133 }
139 134
140 int WebInputElement::selectionStart() const
141 {
142 return constUnwrap<HTMLInputElement>()->selectionStart();
143 }
144
145 int WebInputElement::selectionEnd() const
146 {
147 return constUnwrap<HTMLInputElement>()->selectionEnd();
148 }
149
150 bool WebInputElement::isValidValue(const WebString& value) const 135 bool WebInputElement::isValidValue(const WebString& value) const
151 { 136 {
152 return constUnwrap<HTMLInputElement>()->isValidValue(value); 137 return constUnwrap<HTMLInputElement>()->isValidValue(value);
153 } 138 }
154 139
155 void WebInputElement::setChecked(bool nowChecked, bool sendChangeEvent) 140 void WebInputElement::setChecked(bool nowChecked, bool sendChangeEvent)
156 { 141 {
157 unwrap<HTMLInputElement>()->setChecked(nowChecked, sendChangeEvent ? Dispatc hChangeEvent : DispatchNoEvent); 142 unwrap<HTMLInputElement>()->setChecked(nowChecked, sendChangeEvent ? Dispatc hChangeEvent : DispatchNoEvent);
158 } 143 }
159 144
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 } 249 }
265 250
266 WebInputElement* toWebInputElement(WebElement* webElement) 251 WebInputElement* toWebInputElement(WebElement* webElement)
267 { 252 {
268 if (!webElement->unwrap<Element>()->hasTagName(HTMLNames::inputTag)) 253 if (!webElement->unwrap<Element>()->hasTagName(HTMLNames::inputTag))
269 return 0; 254 return 0;
270 255
271 return static_cast<WebInputElement*>(webElement); 256 return static_cast<WebInputElement*>(webElement);
272 } 257 }
273 } // namespace blink 258 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/WebFormControlElement.cpp ('k') | Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698