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

Side by Side Diff: Source/core/editing/VisibleSelection.h

Issue 15017002: WebFrame::selectRange and moveCaret should behave like mouse selection (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address comment Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2004 Apple Computer, Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 13 matching lines...) Expand all
24 */ 24 */
25 25
26 #ifndef VisibleSelection_h 26 #ifndef VisibleSelection_h
27 #define VisibleSelection_h 27 #define VisibleSelection_h
28 28
29 #include "core/editing/TextGranularity.h" 29 #include "core/editing/TextGranularity.h"
30 #include "core/editing/VisiblePosition.h" 30 #include "core/editing/VisiblePosition.h"
31 31
32 namespace WebCore { 32 namespace WebCore {
33 33
34 class LayoutPoint;
34 class Position; 35 class Position;
35 36
36 const EAffinity SEL_DEFAULT_AFFINITY = DOWNSTREAM; 37 const EAffinity SEL_DEFAULT_AFFINITY = DOWNSTREAM;
37 enum SelectionDirection { DirectionForward, DirectionBackward, DirectionRight, D irectionLeft }; 38 enum SelectionDirection { DirectionForward, DirectionBackward, DirectionRight, D irectionLeft };
38 39
39 class VisibleSelection { 40 class VisibleSelection {
40 public: 41 public:
41 enum SelectionType { NoSelection, CaretSelection, RangeSelection }; 42 enum SelectionType { NoSelection, CaretSelection, RangeSelection };
42 43
43 VisibleSelection(); 44 VisibleSelection();
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 PassRefPtr<Range> toNormalizedRange() const; 99 PassRefPtr<Range> toNormalizedRange() const;
99 100
100 Element* rootEditableElement() const; 101 Element* rootEditableElement() const;
101 bool isContentEditable() const; 102 bool isContentEditable() const;
102 bool rendererIsEditable() const; 103 bool rendererIsEditable() const;
103 bool isContentRichlyEditable() const; 104 bool isContentRichlyEditable() const;
104 // Returns a shadow tree node for legacy shadow trees, a child of the 105 // Returns a shadow tree node for legacy shadow trees, a child of the
105 // ShadowRoot node for new shadow trees, or 0 for non-shadow trees. 106 // ShadowRoot node for new shadow trees, or 0 for non-shadow trees.
106 Node* nonBoundaryShadowTreeRootNode() const; 107 Node* nonBoundaryShadowTreeRootNode() const;
107 108
109 VisiblePosition visiblePositionRespectingEditingBoundary(const LayoutPoint& localPoint, Node* targetNode) const;
110
111
108 #ifndef NDEBUG 112 #ifndef NDEBUG
109 void debugPosition() const; 113 void debugPosition() const;
110 void formatForDebugger(char* buffer, unsigned length) const; 114 void formatForDebugger(char* buffer, unsigned length) const;
111 void showTreeForThis() const; 115 void showTreeForThis() const;
112 #endif 116 #endif
113 117
114 void setWithoutValidation(const Position&, const Position&); 118 void setWithoutValidation(const Position&, const Position&);
115 119
116 private: 120 private:
117 void validate(TextGranularity = CharacterGranularity); 121 void validate(TextGranularity = CharacterGranularity);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 158
155 } // namespace WebCore 159 } // namespace WebCore
156 160
157 #ifndef NDEBUG 161 #ifndef NDEBUG
158 // Outside the WebCore namespace for ease of invocation from gdb. 162 // Outside the WebCore namespace for ease of invocation from gdb.
159 void showTree(const WebCore::VisibleSelection&); 163 void showTree(const WebCore::VisibleSelection&);
160 void showTree(const WebCore::VisibleSelection*); 164 void showTree(const WebCore::VisibleSelection*);
161 #endif 165 #endif
162 166
163 #endif // VisibleSelection_h 167 #endif // VisibleSelection_h
OLDNEW
« no previous file with comments | « Source/WebKit/chromium/tests/data/select_range_span_editable.html ('k') | Source/core/editing/VisibleSelection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698