| 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(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 void rendererWillBeDestroyed(); | 57 void rendererWillBeDestroyed(); |
| 58 | 58 |
| 59 void setCols(int); | 59 void setCols(int); |
| 60 void setRows(int); | 60 void setRows(int); |
| 61 | 61 |
| 62 private: | 62 private: |
| 63 HTMLTextAreaElement(const QualifiedName&, Document&, HTMLFormElement*); | 63 HTMLTextAreaElement(Document&, HTMLFormElement*); |
| 64 | 64 |
| 65 enum WrapMethod { NoWrap, SoftWrap, HardWrap }; | 65 enum WrapMethod { NoWrap, SoftWrap, HardWrap }; |
| 66 | 66 |
| 67 virtual void didAddUserAgentShadowRoot(ShadowRoot&) OVERRIDE; | 67 virtual void didAddUserAgentShadowRoot(ShadowRoot&) OVERRIDE; |
| 68 // FIXME: Author shadows should be allowed | 68 // FIXME: Author shadows should be allowed |
| 69 // https://bugs.webkit.org/show_bug.cgi?id=92608 | 69 // https://bugs.webkit.org/show_bug.cgi?id=92608 |
| 70 virtual bool areAuthorShadowsAllowed() const OVERRIDE { return false; } | 70 virtual bool areAuthorShadowsAllowed() const OVERRIDE { return false; } |
| 71 | 71 |
| 72 void handleBeforeTextInsertedEvent(BeforeTextInsertedEvent*) const; | 72 void handleBeforeTextInsertedEvent(BeforeTextInsertedEvent*) const; |
| 73 static String sanitizeUserInputValue(const String&, unsigned maxLength); | 73 static String sanitizeUserInputValue(const String&, unsigned maxLength); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 inline bool isHTMLTextAreaElement(const Element* element) | 135 inline bool isHTMLTextAreaElement(const Element* element) |
| 136 { | 136 { |
| 137 return element->hasTagName(HTMLNames::textareaTag); | 137 return element->hasTagName(HTMLNames::textareaTag); |
| 138 } | 138 } |
| 139 | 139 |
| 140 DEFINE_NODE_TYPE_CASTS(HTMLTextAreaElement, hasTagName(HTMLNames::textareaTag)); | 140 DEFINE_NODE_TYPE_CASTS(HTMLTextAreaElement, hasTagName(HTMLNames::textareaTag)); |
| 141 | 141 |
| 142 } //namespace | 142 } //namespace |
| 143 | 143 |
| 144 #endif | 144 #endif |
| OLD | NEW |