OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 if (textField->hasTagName(HTMLNames::inputTag)) | 296 if (textField->hasTagName(HTMLNames::inputTag)) |
297 return static_cast<HTMLInputElement*>(textField)->lastChangeWasUserEdit(
); | 297 return static_cast<HTMLInputElement*>(textField)->lastChangeWasUserEdit(
); |
298 | 298 |
299 if (textField->hasTagName(HTMLNames::textareaTag)) | 299 if (textField->hasTagName(HTMLNames::textareaTag)) |
300 return static_cast<HTMLTextAreaElement*>(textField)->lastChangeWasUserEd
it(); | 300 return static_cast<HTMLTextAreaElement*>(textField)->lastChangeWasUserEd
it(); |
301 | 301 |
302 ec = INVALID_NODE_TYPE_ERR; | 302 ec = INVALID_NODE_TYPE_ERR; |
303 return false; | 303 return false; |
304 } | 304 } |
305 | 305 |
| 306 String Internals::suggestedValue(Element* inputElement, ExceptionCode& ec) |
| 307 { |
| 308 if (!inputElement) { |
| 309 ec = INVALID_ACCESS_ERR; |
| 310 return String(); |
| 311 } |
| 312 |
| 313 if (!inputElement->hasTagName(HTMLNames::inputTag)) { |
| 314 ec = INVALID_NODE_TYPE_ERR; |
| 315 return String(); |
| 316 } |
| 317 |
| 318 return static_cast<HTMLInputElement*>(inputElement)->suggestedValue(); |
306 } | 319 } |
| 320 |
| 321 void Internals::setSuggestedValue(Element* inputElement, const String& value, Ex
ceptionCode& ec) |
| 322 { |
| 323 if (!inputElement) { |
| 324 ec = INVALID_ACCESS_ERR; |
| 325 return; |
| 326 } |
| 327 |
| 328 if (!inputElement->hasTagName(HTMLNames::inputTag)) { |
| 329 ec = INVALID_NODE_TYPE_ERR; |
| 330 return; |
| 331 } |
| 332 |
| 333 static_cast<HTMLInputElement*>(inputElement)->setSuggestedValue(value); |
| 334 } |
| 335 |
| 336 } |
OLD | NEW |