Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Side by Side Diff: Source/core/html/HTMLTextAreaElement.h

Issue 1181093009: Changed cols and rows to unsigned long for HTMLTextAreaElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update LayoutTests to handle unsigned values Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 19 matching lines...) Expand all
30 namespace blink { 30 namespace blink {
31 31
32 class BeforeTextInsertedEvent; 32 class BeforeTextInsertedEvent;
33 class ExceptionState; 33 class ExceptionState;
34 34
35 class CORE_EXPORT HTMLTextAreaElement final : public HTMLTextFormControlElement { 35 class CORE_EXPORT HTMLTextAreaElement final : public HTMLTextFormControlElement {
36 DEFINE_WRAPPERTYPEINFO(); 36 DEFINE_WRAPPERTYPEINFO();
37 public: 37 public:
38 static PassRefPtrWillBeRawPtr<HTMLTextAreaElement> create(Document&, HTMLFor mElement*); 38 static PassRefPtrWillBeRawPtr<HTMLTextAreaElement> create(Document&, HTMLFor mElement*);
39 39
40 int cols() const { return m_cols; } 40 unsigned cols() const { return m_cols; }
41 int rows() const { return m_rows; } 41 unsigned rows() const { return m_rows; }
42 42
43 bool shouldWrapText() const { return m_wrap != NoWrap; } 43 bool shouldWrapText() const { return m_wrap != NoWrap; }
44 44
45 virtual String value() const override; 45 virtual String value() const override;
46 void setValue(const String&, TextFieldEventBehavior = DispatchNoEvent); 46 void setValue(const String&, TextFieldEventBehavior = DispatchNoEvent);
47 String defaultValue() const; 47 String defaultValue() const;
48 void setDefaultValue(const String&); 48 void setDefaultValue(const String&);
49 int textLength() const { return value().length(); } 49 int textLength() const { return value().length(); }
50 int maxLength() const; 50 int maxLength() const;
51 int minLength() const; 51 int minLength() const;
52 void setMaxLength(int, ExceptionState&); 52 void setMaxLength(int, ExceptionState&);
53 void setMinLength(int, ExceptionState&); 53 void setMinLength(int, ExceptionState&);
54 54
55 String suggestedValue() const; 55 String suggestedValue() const;
56 void setSuggestedValue(const String&); 56 void setSuggestedValue(const String&);
57 57
58 // For ValidityState 58 // For ValidityState
59 virtual String validationMessage() const override; 59 virtual String validationMessage() const override;
60 virtual bool valueMissing() const override; 60 virtual bool valueMissing() const override;
61 virtual bool tooLong() const override; 61 virtual bool tooLong() const override;
62 virtual bool tooShort() const override; 62 virtual bool tooShort() const override;
63 bool isValidValue(const String&) const; 63 bool isValidValue(const String&) const;
64 64
65 void setCols(int); 65 void setCols(unsigned);
66 void setRows(int); 66 void setRows(unsigned);
67 67
68 private: 68 private:
69 HTMLTextAreaElement(Document&, HTMLFormElement*); 69 HTMLTextAreaElement(Document&, HTMLFormElement*);
70 70
71 enum WrapMethod { NoWrap, SoftWrap, HardWrap }; 71 enum WrapMethod { NoWrap, SoftWrap, HardWrap };
72 enum SetValueCommonOption { 72 enum SetValueCommonOption {
73 NotSetSelection, 73 NotSetSelection,
74 SetSeletion 74 SetSeletion
75 }; 75 };
76 76
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 129
130 virtual bool matchesReadOnlyPseudoClass() const override; 130 virtual bool matchesReadOnlyPseudoClass() const override;
131 virtual bool matchesReadWritePseudoClass() const override; 131 virtual bool matchesReadWritePseudoClass() const override;
132 virtual void copyNonAttributePropertiesFromElement(const Element&) override final; 132 virtual void copyNonAttributePropertiesFromElement(const Element&) override final;
133 133
134 // If the String* argument is 0, apply this->value(). 134 // If the String* argument is 0, apply this->value().
135 bool valueMissing(const String*) const; 135 bool valueMissing(const String*) const;
136 bool tooLong(const String*, NeedsToCheckDirtyFlag) const; 136 bool tooLong(const String*, NeedsToCheckDirtyFlag) const;
137 bool tooShort(const String*, NeedsToCheckDirtyFlag) const; 137 bool tooShort(const String*, NeedsToCheckDirtyFlag) const;
138 138
139 int m_rows; 139 unsigned m_rows;
140 int m_cols; 140 unsigned m_cols;
141 WrapMethod m_wrap; 141 WrapMethod m_wrap;
142 mutable String m_value; 142 mutable String m_value;
143 mutable bool m_isDirty; 143 mutable bool m_isDirty;
144 bool m_valueIsUpToDate; 144 bool m_valueIsUpToDate;
145 String m_suggestedValue; 145 String m_suggestedValue;
146 }; 146 };
147 147
148 } // namespace blink 148 } // namespace blink
149 149
150 #endif // HTMLTextAreaElement_h 150 #endif // HTMLTextAreaElement_h
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/HTMLTextAreaElement/rows-attribute-expected.txt ('k') | Source/core/html/HTMLTextAreaElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698