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

Side by Side Diff: third_party/WebKit/Source/core/editing/EphemeralRange.h

Issue 1409073004: Return EphemeralRange from Editor::findRangeOfString. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Extract text bounds collecting to a function Created 5 years, 1 month 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef EphemeralRange_h 5 #ifndef EphemeralRange_h
6 #define EphemeralRange_h 6 #define EphemeralRange_h
7 7
8 #include "core/editing/Position.h" 8 #include "core/editing/Position.h"
9 9
10 namespace blink { 10 namespace blink {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 // Returns true if |m_startPositoin| == |m_endPosition| or |isNull()|. 59 // Returns true if |m_startPositoin| == |m_endPosition| or |isNull()|.
60 bool isCollapsed() const; 60 bool isCollapsed() const;
61 bool isNull() const 61 bool isNull() const
62 { 62 {
63 ASSERT(isValid()); 63 ASSERT(isValid());
64 return m_startPosition.isNull(); 64 return m_startPosition.isNull();
65 } 65 }
66 bool isNotNull() const { return !isNull(); } 66 bool isNotNull() const { return !isNull(); }
67 67
68 // Returns united bounding box of all LayoutText objects within the range,
69 // as same as Range::boundingBox().
70 IntRect textBoundingBox() const;
71
68 DEFINE_INLINE_TRACE() 72 DEFINE_INLINE_TRACE()
69 { 73 {
70 visitor->trace(m_startPosition); 74 visitor->trace(m_startPosition);
71 visitor->trace(m_endPosition); 75 visitor->trace(m_endPosition);
72 } 76 }
73 77
74 // |node| should be in-document and valid for anchor node of 78 // |node| should be in-document and valid for anchor node of
75 // |PositionTemplate<Strategy>|. 79 // |PositionTemplate<Strategy>|.
76 static EphemeralRangeTemplate<Strategy> rangeOfContents(const Node& /* node */); 80 static EphemeralRangeTemplate<Strategy> rangeOfContents(const Node& /* node */);
77 81
(...skipping 13 matching lines...) Expand all
91 extern template class CORE_EXTERN_TEMPLATE_EXPORT EphemeralRangeTemplate<Editing InComposedTreeStrategy>; 95 extern template class CORE_EXTERN_TEMPLATE_EXPORT EphemeralRangeTemplate<Editing InComposedTreeStrategy>;
92 using EphemeralRangeInComposedTree = EphemeralRangeTemplate<EditingInComposedTre eStrategy>; 96 using EphemeralRangeInComposedTree = EphemeralRangeTemplate<EditingInComposedTre eStrategy>;
93 97
94 // Returns a newly created |Range| object from |range| or |nullptr| if 98 // Returns a newly created |Range| object from |range| or |nullptr| if
95 // |range.isNull()| returns true. 99 // |range.isNull()| returns true.
96 CORE_EXPORT PassRefPtrWillBeRawPtr<Range> createRange(const EphemeralRange& /* r ange */); 100 CORE_EXPORT PassRefPtrWillBeRawPtr<Range> createRange(const EphemeralRange& /* r ange */);
97 101
98 } // namespace blink 102 } // namespace blink
99 103
100 #endif 104 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698