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) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "core/html/HTMLTextFormControlElement.h" | 27 #include "core/html/HTMLTextFormControlElement.h" |
28 | 28 |
29 namespace WebCore { | 29 namespace WebCore { |
30 | 30 |
31 class BeforeTextInsertedEvent; | 31 class BeforeTextInsertedEvent; |
32 class ExceptionState; | 32 class ExceptionState; |
33 class VisibleSelection; | 33 class VisibleSelection; |
34 | 34 |
35 class HTMLTextAreaElement FINAL : public HTMLTextFormControlElement { | 35 class HTMLTextAreaElement FINAL : public HTMLTextFormControlElement { |
36 public: | 36 public: |
37 static PassRefPtr<HTMLTextAreaElement> create(const QualifiedName&, Document
*, HTMLFormElement*); | 37 static PassRefPtr<HTMLTextAreaElement> create(const QualifiedName&, Document
&, HTMLFormElement*); |
38 | 38 |
39 int cols() const { return m_cols; } | 39 int cols() const { return m_cols; } |
40 int rows() const { return m_rows; } | 40 int rows() const { return m_rows; } |
41 | 41 |
42 bool shouldWrapText() const { return m_wrap != NoWrap; } | 42 bool shouldWrapText() const { return m_wrap != NoWrap; } |
43 | 43 |
44 virtual String value() const; | 44 virtual String value() const; |
45 void setValue(const String&); | 45 void setValue(const String&); |
46 String defaultValue() const; | 46 String defaultValue() const; |
47 void setDefaultValue(const String&); | 47 void setDefaultValue(const String&); |
48 int textLength() const { return value().length(); } | 48 int textLength() const { return value().length(); } |
49 virtual int maxLength() const; | 49 virtual int maxLength() const; |
50 void setMaxLength(int, ExceptionState&); | 50 void setMaxLength(int, ExceptionState&); |
51 // For ValidityState | 51 // For ValidityState |
52 virtual String validationMessage() const OVERRIDE; | 52 virtual String validationMessage() const OVERRIDE; |
53 virtual bool valueMissing() const OVERRIDE; | 53 virtual bool valueMissing() const OVERRIDE; |
54 virtual bool tooLong() const OVERRIDE; | 54 virtual bool tooLong() const OVERRIDE; |
55 bool isValidValue(const String&) const; | 55 bool isValidValue(const String&) const; |
56 | 56 |
57 virtual HTMLElement* innerTextElement() const; | 57 virtual HTMLElement* innerTextElement() const; |
58 | 58 |
59 void rendererWillBeDestroyed(); | 59 void rendererWillBeDestroyed(); |
60 | 60 |
61 void setCols(int); | 61 void setCols(int); |
62 void setRows(int); | 62 void setRows(int); |
63 | 63 |
64 private: | 64 private: |
65 HTMLTextAreaElement(const QualifiedName&, Document*, HTMLFormElement*); | 65 HTMLTextAreaElement(const QualifiedName&, Document&, HTMLFormElement*); |
66 | 66 |
67 enum WrapMethod { NoWrap, SoftWrap, HardWrap }; | 67 enum WrapMethod { NoWrap, SoftWrap, HardWrap }; |
68 | 68 |
69 virtual void didAddUserAgentShadowRoot(ShadowRoot*) OVERRIDE; | 69 virtual void didAddUserAgentShadowRoot(ShadowRoot*) OVERRIDE; |
70 | 70 |
71 void handleBeforeTextInsertedEvent(BeforeTextInsertedEvent*) const; | 71 void handleBeforeTextInsertedEvent(BeforeTextInsertedEvent*) const; |
72 static String sanitizeUserInputValue(const String&, unsigned maxLength); | 72 static String sanitizeUserInputValue(const String&, unsigned maxLength); |
73 void updateValue() const; | 73 void updateValue() const; |
74 void setNonDirtyValue(const String&); | 74 void setNonDirtyValue(const String&); |
75 void setValueCommon(const String&); | 75 void setValueCommon(const String&); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 139 |
140 inline HTMLTextAreaElement* toHTMLTextAreaElement(Node* node) | 140 inline HTMLTextAreaElement* toHTMLTextAreaElement(Node* node) |
141 { | 141 { |
142 ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLTextAreaElement(node)); | 142 ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLTextAreaElement(node)); |
143 return static_cast<HTMLTextAreaElement*>(node); | 143 return static_cast<HTMLTextAreaElement*>(node); |
144 } | 144 } |
145 | 145 |
146 } //namespace | 146 } //namespace |
147 | 147 |
148 #endif | 148 #endif |
OLD | NEW |