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

Unified Diff: third_party/WebKit/Source/core/editing/FrameSelection.h

Issue 2709983005: Selection API: Do not change focus by Selection functions. (Closed)
Patch Set: . Created 3 years, 10 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/editing/FrameSelection.h
diff --git a/third_party/WebKit/Source/core/editing/FrameSelection.h b/third_party/WebKit/Source/core/editing/FrameSelection.h
index 2e8a12df037fd6b5886b930713f5009ac1964cce..4680b75833864e1f5df792f3a8e4667fb8ac5bb6 100644
--- a/third_party/WebKit/Source/core/editing/FrameSelection.h
+++ b/third_party/WebKit/Source/core/editing/FrameSelection.h
@@ -119,6 +119,8 @@ class CORE_EXPORT FrameSelection final
// layout.
const VisibleSelection& computeVisibleSelectionInDOMTreeDeprecated() const;
+ // setSelection() and setSelectedRange() functions may dispatch focus-related
+ // synchronous events unless DoNotSetFocus is specified.
void setSelection(const SelectionInDOMTree&,
SetSelectionOptions = CloseTyping | ClearTypingStyle,
CursorAlignOnScroll = CursorAlignOnScroll::IfNeeded,
@@ -149,7 +151,10 @@ class CORE_EXPORT FrameSelection final
TextAffinity,
SelectionDirectionalMode = SelectionDirectionalMode::NonDirectional,
FrameSelection::SetSelectionOptions = CloseTyping | ClearTypingStyle);
+
+ // selectAll() may dispatch focus-related synchronous events.
void selectAll();
+
void clear();
// Call this after doing user-triggered selections to make it easy to delete
@@ -158,10 +163,15 @@ class CORE_EXPORT FrameSelection final
bool contains(const LayoutPoint&);
+ // This function may dispatch focus-related synchronous events unless
+ // DoNotSetFocus is specified.
+ //
+ // |noFocusFlag| must be 0 or SetSelectionOptions::DoNotSetFocus.
bool modify(EAlteration,
SelectionDirection,
TextGranularity,
- EUserTriggered = NotUserTriggered);
+ EUserTriggered = NotUserTriggered,
+ SetSelectionOptions noFocusFlag = 0);
enum VerticalDirection { DirectionUp, DirectionDown };
bool modify(EAlteration, unsigned verticalDistance, VerticalDirection);

Powered by Google App Engine
This is Rietveld 408576698