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

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

Issue 2745793002: Fix caret paint invalidation issues (Closed)
Patch Set: 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 updateAppearance(); 139 updateAppearance();
140 bool shouldPaintCaret = 140 bool shouldPaintCaret =
141 m_shouldPaintCaret && isActive() && 141 m_shouldPaintCaret && isActive() &&
142 m_caretVisibility == CaretVisibility::Visible && 142 m_caretVisibility == CaretVisibility::Visible &&
143 m_selectionEditor->computeVisibleSelectionInDOMTree().hasEditableStyle(); 143 m_selectionEditor->computeVisibleSelectionInDOMTree().hasEditableStyle();
144 144
145 m_displayItemClient->updateStyleAndLayoutIfNeeded( 145 m_displayItemClient->updateStyleAndLayoutIfNeeded(
146 shouldPaintCaret ? caretPosition() : PositionWithAffinity()); 146 shouldPaintCaret ? caretPosition() : PositionWithAffinity());
147 } 147 }
148 148
149 void FrameCaret::invalidatePaintIfNeeded(const LayoutBlock& block, 149 void FrameCaret::invalidatePaintIfNeeded(
150 const PaintInvalidatorContext& context, 150 const LayoutBlock& block,
151 PaintInvalidationReason reason) { 151 const PaintInvalidatorContext& context) {
152 m_displayItemClient->invalidatePaintIfNeeded(block, context, reason); 152 m_displayItemClient->invalidatePaintIfNeeded(block, context);
153 } 153 }
154 154
155 bool FrameCaret::caretPositionIsValidForDocument( 155 bool FrameCaret::caretPositionIsValidForDocument(
156 const Document& document) const { 156 const Document& document) const {
157 if (!isActive()) 157 if (!isActive())
158 return true; 158 return true;
159 159
160 return caretPosition().document() == document && !caretPosition().isOrphan(); 160 return caretPosition().document() == document && !caretPosition().isOrphan();
161 } 161 }
162 162
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 frameView->scheduleVisualUpdateForPaintInvalidationIfNeeded(); 229 frameView->scheduleVisualUpdateForPaintInvalidationIfNeeded();
230 } 230 }
231 231
232 void FrameCaret::recreateCaretBlinkTimerForTesting( 232 void FrameCaret::recreateCaretBlinkTimerForTesting(
233 RefPtr<WebTaskRunner> taskRunner) { 233 RefPtr<WebTaskRunner> taskRunner) {
234 m_caretBlinkTimer.reset(new TaskRunnerTimer<FrameCaret>( 234 m_caretBlinkTimer.reset(new TaskRunnerTimer<FrameCaret>(
235 std::move(taskRunner), this, &FrameCaret::caretBlinkTimerFired)); 235 std::move(taskRunner), this, &FrameCaret::caretBlinkTimerFired));
236 } 236 }
237 237
238 } // namespace blink 238 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/FrameCaret.h ('k') | third_party/WebKit/Source/core/editing/FrameSelection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698