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

Side by Side Diff: third_party/WebKit/Source/core/editing/FrameCaret.cpp

Issue 2741173002: Reduce canonicalization when dragging (Closed)
Patch Set: update 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, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 197
198 void FrameCaret::paintCaret(GraphicsContext& context, 198 void FrameCaret::paintCaret(GraphicsContext& context,
199 const LayoutPoint& paintOffset) const { 199 const LayoutPoint& paintOffset) const {
200 m_displayItemClient->paintCaret(context, paintOffset, DisplayItem::kCaret); 200 m_displayItemClient->paintCaret(context, paintOffset, DisplayItem::kCaret);
201 } 201 }
202 202
203 bool FrameCaret::shouldBlinkCaret() const { 203 bool FrameCaret::shouldBlinkCaret() const {
204 if (m_caretVisibility != CaretVisibility::Visible || !isActive()) 204 if (m_caretVisibility != CaretVisibility::Visible || !isActive())
205 return false; 205 return false;
206 206
207 Element* root = rootEditableElementOf(caretPosition().position()); 207 Element* root =
208 rootEditableElementOf(m_selectionEditor->selectionInDOMTree().base());
yosin_UTC9 2017/03/16 02:30:05 Could you move change in another CL? This change i
yoichio 2017/03/16 04:10:59 Acknowledged.
208 if (!root) 209 if (!root)
209 return false; 210 return false;
210 211
211 Element* focusedElement = root->document().focusedElement(); 212 Element* focusedElement = root->document().focusedElement();
212 if (!focusedElement) 213 if (!focusedElement)
213 return false; 214 return false;
214 215
215 return focusedElement->isShadowIncludingInclusiveAncestorOf( 216 return focusedElement->isShadowIncludingInclusiveAncestorOf(
216 caretPosition().anchorNode()); 217 caretPosition().anchorNode());
217 } 218 }
(...skipping 11 matching lines...) Expand all
229 frameView->scheduleVisualUpdateForPaintInvalidationIfNeeded(); 230 frameView->scheduleVisualUpdateForPaintInvalidationIfNeeded();
230 } 231 }
231 232
232 void FrameCaret::recreateCaretBlinkTimerForTesting( 233 void FrameCaret::recreateCaretBlinkTimerForTesting(
233 RefPtr<WebTaskRunner> taskRunner) { 234 RefPtr<WebTaskRunner> taskRunner) {
234 m_caretBlinkTimer.reset(new TaskRunnerTimer<FrameCaret>( 235 m_caretBlinkTimer.reset(new TaskRunnerTimer<FrameCaret>(
235 std::move(taskRunner), this, &FrameCaret::caretBlinkTimerFired)); 236 std::move(taskRunner), this, &FrameCaret::caretBlinkTimerFired));
236 } 237 }
237 238
238 } // namespace blink 239 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698