| 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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 event->setText(sanitizeUserInputValue(event->text(), appendableLength)); | 305 event->setText(sanitizeUserInputValue(event->text(), appendableLength)); |
| 306 } | 306 } |
| 307 | 307 |
| 308 String HTMLTextAreaElement::sanitizeUserInputValue(const String& proposedValue,
unsigned maxLength) | 308 String HTMLTextAreaElement::sanitizeUserInputValue(const String& proposedValue,
unsigned maxLength) |
| 309 { | 309 { |
| 310 if (maxLength > 0 && U16_IS_LEAD(proposedValue[maxLength - 1])) | 310 if (maxLength > 0 && U16_IS_LEAD(proposedValue[maxLength - 1])) |
| 311 --maxLength; | 311 --maxLength; |
| 312 return proposedValue.left(maxLength); | 312 return proposedValue.left(maxLength); |
| 313 } | 313 } |
| 314 | 314 |
| 315 void HTMLTextAreaElement::rendererWillBeDestroyed() | |
| 316 { | |
| 317 updateValue(); | |
| 318 } | |
| 319 | |
| 320 void HTMLTextAreaElement::updateValue() const | 315 void HTMLTextAreaElement::updateValue() const |
| 321 { | 316 { |
| 322 if (formControlValueMatchesRenderer()) | 317 if (formControlValueMatchesRenderer()) |
| 323 return; | 318 return; |
| 324 | 319 |
| 325 ASSERT(renderer()); | 320 ASSERT(renderer()); |
| 326 m_value = innerTextValue(); | 321 m_value = innerTextValue(); |
| 327 const_cast<HTMLTextAreaElement*>(this)->setFormControlValueMatchesRenderer(t
rue); | 322 const_cast<HTMLTextAreaElement*>(this)->setFormControlValueMatchesRenderer(t
rue); |
| 328 const_cast<HTMLTextAreaElement*>(this)->notifyFormStateChanged(); | 323 const_cast<HTMLTextAreaElement*>(this)->notifyFormStateChanged(); |
| 329 m_isDirty = true; | 324 m_isDirty = true; |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 } | 521 } |
| 527 placeholder->setTextContent(placeholderText); | 522 placeholder->setTextContent(placeholderText); |
| 528 } | 523 } |
| 529 | 524 |
| 530 bool HTMLTextAreaElement::isInteractiveContent() const | 525 bool HTMLTextAreaElement::isInteractiveContent() const |
| 531 { | 526 { |
| 532 return true; | 527 return true; |
| 533 } | 528 } |
| 534 | 529 |
| 535 } | 530 } |
| OLD | NEW |