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

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

Issue 2201853002: Blink handle selection handle visibility (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: try running even rebaseline tests Created 4 years, 2 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/VisibleSelection.h
diff --git a/third_party/WebKit/Source/core/editing/VisibleSelection.h b/third_party/WebKit/Source/core/editing/VisibleSelection.h
index 282f0666f72d8e1803d0e3a41f87abbb3e8b3ab5..6c5fce977f6990eab0cd0719e8c318bfac0129a7 100644
--- a/third_party/WebKit/Source/core/editing/VisibleSelection.h
+++ b/third_party/WebKit/Source/core/editing/VisibleSelection.h
@@ -65,12 +65,18 @@ class CORE_TEMPLATE_CLASS_EXPORT VisibleSelectionTemplate {
const PositionTemplate<Strategy>& base,
const PositionTemplate<Strategy>& extent,
TextAffinity,
- bool isDirectional);
+ bool isDirectional,
+ bool isHandleVisible);
yosin_UTC9 2016/10/07 05:17:59 Please move |isHandleVisible| to |FrameSelection|.
amaralp 2016/10/14 00:53:07 Moved.
static VisibleSelectionTemplate selectionFromContentsOfNode(Node*);
SelectionType getSelectionType() const { return m_selectionType; }
+ void setIsHandleVisible(bool isHandleVisible) {
+ m_isHandleVisible = isHandleVisible;
+ }
+ bool isHandleVisible() const { return m_isHandleVisible; }
+
void setAffinity(TextAffinity affinity) { m_affinity = affinity; }
TextAffinity affinity() const { return m_affinity; }
@@ -176,7 +182,8 @@ class CORE_TEMPLATE_CLASS_EXPORT VisibleSelectionTemplate {
VisibleSelectionTemplate(const PositionTemplate<Strategy>& base,
const PositionTemplate<Strategy>& extent,
TextAffinity,
- bool isDirectional);
+ bool isDirectional,
+ bool isHandleVisible);
void validate(TextGranularity = CharacterGranularity);
@@ -217,6 +224,7 @@ class CORE_TEMPLATE_CLASS_EXPORT VisibleSelectionTemplate {
// TODO(yosin): Once we unify start/end and base/extent, we should get rid
// of |m_hasTrailingWhitespace|.
bool m_hasTrailingWhitespace : 1;
+ bool m_isHandleVisible : 1;
};
extern template class CORE_EXTERN_TEMPLATE_EXPORT
@@ -229,99 +237,127 @@ using VisibleSelectionInFlatTree =
VisibleSelectionTemplate<EditingInFlatTreeStrategy>;
// TODO(xiaochengh): Introduce builder class to get rid of these overloads.
-CORE_EXPORT VisibleSelection createVisibleSelection(const Position&,
- TextAffinity,
- bool isDirectional = false);
+CORE_EXPORT VisibleSelection
+createVisibleSelection(const Position&,
+ TextAffinity,
+ bool isDirectional = false,
+ bool isHandleVisible = false);
CORE_EXPORT VisibleSelection
createVisibleSelection(const Position& base,
const Position& extent,
TextAffinity = SelDefaultAffinity,
- bool isDirectional = false);
+ bool isDirectional = false,
+ bool isHandleVisible = false);
CORE_EXPORT VisibleSelection
createVisibleSelection(const EphemeralRange&,
TextAffinity = SelDefaultAffinity,
- bool isDirectional = false);
-CORE_EXPORT VisibleSelection createVisibleSelection(const VisiblePosition&,
- bool isDirectional = false);
-CORE_EXPORT VisibleSelection createVisibleSelection(const VisiblePosition&,
- const VisiblePosition&,
- bool isDirectional = false);
-CORE_EXPORT VisibleSelection createVisibleSelection(const PositionWithAffinity&,
- bool isDirectional = false);
+ bool isDirectional = false,
+ bool isHandleVisible = false);
+CORE_EXPORT VisibleSelection
+createVisibleSelection(const VisiblePosition&,
+ bool isDirectional = false,
+ bool isHandleVisible = false);
+CORE_EXPORT VisibleSelection
+createVisibleSelection(const VisiblePosition&,
+ const VisiblePosition&,
+ bool isDirectional = false,
+ bool isHandleVisible = false);
+CORE_EXPORT VisibleSelection
+createVisibleSelection(const PositionWithAffinity&,
+ bool isDirectional = false,
+ bool isHandleVisible = false);
CORE_EXPORT VisibleSelectionInFlatTree
createVisibleSelection(const PositionInFlatTree&,
TextAffinity,
- bool isDirectional = false);
+ bool isDirectional = false,
+ bool isHandleVisible = false);
CORE_EXPORT VisibleSelectionInFlatTree
createVisibleSelection(const PositionInFlatTree& base,
const PositionInFlatTree& extent,
TextAffinity = SelDefaultAffinity,
- bool isDirectional = false);
+ bool isDirectional = false,
+ bool isHandleVisible = false);
CORE_EXPORT VisibleSelectionInFlatTree
createVisibleSelection(const EphemeralRangeInFlatTree&,
TextAffinity = SelDefaultAffinity,
- bool isDirectional = false);
+ bool isDirectional = false,
+ bool isHandleVisible = false);
CORE_EXPORT VisibleSelectionInFlatTree
createVisibleSelection(const VisiblePositionInFlatTree&,
- bool isDirectional = false);
+ bool isDirectional = false,
+ bool isHandleVisible = false);
CORE_EXPORT VisibleSelectionInFlatTree
createVisibleSelection(const VisiblePositionInFlatTree&,
const VisiblePositionInFlatTree&,
- bool isDirectional = false);
+ bool isDirectional = false,
+ bool isHandleVisible = false);
CORE_EXPORT VisibleSelectionInFlatTree
createVisibleSelection(const PositionInFlatTreeWithAffinity&,
- bool isDirectional = false);
+ bool isDirectional = false,
+ bool isHandleVisible = false);
// Callers of these functions should ensure clean layout by themselves and then
// switch to the proper versions (to be introduced).
CORE_EXPORT VisibleSelection
createVisibleSelectionDeprecated(const Position&,
TextAffinity,
- bool isDirectional = false);
+ bool isDirectional = false,
+ bool isHandleVisible = false);
CORE_EXPORT VisibleSelection
createVisibleSelectionDeprecated(const Position& base,
const Position& extent,
TextAffinity = SelDefaultAffinity,
- bool isDirectional = false);
+ bool isDirectional = false,
+ bool isHandleVisible = false);
CORE_EXPORT VisibleSelection
createVisibleSelectionDeprecated(const EphemeralRange&,
TextAffinity = SelDefaultAffinity,
- bool isDirectional = false);
+ bool isDirectional = false,
+ bool isHandleVisible = false);
CORE_EXPORT VisibleSelection
createVisibleSelectionDeprecated(const VisiblePosition&,
- bool isDirectional = false);
+ bool isDirectional = false,
+ bool isHandleVisible = false);
CORE_EXPORT VisibleSelection
createVisibleSelectionDeprecated(const VisiblePosition&,
const VisiblePosition&,
- bool isDirectional = false);
+ bool isDirectional = false,
+ bool isHandleVisible = false);
CORE_EXPORT VisibleSelection
createVisibleSelectionDeprecated(const PositionWithAffinity&,
- bool isDirectional = false);
+ bool isDirectional = false,
+ bool isHandleVisible = false);
CORE_EXPORT VisibleSelectionInFlatTree
createVisibleSelectionDeprecated(const PositionInFlatTree&,
TextAffinity,
- bool isDirectional = false);
+ bool isDirectional = false,
+ bool isHandleVisible = false);
CORE_EXPORT VisibleSelectionInFlatTree
createVisibleSelectionDeprecated(const PositionInFlatTree& base,
const PositionInFlatTree& extent,
TextAffinity = SelDefaultAffinity,
- bool isDirectional = false);
+ bool isDirectional = false,
+ bool isHandleVisible = false);
CORE_EXPORT VisibleSelectionInFlatTree
createVisibleSelectionDeprecated(const EphemeralRangeInFlatTree&,
TextAffinity = SelDefaultAffinity,
- bool isDirectional = false);
+ bool isDirectional = false,
+ bool isHandleVisible = false);
CORE_EXPORT VisibleSelectionInFlatTree
createVisibleSelectionDeprecated(const VisiblePositionInFlatTree&,
- bool isDirectional = false);
+ bool isDirectional = false,
+ bool isHandleVisible = false);
CORE_EXPORT VisibleSelectionInFlatTree
createVisibleSelectionDeprecated(const VisiblePositionInFlatTree&,
const VisiblePositionInFlatTree&,
- bool isDirectional = false);
+ bool isDirectional = false,
+ bool isHandleVisible = false);
CORE_EXPORT VisibleSelectionInFlatTree
createVisibleSelectionDeprecated(const PositionInFlatTreeWithAffinity&,
- bool isDirectional = false);
+ bool isDirectional = false,
+ bool isHandleVisible = false);
// We don't yet support multi-range selections, so we only ever have one range
// to return.

Powered by Google App Engine
This is Rietveld 408576698