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, 2010 Apple Inc. All rights reserv
ed. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights reserv
ed. |
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 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 | 355 |
356 // Return early because we don't want to move the caret or trigger other sid
e effects | 356 // Return early because we don't want to move the caret or trigger other sid
e effects |
357 // when the value isn't changing. This matches Firefox behavior, at least. | 357 // when the value isn't changing. This matches Firefox behavior, at least. |
358 if (normalizedValue == value()) | 358 if (normalizedValue == value()) |
359 return; | 359 return; |
360 | 360 |
361 m_value = normalizedValue; | 361 m_value = normalizedValue; |
362 setInnerTextValue(m_value); | 362 setInnerTextValue(m_value); |
363 setLastChangeWasNotUserEdit(); | 363 setLastChangeWasNotUserEdit(); |
364 updatePlaceholderVisibility(false); | 364 updatePlaceholderVisibility(false); |
365 setNeedsStyleRecalc(); | 365 setNeedsStyleRecalc(SubtreeStyleChange); |
366 setFormControlValueMatchesRenderer(true); | 366 setFormControlValueMatchesRenderer(true); |
367 | 367 |
368 // Set the caret to the end of the text value. | 368 // Set the caret to the end of the text value. |
369 if (document().focusedElement() == this) { | 369 if (document().focusedElement() == this) { |
370 unsigned endOfString = m_value.length(); | 370 unsigned endOfString = m_value.length(); |
371 setSelectionRange(endOfString, endOfString); | 371 setSelectionRange(endOfString, endOfString); |
372 } | 372 } |
373 | 373 |
374 notifyFormStateChanged(); | 374 notifyFormStateChanged(); |
375 setTextAsOfLastFormControlChangeEvent(normalizedValue); | 375 setTextAsOfLastFormControlChangeEvent(normalizedValue); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 String HTMLTextAreaElement::suggestedValue() const | 431 String HTMLTextAreaElement::suggestedValue() const |
432 { | 432 { |
433 return m_suggestedValue; | 433 return m_suggestedValue; |
434 } | 434 } |
435 | 435 |
436 void HTMLTextAreaElement::setSuggestedValue(const String& value) | 436 void HTMLTextAreaElement::setSuggestedValue(const String& value) |
437 { | 437 { |
438 m_suggestedValue = value; | 438 m_suggestedValue = value; |
439 setInnerTextValue(m_suggestedValue); | 439 setInnerTextValue(m_suggestedValue); |
440 updatePlaceholderVisibility(false); | 440 updatePlaceholderVisibility(false); |
441 setNeedsStyleRecalc(); | 441 setNeedsStyleRecalc(SubtreeStyleChange); |
442 setFormControlValueMatchesRenderer(true); | 442 setFormControlValueMatchesRenderer(true); |
443 } | 443 } |
444 | 444 |
445 String HTMLTextAreaElement::validationMessage() const | 445 String HTMLTextAreaElement::validationMessage() const |
446 { | 446 { |
447 if (!willValidate()) | 447 if (!willValidate()) |
448 return String(); | 448 return String(); |
449 | 449 |
450 if (customError()) | 450 if (customError()) |
451 return customValidationMessage(); | 451 return customValidationMessage(); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 { | 540 { |
541 return true; | 541 return true; |
542 } | 542 } |
543 | 543 |
544 bool HTMLTextAreaElement::supportsAutofocus() const | 544 bool HTMLTextAreaElement::supportsAutofocus() const |
545 { | 545 { |
546 return true; | 546 return true; |
547 } | 547 } |
548 | 548 |
549 } | 549 } |
OLD | NEW |