| Index: Source/core/editing/FrameSelection.h
|
| diff --git a/Source/core/editing/FrameSelection.h b/Source/core/editing/FrameSelection.h
|
| index 282ddc7fe62a8f6820eec61e017efe5f1511f6c5..0fcc0e623fa491fdebb9bf25ba5770d827409597 100644
|
| --- a/Source/core/editing/FrameSelection.h
|
| +++ b/Source/core/editing/FrameSelection.h
|
| @@ -41,6 +41,7 @@ namespace blink {
|
|
|
| class CharacterData;
|
| class LocalFrame;
|
| +class GranularityStrategy;
|
| class GraphicsContext;
|
| class HTMLFormElement;
|
| class Text;
|
| @@ -74,6 +75,7 @@ public:
|
| SpellCorrectionTriggered = 1 << 3,
|
| DoNotSetFocus = 1 << 4,
|
| DoNotUpdateAppearance = 1 << 5,
|
| + DoNotClearStrategy = 1 << 6,
|
| };
|
| typedef unsigned SetSelectionOptions; // Union of values in SetSelectionOption and EUserTriggered
|
| static inline EUserTriggered selectionOptionsToUserTriggered(SetSelectionOptions options)
|
| @@ -122,8 +124,11 @@ public:
|
| bool modify(EAlteration, SelectionDirection, TextGranularity, EUserTriggered = NotUserTriggered);
|
| enum VerticalDirection { DirectionUp, DirectionDown };
|
| bool modify(EAlteration, unsigned verticalDistance, VerticalDirection, EUserTriggered = NotUserTriggered, CursorAlignOnScroll = AlignCursorOnScrollIfNeeded);
|
| - // Currently we support only CharaterGranularity and WordGranurarity.
|
| - void moveRangeSelectionExtent(const VisiblePosition&, TextGranularity);
|
| +
|
| + // Moves the selection extent based on the selection granularity strategy.
|
| + // This function does not allow the selection to collapse. If the new extent
|
| + // is set to the same position as the current base, this function will do nothing.
|
| + void moveRangeSelectionExtent(const VisiblePosition&);
|
| void moveRangeSelection(const VisiblePosition& base, const VisiblePosition& extent, TextGranularity);
|
|
|
| TextGranularity granularity() const { return m_granularity; }
|
| @@ -271,6 +276,8 @@ private:
|
|
|
| VisibleSelection validateSelection(const VisibleSelection&);
|
|
|
| + GranularityStrategy& granularityStrategy();
|
| +
|
| RawPtrWillBeMember<LocalFrame> m_frame;
|
|
|
| LayoutUnit m_xPosForVerticalArrowNavigation;
|
| @@ -297,6 +304,9 @@ private:
|
| bool m_isCaretBlinkingSuspended : 1;
|
| bool m_focused : 1;
|
| bool m_shouldShowBlockCursor : 1;
|
| +
|
| + // Controls text granularity used to adjust the selection's extent in moveRangeSelectionExtent.
|
| + OwnPtr<GranularityStrategy> m_granularityStrategy;
|
| };
|
|
|
| inline EditingStyle* FrameSelection::typingStyle() const
|
|
|