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

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

Issue 1208063002: [Autofill/Autocomplete Feature] Substring matching instead of prefix matching (Blink). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
« no previous file with comments | « no previous file | Source/core/html/HTMLTextFormControlElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 const AtomicString& selectionDirection() const; 73 const AtomicString& selectionDirection() const;
74 void setSelectionStart(int); 74 void setSelectionStart(int);
75 void setSelectionEnd(int); 75 void setSelectionEnd(int);
76 void setSelectionDirection(const String&); 76 void setSelectionDirection(const String&);
77 void select(NeedToDispatchSelectEvent = DispatchSelectEvent); 77 void select(NeedToDispatchSelectEvent = DispatchSelectEvent);
78 virtual void setRangeText(const String& replacement, ExceptionState&); 78 virtual void setRangeText(const String& replacement, ExceptionState&);
79 virtual void setRangeText(const String& replacement, unsigned start, unsigne d end, const String& selectionMode, ExceptionState&); 79 virtual void setRangeText(const String& replacement, unsigned start, unsigne d end, const String& selectionMode, ExceptionState&);
80 void setSelectionRange(int start, int end, const String& direction); 80 void setSelectionRange(int start, int end, const String& direction);
81 void setSelectionRange(int start, int end, TextFieldSelectionDirection = Sel ectionHasNoDirection, NeedToDispatchSelectEvent = DispatchSelectEvent, Selection Option = ChangeSelection); 81 void setSelectionRange(int start, int end, TextFieldSelectionDirection = Sel ectionHasNoDirection, NeedToDispatchSelectEvent = DispatchSelectEvent, Selection Option = ChangeSelection);
82 PassRefPtrWillBeRawPtr<Range> selection() const; 82 PassRefPtrWillBeRawPtr<Range> selection() const;
83 void setSuggestedValueStart(int start) { m_suggestedValueStartOffset = start ; }
84 int suggestedValueStart() const { return m_suggestedValueStartOffset; }
83 85
84 virtual bool supportsAutocapitalize() const = 0; 86 virtual bool supportsAutocapitalize() const = 0;
85 virtual const AtomicString& defaultAutocapitalize() const = 0; 87 virtual const AtomicString& defaultAutocapitalize() const = 0;
86 const AtomicString& autocapitalize() const; 88 const AtomicString& autocapitalize() const;
87 void setAutocapitalize(const AtomicString&); 89 void setAutocapitalize(const AtomicString&);
88 90
89 virtual void dispatchFormControlChangeEvent() override final; 91 virtual void dispatchFormControlChangeEvent() override final;
90 92
91 virtual String value() const = 0; 93 virtual String value() const = 0;
92 94
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 // Returns true if suggested value is empty. Used to check placeholder visib ility. 152 // Returns true if suggested value is empty. Used to check placeholder visib ility.
151 virtual bool isEmptySuggestedValue() const { return true; } 153 virtual bool isEmptySuggestedValue() const { return true; }
152 // Called in dispatchFocusEvent(), after placeholder process, before calling parent's dispatchFocusEvent(). 154 // Called in dispatchFocusEvent(), after placeholder process, before calling parent's dispatchFocusEvent().
153 virtual void handleFocusEvent(Element* /* oldFocusedNode */, WebFocusType) { } 155 virtual void handleFocusEvent(Element* /* oldFocusedNode */, WebFocusType) { }
154 // Called in dispatchBlurEvent(), after placeholder process, before calling parent's dispatchBlurEvent(). 156 // Called in dispatchBlurEvent(), after placeholder process, before calling parent's dispatchBlurEvent().
155 virtual void handleBlurEvent() { } 157 virtual void handleBlurEvent() { }
156 158
157 String m_textAsOfLastFormControlChangeEvent; 159 String m_textAsOfLastFormControlChangeEvent;
158 bool m_lastChangeWasUserEdit; 160 bool m_lastChangeWasUserEdit;
159 161
162 int m_suggestedValueStartOffset;
160 int m_cachedSelectionStart; 163 int m_cachedSelectionStart;
161 int m_cachedSelectionEnd; 164 int m_cachedSelectionEnd;
162 TextFieldSelectionDirection m_cachedSelectionDirection; 165 TextFieldSelectionDirection m_cachedSelectionDirection;
163 }; 166 };
164 167
165 inline bool isHTMLTextFormControlElement(const Element& element) 168 inline bool isHTMLTextFormControlElement(const Element& element)
166 { 169 {
167 return element.isTextFormControl(); 170 return element.isTextFormControl();
168 } 171 }
169 172
170 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLTextFormControlElement); 173 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLTextFormControlElement);
171 174
172 HTMLTextFormControlElement* enclosingTextFormControl(const Position&); 175 HTMLTextFormControlElement* enclosingTextFormControl(const Position&);
173 HTMLTextFormControlElement* enclosingTextFormControl(Node*); 176 HTMLTextFormControlElement* enclosingTextFormControl(Node*);
174 177
175 } // namespace 178 } // namespace
176 179
177 #endif 180 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/html/HTMLTextFormControlElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698