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

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

Issue 2616623002: Do not send redundant selectionchange-events (decouple focus) (Closed)
Patch Set: Rebase Created 3 years, 8 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 14 matching lines...) Expand all
25 */ 25 */
26 26
27 #ifndef FrameSelection_h 27 #ifndef FrameSelection_h
28 #define FrameSelection_h 28 #define FrameSelection_h
29 29
30 #include <memory> 30 #include <memory>
31 #include "core/CoreExport.h" 31 #include "core/CoreExport.h"
32 #include "core/dom/Range.h" 32 #include "core/dom/Range.h"
33 #include "core/dom/SynchronousMutationObserver.h" 33 #include "core/dom/SynchronousMutationObserver.h"
34 #include "core/editing/EphemeralRange.h" 34 #include "core/editing/EphemeralRange.h"
35 #include "core/editing/LayoutSelection.h"
35 #include "core/editing/VisiblePosition.h" 36 #include "core/editing/VisiblePosition.h"
36 #include "core/editing/VisibleSelection.h" 37 #include "core/editing/VisibleSelection.h"
37 #include "core/editing/iterators/TextIteratorBehavior.h" 38 #include "core/editing/iterators/TextIteratorBehavior.h"
38 #include "core/layout/ScrollAlignment.h" 39 #include "core/layout/ScrollAlignment.h"
39 #include "platform/Timer.h" 40 #include "platform/Timer.h"
40 #include "platform/geometry/IntRect.h" 41 #include "platform/geometry/IntRect.h"
41 #include "platform/geometry/LayoutRect.h" 42 #include "platform/geometry/LayoutRect.h"
42 #include "platform/graphics/PaintInvalidationReason.h" 43 #include "platform/graphics/PaintInvalidationReason.h"
43 #include "platform/heap/Handle.h" 44 #include "platform/heap/Handle.h"
44 #include "platform/wtf/Noncopyable.h" 45 #include "platform/wtf/Noncopyable.h"
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 236
236 HTMLFormElement* CurrentForm() const; 237 HTMLFormElement* CurrentForm() const;
237 238
238 // TODO(tkent): This function has a bug that scrolling doesn't work well in 239 // TODO(tkent): This function has a bug that scrolling doesn't work well in
239 // a case of RangeSelection. crbug.com/443061 240 // a case of RangeSelection. crbug.com/443061
240 void RevealSelection( 241 void RevealSelection(
241 const ScrollAlignment& = ScrollAlignment::kAlignCenterIfNeeded, 242 const ScrollAlignment& = ScrollAlignment::kAlignCenterIfNeeded,
242 RevealExtentOption = kDoNotRevealExtent); 243 RevealExtentOption = kDoNotRevealExtent);
243 void SetSelectionFromNone(); 244 void SetSelectionFromNone();
244 245
245 void UpdateAppearance(); 246 void UpdateAppearance(LayoutSelection::PaintHint);
246 bool ShouldShowBlockCursor() const; 247 bool ShouldShowBlockCursor() const;
247 void SetShouldShowBlockCursor(bool); 248 void SetShouldShowBlockCursor(bool);
248 249
249 void CacheRangeOfDocument(Range*); 250 void CacheRangeOfDocument(Range*);
250 Range* DocumentCachedRange() const; 251 Range* DocumentCachedRange() const;
251 void ClearDocumentCachedRange(); 252 void ClearDocumentCachedRange();
252 253
253 FrameCaret& FrameCaretForTesting() const { return *frame_caret_; } 254 FrameCaret& FrameCaretForTesting() const { return *frame_caret_; }
254 255
255 void LayoutSelectionStartEnd(int& start_pos, int& end_pos); 256 void LayoutSelectionStartEnd(int& start_pos, int& end_pos);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 LayoutUnit x_pos_for_vertical_arrow_navigation_; 302 LayoutUnit x_pos_for_vertical_arrow_navigation_;
302 303
303 bool focused_ : 1; 304 bool focused_ : 1;
304 305
305 // Controls text granularity used to adjust the selection's extent in 306 // Controls text granularity used to adjust the selection's extent in
306 // moveRangeSelectionExtent. 307 // moveRangeSelectionExtent.
307 std::unique_ptr<GranularityStrategy> granularity_strategy_; 308 std::unique_ptr<GranularityStrategy> granularity_strategy_;
308 309
309 const Member<FrameCaret> frame_caret_; 310 const Member<FrameCaret> frame_caret_;
310 bool use_secure_keyboard_entry_when_active_ = false; 311 bool use_secure_keyboard_entry_when_active_ = false;
312 bool text_control_focused_ = false;
311 }; 313 };
312 314
313 } // namespace blink 315 } // namespace blink
314 316
315 #ifndef NDEBUG 317 #ifndef NDEBUG
316 // Outside the WebCore namespace for ease of invocation from gdb. 318 // Outside the WebCore namespace for ease of invocation from gdb.
317 void showTree(const blink::FrameSelection&); 319 void showTree(const blink::FrameSelection&);
318 void showTree(const blink::FrameSelection*); 320 void showTree(const blink::FrameSelection*);
319 #endif 321 #endif
320 322
321 #endif // FrameSelection_h 323 #endif // FrameSelection_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698