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

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

Issue 2723133004: Get rid of redundant member variable SelectionEditor::m_logicalRange (Closed)
Patch Set: 2017-03-06T13:02:21 rebase Created 3 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 void setSelection(const SelectionInDOMTree&); 60 void setSelection(const SelectionInDOMTree&);
61 61
62 void documentAttached(Document*); 62 void documentAttached(Document*);
63 63
64 // If this FrameSelection has a logical range which is still valid, this 64 // If this FrameSelection has a logical range which is still valid, this
65 // function return its clone. Otherwise, the return value from underlying 65 // function return its clone. Otherwise, the return value from underlying
66 // |VisibleSelection|'s |firstRange()| is returned. 66 // |VisibleSelection|'s |firstRange()| is returned.
67 Range* firstRange() const; 67 Range* firstRange() const;
68 68
69 // There functions are exposed for |FrameSelection|. 69 // There functions are exposed for |FrameSelection|.
70 void resetLogicalRange();
71 void setLogicalRange(Range*);
72
73 void cacheRangeOfDocument(Range*); 70 void cacheRangeOfDocument(Range*);
74 Range* documentCachedRange() const; 71 Range* documentCachedRange() const;
75 void clearDocumentCachedRange(); 72 void clearDocumentCachedRange();
76 73
77 DECLARE_TRACE(); 74 DECLARE_TRACE();
78 75
79 private: 76 private:
80 explicit SelectionEditor(LocalFrame&); 77 explicit SelectionEditor(LocalFrame&);
81 78
82 Document& document() const; 79 Document& document() const;
(...skipping 22 matching lines...) Expand all
105 unsigned offset, 102 unsigned offset,
106 unsigned oldLength, 103 unsigned oldLength,
107 unsigned newLength) final; 104 unsigned newLength) final;
108 void nodeChildrenWillBeRemoved(ContainerNode&) final; 105 void nodeChildrenWillBeRemoved(ContainerNode&) final;
109 void nodeWillBeRemoved(Node&) final; 106 void nodeWillBeRemoved(Node&) final;
110 107
111 Member<LocalFrame> m_frame; 108 Member<LocalFrame> m_frame;
112 109
113 SelectionInDOMTree m_selection; 110 SelectionInDOMTree m_selection;
114 111
115 // TODO(editing-dev): Removing |m_logicalRange|
116 // The range specified by the user, which may not be visually canonicalized
117 // (hence "logical"). This will be invalidated if the underlying
118 // |VisibleSelection| changes. If that happens, this variable will
119 // become |nullptr|, in which case logical positions == visible positions.
120 Member<Range> m_logicalRange;
121
122 // If document is root, document.getSelection().addRange(range) is cached on 112 // If document is root, document.getSelection().addRange(range) is cached on
123 // this. 113 // this.
124 Member<Range> m_cachedRange; 114 Member<Range> m_cachedRange;
125 115
126 mutable VisibleSelection m_cachedVisibleSelectionInDOMTree; 116 mutable VisibleSelection m_cachedVisibleSelectionInDOMTree;
127 mutable VisibleSelectionInFlatTree m_cachedVisibleSelectionInFlatTree; 117 mutable VisibleSelectionInFlatTree m_cachedVisibleSelectionInFlatTree;
128 mutable uint64_t m_styleVersion = static_cast<uint64_t>(-1); 118 mutable uint64_t m_styleVersion = static_cast<uint64_t>(-1);
129 mutable bool m_cacheIsDirty = false; 119 mutable bool m_cacheIsDirty = false;
130 }; 120 };
131 121
132 } // namespace blink 122 } // namespace blink
133 123
134 #endif // SelectionEditor_h 124 #endif // SelectionEditor_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698