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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLTextFormControlElement.h

Issue 1785603002: TEXTAREA: Cutting last line without EOL should not remove the remaining EOL in the previous line. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove an ASSERT, update a comment Created 4 years, 9 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, 2008, 2009, 2010 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
6 * Copyright (C) 2009, 2010, 2011 Google Inc. All rights reserved. 6 * Copyright (C) 2009, 2010, 2011 Google Inc. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 90
91 virtual String value() const = 0; 91 virtual String value() const = 0;
92 virtual void setValue(const String&, TextFieldEventBehavior = DispatchNoEven t) = 0; 92 virtual void setValue(const String&, TextFieldEventBehavior = DispatchNoEven t) = 0;
93 93
94 HTMLElement* innerEditorElement() const; 94 HTMLElement* innerEditorElement() const;
95 95
96 void selectionChanged(bool userTriggered); 96 void selectionChanged(bool userTriggered);
97 bool lastChangeWasUserEdit() const; 97 bool lastChangeWasUserEdit() const;
98 virtual void setInnerEditorValue(const String&); 98 virtual void setInnerEditorValue(const String&);
99 String innerEditorValue() const; 99 String innerEditorValue() const;
100 PassRefPtrWillBeRawPtr<Node> createPlaceholderBreakElement() const;
100 101
101 String directionForFormData() const; 102 String directionForFormData() const;
102 103
103 void setTextAsOfLastFormControlChangeEvent(const String& text) { m_textAsOfL astFormControlChangeEvent = text; } 104 void setTextAsOfLastFormControlChangeEvent(const String& text) { m_textAsOfL astFormControlChangeEvent = text; }
104 105
105 // These functions don't cause synchronous layout and SpellChecker uses 106 // These functions don't cause synchronous layout and SpellChecker uses
106 // them to improve performance. 107 // them to improve performance.
107 // Passed |Position| must point inside of a text form control. 108 // Passed |Position| must point inside of a text form control.
108 static Position startOfWord(const Position&); 109 static Position startOfWord(const Position&);
109 static Position endOfWord(const Position&); 110 static Position endOfWord(const Position&);
(...skipping 14 matching lines...) Expand all
124 m_cachedSelectionEnd = end; 125 m_cachedSelectionEnd = end;
125 m_cachedSelectionDirection = direction; 126 m_cachedSelectionDirection = direction;
126 } 127 }
127 128
128 void restoreCachedSelection(); 129 void restoreCachedSelection();
129 130
130 void defaultEventHandler(Event*) override; 131 void defaultEventHandler(Event*) override;
131 virtual void subtreeHasChanged() = 0; 132 virtual void subtreeHasChanged() = 0;
132 133
133 void setLastChangeWasNotUserEdit() { m_lastChangeWasUserEdit = false; } 134 void setLastChangeWasNotUserEdit() { m_lastChangeWasUserEdit = false; }
134 135 void addPlaceholderBreakElementIfNecessary();
135 String valueWithHardLineBreaks() const; 136 String valueWithHardLineBreaks() const;
136 137
137 virtual bool shouldDispatchFormControlChangeEvent(String&, String&); 138 virtual bool shouldDispatchFormControlChangeEvent(String&, String&);
138 void copyNonAttributePropertiesFromElement(const Element&) override; 139 void copyNonAttributePropertiesFromElement(const Element&) override;
139 140
140 private: 141 private:
141 int computeSelectionStart() const; 142 int computeSelectionStart() const;
142 int computeSelectionEnd() const; 143 int computeSelectionEnd() const;
143 TextFieldSelectionDirection computeSelectionDirection() const; 144 TextFieldSelectionDirection computeSelectionDirection() const;
144 145
(...skipping 26 matching lines...) Expand all
171 } 172 }
172 173
173 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLTextFormControlElement); 174 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLTextFormControlElement);
174 175
175 HTMLTextFormControlElement* enclosingTextFormControl(const Position&); 176 HTMLTextFormControlElement* enclosingTextFormControl(const Position&);
176 HTMLTextFormControlElement* enclosingTextFormControl(Node*); 177 HTMLTextFormControlElement* enclosingTextFormControl(Node*);
177 178
178 } // namespace blink 179 } // namespace blink
179 180
180 #endif 181 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698