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

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

Issue 2270663002: Selection API of INPUT/TEXTAREA should not update FrameSelection without focusing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adjust more tests Created 4 years, 3 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 27 matching lines...) Expand all
38 enum TextFieldEventBehavior { DispatchNoEvent, DispatchChangeEvent, DispatchInpu tAndChangeEvent }; 38 enum TextFieldEventBehavior { DispatchNoEvent, DispatchChangeEvent, DispatchInpu tAndChangeEvent };
39 enum NeedToDispatchSelectEvent { DispatchSelectEvent, NotDispatchSelectEvent }; 39 enum NeedToDispatchSelectEvent { DispatchSelectEvent, NotDispatchSelectEvent };
40 40
41 class CORE_EXPORT HTMLTextFormControlElement : public HTMLFormControlElementWith State { 41 class CORE_EXPORT HTMLTextFormControlElement : public HTMLFormControlElementWith State {
42 public: 42 public:
43 // Common flag for HTMLInputElement::tooLong(), HTMLTextAreaElement::tooLong (), 43 // Common flag for HTMLInputElement::tooLong(), HTMLTextAreaElement::tooLong (),
44 // HTMLInputElement::tooShort() and HTMLTextAreaElement::tooShort(). 44 // HTMLInputElement::tooShort() and HTMLTextAreaElement::tooShort().
45 enum NeedsToCheckDirtyFlag {CheckDirtyFlag, IgnoreDirtyFlag}; 45 enum NeedsToCheckDirtyFlag {CheckDirtyFlag, IgnoreDirtyFlag};
46 // Option of setSelectionRange. 46 // Option of setSelectionRange.
47 enum SelectionOption { 47 enum SelectionOption {
48 ChangeSelection,
49 ChangeSelectionAndFocus, 48 ChangeSelectionAndFocus,
50 ChangeSelectionIfFocused, 49 ChangeSelectionIfFocused,
51 NotChangeSelection 50 NotChangeSelection
52 }; 51 };
53 52
54 ~HTMLTextFormControlElement() override; 53 ~HTMLTextFormControlElement() override;
55 54
56 void forwardEvent(Event*); 55 void forwardEvent(Event*);
57 56
58 57
(...skipping 12 matching lines...) Expand all
71 int selectionStart() const; 70 int selectionStart() const;
72 int selectionEnd() const; 71 int selectionEnd() const;
73 const AtomicString& selectionDirection() const; 72 const AtomicString& selectionDirection() const;
74 void setSelectionStart(int); 73 void setSelectionStart(int);
75 void setSelectionEnd(int); 74 void setSelectionEnd(int);
76 void setSelectionDirection(const String&); 75 void setSelectionDirection(const String&);
77 void select(NeedToDispatchSelectEvent = DispatchSelectEvent); 76 void select(NeedToDispatchSelectEvent = DispatchSelectEvent);
78 virtual void setRangeText(const String& replacement, ExceptionState&); 77 virtual void setRangeText(const String& replacement, ExceptionState&);
79 virtual void setRangeText(const String& replacement, unsigned start, unsigne d end, const String& selectionMode, ExceptionState&); 78 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); 79 void setSelectionRange(int start, int end, const String& direction);
81 void setSelectionRange(int start, int end, TextFieldSelectionDirection = Sel ectionHasNoDirection, NeedToDispatchSelectEvent = DispatchSelectEvent, Selection Option = ChangeSelection); 80 void setSelectionRange(int start, int end, TextFieldSelectionDirection = Sel ectionHasNoDirection, NeedToDispatchSelectEvent = DispatchSelectEvent, Selection Option = ChangeSelectionIfFocused);
82 Range* selection() const; 81 Range* selection() const;
83 82
84 virtual bool supportsAutocapitalize() const = 0; 83 virtual bool supportsAutocapitalize() const = 0;
85 virtual const AtomicString& defaultAutocapitalize() const = 0; 84 virtual const AtomicString& defaultAutocapitalize() const = 0;
86 const AtomicString& autocapitalize() const; 85 const AtomicString& autocapitalize() const;
87 void setAutocapitalize(const AtomicString&); 86 void setAutocapitalize(const AtomicString&);
88 87
89 void dispatchFormControlChangeEvent() final; 88 void dispatchFormControlChangeEvent() final;
90 89
91 virtual String value() const = 0; 90 virtual String value() const = 0;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 } 171 }
173 172
174 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLTextFormControlElement); 173 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLTextFormControlElement);
175 174
176 HTMLTextFormControlElement* enclosingTextFormControl(const Position&); 175 HTMLTextFormControlElement* enclosingTextFormControl(const Position&);
177 HTMLTextFormControlElement* enclosingTextFormControl(Node*); 176 HTMLTextFormControlElement* enclosingTextFormControl(Node*);
178 177
179 } // namespace blink 178 } // namespace blink
180 179
181 #endif 180 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698