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 10 matching lines...) Expand all Loading... |
21 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 21 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
22 * Boston, MA 02110-1301, USA. | 22 * Boston, MA 02110-1301, USA. |
23 * | 23 * |
24 */ | 24 */ |
25 | 25 |
26 #include "config.h" | 26 #include "config.h" |
27 #include "core/html/HTMLTextAreaElement.h" | 27 #include "core/html/HTMLTextAreaElement.h" |
28 | 28 |
29 #include "CSSValueKeywords.h" | 29 #include "CSSValueKeywords.h" |
30 #include "HTMLNames.h" | 30 #include "HTMLNames.h" |
31 #include "bindings/v8/ExceptionMessages.h" | |
32 #include "bindings/v8/ExceptionState.h" | 31 #include "bindings/v8/ExceptionState.h" |
33 #include "bindings/v8/ExceptionStatePlaceholder.h" | 32 #include "bindings/v8/ExceptionStatePlaceholder.h" |
34 #include "core/dom/Document.h" | 33 #include "core/dom/Document.h" |
35 #include "core/dom/ExceptionCode.h" | 34 #include "core/dom/ExceptionCode.h" |
36 #include "core/dom/Text.h" | 35 #include "core/dom/Text.h" |
37 #include "core/dom/shadow/ShadowRoot.h" | 36 #include "core/dom/shadow/ShadowRoot.h" |
38 #include "core/editing/FrameSelection.h" | 37 #include "core/editing/FrameSelection.h" |
39 #include "core/editing/SpellChecker.h" | 38 #include "core/editing/SpellChecker.h" |
40 #include "core/editing/TextIterator.h" | 39 #include "core/editing/TextIterator.h" |
41 #include "core/events/BeforeTextInsertedEvent.h" | 40 #include "core/events/BeforeTextInsertedEvent.h" |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 int HTMLTextAreaElement::maxLength() const | 421 int HTMLTextAreaElement::maxLength() const |
423 { | 422 { |
424 bool ok; | 423 bool ok; |
425 int value = getAttribute(maxlengthAttr).string().toInt(&ok); | 424 int value = getAttribute(maxlengthAttr).string().toInt(&ok); |
426 return ok && value >= 0 ? value : -1; | 425 return ok && value >= 0 ? value : -1; |
427 } | 426 } |
428 | 427 |
429 void HTMLTextAreaElement::setMaxLength(int newValue, ExceptionState& exceptionSt
ate) | 428 void HTMLTextAreaElement::setMaxLength(int newValue, ExceptionState& exceptionSt
ate) |
430 { | 429 { |
431 if (newValue < 0) | 430 if (newValue < 0) |
432 exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::fail
edToSet("maxLength", "HTMLTextAreaElement", "The value provided (" + String::num
ber(newValue) + ") is not positive or 0.")); | 431 exceptionState.throwDOMException(IndexSizeError, "The value provided ("
+ String::number(newValue) + ") is not positive or 0."); |
433 else | 432 else |
434 setIntegralAttribute(maxlengthAttr, newValue); | 433 setIntegralAttribute(maxlengthAttr, newValue); |
435 } | 434 } |
436 | 435 |
437 String HTMLTextAreaElement::validationMessage() const | 436 String HTMLTextAreaElement::validationMessage() const |
438 { | 437 { |
439 if (!willValidate()) | 438 if (!willValidate()) |
440 return String(); | 439 return String(); |
441 | 440 |
442 if (customError()) | 441 if (customError()) |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 } | 526 } |
528 placeholder->setTextContent(placeholderText, ASSERT_NO_EXCEPTION); | 527 placeholder->setTextContent(placeholderText, ASSERT_NO_EXCEPTION); |
529 } | 528 } |
530 | 529 |
531 bool HTMLTextAreaElement::isInteractiveContent() const | 530 bool HTMLTextAreaElement::isInteractiveContent() const |
532 { | 531 { |
533 return true; | 532 return true; |
534 } | 533 } |
535 | 534 |
536 } | 535 } |
OLD | NEW |