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

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

Issue 2277903003: Fix selectionDirection after setting value of TEXTAREA/INPUT. (Closed)
Patch Set: Created 4 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
Index: third_party/WebKit/Source/core/html/HTMLTextFormControlElement.h
diff --git a/third_party/WebKit/Source/core/html/HTMLTextFormControlElement.h b/third_party/WebKit/Source/core/html/HTMLTextFormControlElement.h
index b4e03dfba403de8dae408db3ade09efab1ee7c6e..aa19fe4631a779202e9d78b9303ef476f0646d72 100644
--- a/third_party/WebKit/Source/core/html/HTMLTextFormControlElement.h
+++ b/third_party/WebKit/Source/core/html/HTMLTextFormControlElement.h
@@ -115,14 +115,6 @@ protected:
void parseAttribute(const QualifiedName&, const AtomicString&, const AtomicString&) override;
- void cacheSelection(int start, int end, TextFieldSelectionDirection direction)
- {
- DCHECK_GE(start, 0);
- m_cachedSelectionStart = start;
- m_cachedSelectionEnd = end;
- m_cachedSelectionDirection = direction;
- }
-
void restoreCachedSelection();
void defaultEventHandler(Event*) override;
@@ -139,6 +131,13 @@ private:
int computeSelectionStart() const;
int computeSelectionEnd() const;
TextFieldSelectionDirection computeSelectionDirection() const;
+ void cacheSelection(int start, int end, TextFieldSelectionDirection direction)
+ {
+ DCHECK_GE(start, 0);
+ m_cachedSelectionStart = start;
yosin_UTC9 2016/08/25 08:10:22 nit: Could you add |DCHECK_LE(start, end)|?
tkent 2016/08/25 09:12:40 Done.
tkent 2016/08/25 10:21:03 editing/selection/select-across-readonly-input-1.h
+ m_cachedSelectionEnd = end;
+ m_cachedSelectionDirection = direction;
+ }
void dispatchFocusEvent(Element* oldFocusedElement, WebFocusType, InputDeviceCapabilities* sourceCapabilities) final;
void dispatchBlurEvent(Element* newFocusedElement, WebFocusType, InputDeviceCapabilities* sourceCapabilities) final;

Powered by Google App Engine
This is Rietveld 408576698