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

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

Issue 2293293003: Make CaretBase a DisplayItemClient. (Closed)
Patch Set: Fix unit test and disable failing test on SPv2. Created 4 years, 3 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 reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 void didMergeTextNodes(const Text& oldNode, unsigned offset); 180 void didMergeTextNodes(const Text& oldNode, unsigned offset);
181 void didSplitTextNode(const Text& oldNode); 181 void didSplitTextNode(const Text& oldNode);
182 182
183 bool isAppearanceDirty() const; 183 bool isAppearanceDirty() const;
184 void commitAppearanceIfNeeded(LayoutView&); 184 void commitAppearanceIfNeeded(LayoutView&);
185 void updateAppearance(); 185 void updateAppearance();
186 void setCaretVisible(bool caretIsVisible); 186 void setCaretVisible(bool caretIsVisible);
187 bool isCaretBoundsDirty() const; 187 bool isCaretBoundsDirty() const;
188 void setCaretRectNeedsUpdate(); 188 void setCaretRectNeedsUpdate();
189 void scheduleVisualUpdate() const; 189 void scheduleVisualUpdate() const;
190 void invalidateCaretRect(); 190 void invalidateCaretRect(bool forceInvalidation = false);
191 void paintCaret(GraphicsContext&, const LayoutPoint&); 191 void paintCaret(GraphicsContext&, const LayoutPoint&);
192 192
193 // Used to suspend caret blinking while the mouse is down. 193 // Used to suspend caret blinking while the mouse is down.
194 void setCaretBlinkingSuspended(bool); 194 void setCaretBlinkingSuspended(bool);
195 bool isCaretBlinkingSuspended() const; 195 bool isCaretBlinkingSuspended() const;
196 196
197 // Focus 197 // Focus
198 void setFocused(bool); 198 void setFocused(bool);
199 bool isFocused() const { return m_focused; } 199 bool isFocused() const { return m_focused; }
200 bool isFocusedAndActive() const; 200 bool isFocusedAndActive() const;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 // TODO(yosin): We should check DOM tree version and style version in 239 // TODO(yosin): We should check DOM tree version and style version in
240 // |FrameSelection::selection()| to make sure we use updated selection, 240 // |FrameSelection::selection()| to make sure we use updated selection,
241 // rather than having |updateIfNeeded()|. Once, we update all layout tests 241 // rather than having |updateIfNeeded()|. Once, we update all layout tests
242 // to use updated selection, we should make |updateIfNeeded()| private. 242 // to use updated selection, we should make |updateIfNeeded()| private.
243 void updateIfNeeded(); 243 void updateIfNeeded();
244 244
245 DECLARE_VIRTUAL_TRACE(); 245 DECLARE_VIRTUAL_TRACE();
246 246
247 private: 247 private:
248 friend class FrameSelectionTest; 248 friend class FrameSelectionTest;
249 friend class PaintControllerPaintTestForSlimmingPaintV1AndV2;
250 FRIEND_TEST_ALL_PREFIXES(PaintControllerPaintTestForSlimmingPaintV1AndV2, Fu llDocumentPaintingWithCaret);
249 251
250 explicit FrameSelection(LocalFrame*); 252 explicit FrameSelection(LocalFrame*);
251 253
252 // Note: We have |selectionInFlatTree()| for unit tests, we should 254 // Note: We have |selectionInFlatTree()| for unit tests, we should
253 // use |visibleSelection<EditingInFlatTreeStrategy>()|. 255 // use |visibleSelection<EditingInFlatTreeStrategy>()|.
254 const VisibleSelectionInFlatTree& selectionInFlatTree() const; 256 const VisibleSelectionInFlatTree& selectionInFlatTree() const;
255 257
256 template <typename Strategy> 258 template <typename Strategy>
257 VisiblePositionTemplate<Strategy> originalBase() const; 259 VisiblePositionTemplate<Strategy> originalBase() const;
258 void setOriginalBase(const VisiblePosition&); 260 void setOriginalBase(const VisiblePosition&);
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 } 320 }
319 } // namespace blink 321 } // namespace blink
320 322
321 #ifndef NDEBUG 323 #ifndef NDEBUG
322 // Outside the WebCore namespace for ease of invocation from gdb. 324 // Outside the WebCore namespace for ease of invocation from gdb.
323 void showTree(const blink::FrameSelection&); 325 void showTree(const blink::FrameSelection&);
324 void showTree(const blink::FrameSelection*); 326 void showTree(const blink::FrameSelection*);
325 #endif 327 #endif
326 328
327 #endif // FrameSelection_h 329 #endif // FrameSelection_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/FrameCaret.cpp ('k') | third_party/WebKit/Source/core/editing/FrameSelection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698