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

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

Issue 2268243002: Remove SelectionOption argument of HTMLTextFormControlElement::setSelectionRange(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove SelectionOption argument of HTMLTextFormControlElement::setSelectionRange(). 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 25 matching lines...) Expand all
36 36
37 enum TextFieldSelectionDirection { SelectionHasNoDirection, SelectionHasForwardD irection, SelectionHasBackwardDirection }; 37 enum TextFieldSelectionDirection { SelectionHasNoDirection, SelectionHasForwardD irection, SelectionHasBackwardDirection };
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.
47 enum SelectionOption {
48 ChangeSelectionAndFocus,
49 ChangeSelectionIfFocused,
50 NotChangeSelection
51 };
52 46
53 ~HTMLTextFormControlElement() override; 47 ~HTMLTextFormControlElement() override;
54 48
55 void forwardEvent(Event*); 49 void forwardEvent(Event*);
56 50
57 51
58 InsertionNotificationRequest insertedInto(ContainerNode*) override; 52 InsertionNotificationRequest insertedInto(ContainerNode*) override;
59 53
60 // The derived class should return true if placeholder processing is needed. 54 // The derived class should return true if placeholder processing is needed.
61 virtual bool isPlaceholderVisible() const = 0; 55 virtual bool isPlaceholderVisible() const = 0;
62 virtual void setPlaceholderVisibility(bool) = 0; 56 virtual void setPlaceholderVisibility(bool) = 0;
63 virtual bool supportsPlaceholder() const = 0; 57 virtual bool supportsPlaceholder() const = 0;
64 String strippedPlaceholder() const; 58 String strippedPlaceholder() const;
65 HTMLElement* placeholderElement() const; 59 HTMLElement* placeholderElement() const;
66 void updatePlaceholderVisibility(); 60 void updatePlaceholderVisibility();
67 61
68 VisiblePosition visiblePositionForIndex(int) const; 62 VisiblePosition visiblePositionForIndex(int) const;
69 int indexForVisiblePosition(const VisiblePosition&) const; 63 int indexForVisiblePosition(const VisiblePosition&) const;
70 int selectionStart() const; 64 int selectionStart() const;
71 int selectionEnd() const; 65 int selectionEnd() const;
72 const AtomicString& selectionDirection() const; 66 const AtomicString& selectionDirection() const;
73 void setSelectionStart(int); 67 void setSelectionStart(int);
74 void setSelectionEnd(int); 68 void setSelectionEnd(int);
75 void setSelectionDirection(const String&); 69 void setSelectionDirection(const String&);
76 void select(NeedToDispatchSelectEvent = DispatchSelectEvent); 70 void select(NeedToDispatchSelectEvent = DispatchSelectEvent);
77 virtual void setRangeText(const String& replacement, ExceptionState&); 71 virtual void setRangeText(const String& replacement, ExceptionState&);
78 virtual void setRangeText(const String& replacement, unsigned start, unsigne d end, const String& selectionMode, ExceptionState&); 72 virtual void setRangeText(const String& replacement, unsigned start, unsigne d end, const String& selectionMode, ExceptionState&);
79 void setSelectionRange(int start, int end, const String& direction); 73 void setSelectionRange(int start, int end, const String& direction);
80 void setSelectionRange(int start, int end, TextFieldSelectionDirection = Sel ectionHasNoDirection, NeedToDispatchSelectEvent = DispatchSelectEvent, Selection Option = ChangeSelectionIfFocused); 74 void setSelectionRange(int start, int end, TextFieldSelectionDirection = Sel ectionHasNoDirection, NeedToDispatchSelectEvent = DispatchSelectEvent);
81 Range* selection() const; 75 Range* selection() const;
82 76
83 virtual bool supportsAutocapitalize() const = 0; 77 virtual bool supportsAutocapitalize() const = 0;
84 virtual const AtomicString& defaultAutocapitalize() const = 0; 78 virtual const AtomicString& defaultAutocapitalize() const = 0;
85 const AtomicString& autocapitalize() const; 79 const AtomicString& autocapitalize() const;
86 void setAutocapitalize(const AtomicString&); 80 void setAutocapitalize(const AtomicString&);
87 81
88 void dispatchFormControlChangeEvent() final; 82 void dispatchFormControlChangeEvent() final;
89 83
90 virtual String value() const = 0; 84 virtual String value() const = 0;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 } 165 }
172 166
173 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLTextFormControlElement); 167 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLTextFormControlElement);
174 168
175 HTMLTextFormControlElement* enclosingTextFormControl(const Position&); 169 HTMLTextFormControlElement* enclosingTextFormControl(const Position&);
176 HTMLTextFormControlElement* enclosingTextFormControl(Node*); 170 HTMLTextFormControlElement* enclosingTextFormControl(Node*);
177 171
178 } // namespace blink 172 } // namespace blink
179 173
180 #endif 174 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698