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

Unified Diff: Source/core/html/HTMLTextFormControlElement.h

Issue 1269263003: The start and end arguments should be unsigned long in setSelectionRange() function Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/HTMLTextAreaElement.idl ('k') | Source/core/html/HTMLTextFormControlElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLTextFormControlElement.h
diff --git a/Source/core/html/HTMLTextFormControlElement.h b/Source/core/html/HTMLTextFormControlElement.h
index 906661dfbc87adbeddf081002595d84ecfed4abc..027bd1282b513be13926174055ded455a8c9d281 100644
--- a/Source/core/html/HTMLTextFormControlElement.h
+++ b/Source/core/html/HTMLTextFormControlElement.h
@@ -68,8 +68,8 @@ public:
VisiblePosition visiblePositionForIndex(int) const;
int indexForVisiblePosition(const VisiblePosition&) const;
- int selectionStart() const;
- int selectionEnd() const;
+ unsigned selectionStart() const;
+ unsigned selectionEnd() const;
const AtomicString& selectionDirection() const;
void setSelectionStart(int);
void setSelectionEnd(int);
@@ -77,8 +77,8 @@ public:
void select(NeedToDispatchSelectEvent = DispatchSelectEvent);
virtual void setRangeText(const String& replacement, ExceptionState&);
virtual void setRangeText(const String& replacement, unsigned start, unsigned end, const String& selectionMode, ExceptionState&);
- void setSelectionRange(int start, int end, const String& direction);
- void setSelectionRange(int start, int end, TextFieldSelectionDirection = SelectionHasNoDirection, NeedToDispatchSelectEvent = DispatchSelectEvent, SelectionOption = ChangeSelection);
+ void setSelectionRange(unsigned start, unsigned end, const String& direction);
+ void setSelectionRange(unsigned start, unsigned end, TextFieldSelectionDirection = SelectionHasNoDirection, NeedToDispatchSelectEvent = DispatchSelectEvent, SelectionOption = ChangeSelection);
PassRefPtrWillBeRawPtr<Range> selection() const;
virtual bool supportsAutocapitalize() const = 0;
@@ -116,9 +116,8 @@ protected:
void parseAttribute(const QualifiedName&, const AtomicString&) override;
- void cacheSelection(int start, int end, TextFieldSelectionDirection direction)
+ void cacheSelection(unsigned start, unsigned end, TextFieldSelectionDirection direction)
{
- ASSERT(start >= 0);
m_cachedSelectionStart = start;
m_cachedSelectionEnd = end;
m_cachedSelectionDirection = direction;
@@ -137,8 +136,8 @@ protected:
void copyNonAttributePropertiesFromElement(const Element&) override;
private:
- int computeSelectionStart() const;
- int computeSelectionEnd() const;
+ unsigned computeSelectionStart() const;
+ unsigned computeSelectionEnd() const;
TextFieldSelectionDirection computeSelectionDirection() const;
void dispatchFocusEvent(Element* oldFocusedElement, WebFocusType, InputDevice* sourceDevice) final;
@@ -157,8 +156,8 @@ private:
String m_textAsOfLastFormControlChangeEvent;
bool m_lastChangeWasUserEdit;
- int m_cachedSelectionStart;
- int m_cachedSelectionEnd;
+ unsigned m_cachedSelectionStart;
+ unsigned m_cachedSelectionEnd;
TextFieldSelectionDirection m_cachedSelectionDirection;
};
« no previous file with comments | « Source/core/html/HTMLTextAreaElement.idl ('k') | Source/core/html/HTMLTextFormControlElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698