| 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 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 | 518 |
| 519 if (tooShort()) | 519 if (tooShort()) |
| 520 return locale().validationMessageTooShortText(computeLengthForSubmission
(value()), minLength()); | 520 return locale().validationMessageTooShortText(computeLengthForSubmission
(value()), minLength()); |
| 521 | 521 |
| 522 return String(); | 522 return String(); |
| 523 } | 523 } |
| 524 | 524 |
| 525 bool HTMLTextAreaElement::valueMissing() const | 525 bool HTMLTextAreaElement::valueMissing() const |
| 526 { | 526 { |
| 527 // We should not call value() for performance. | 527 // We should not call value() for performance. |
| 528 return willValidate() && valueMissing(0); | 528 return willValidate() && valueMissing(nullptr); |
| 529 } | 529 } |
| 530 | 530 |
| 531 bool HTMLTextAreaElement::valueMissing(const String* value) const | 531 bool HTMLTextAreaElement::valueMissing(const String* value) const |
| 532 { | 532 { |
| 533 return isRequiredFormControl() && !isDisabledOrReadOnly() && (value ? *value
: this->value()).isEmpty(); | 533 return isRequiredFormControl() && !isDisabledOrReadOnly() && (value ? *value
: this->value()).isEmpty(); |
| 534 } | 534 } |
| 535 | 535 |
| 536 bool HTMLTextAreaElement::tooLong() const | 536 bool HTMLTextAreaElement::tooLong() const |
| 537 { | 537 { |
| 538 // We should not call value() for performance. | 538 // We should not call value() for performance. |
| 539 return willValidate() && tooLong(0, CheckDirtyFlag); | 539 return willValidate() && tooLong(nullptr, CheckDirtyFlag); |
| 540 } | 540 } |
| 541 | 541 |
| 542 bool HTMLTextAreaElement::tooShort() const | 542 bool HTMLTextAreaElement::tooShort() const |
| 543 { | 543 { |
| 544 // We should not call value() for performance. | 544 // We should not call value() for performance. |
| 545 return willValidate() && tooShort(0, CheckDirtyFlag); | 545 return willValidate() && tooShort(nullptr, CheckDirtyFlag); |
| 546 } | 546 } |
| 547 | 547 |
| 548 bool HTMLTextAreaElement::tooLong(const String* value, NeedsToCheckDirtyFlag che
ck) const | 548 bool HTMLTextAreaElement::tooLong(const String* value, NeedsToCheckDirtyFlag che
ck) const |
| 549 { | 549 { |
| 550 // Return false for the default value or value set by script even if it is | 550 // Return false for the default value or value set by script even if it is |
| 551 // longer than maxLength. | 551 // longer than maxLength. |
| 552 if (check == CheckDirtyFlag && !lastChangeWasUserEdit()) | 552 if (check == CheckDirtyFlag && !lastChangeWasUserEdit()) |
| 553 return false; | 553 return false; |
| 554 | 554 |
| 555 int max = maxLength(); | 555 int max = maxLength(); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 { | 626 { |
| 627 return true; | 627 return true; |
| 628 } | 628 } |
| 629 | 629 |
| 630 bool HTMLTextAreaElement::supportsAutofocus() const | 630 bool HTMLTextAreaElement::supportsAutofocus() const |
| 631 { | 631 { |
| 632 return true; | 632 return true; |
| 633 } | 633 } |
| 634 | 634 |
| 635 } | 635 } |
| OLD | NEW |