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

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

Issue 2737043002: Fix caret paint invalidation issue on partial lifecycle updates (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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 // Get the layoutObject that will be responsible for painting the caret 108 // Get the layoutObject that will be responsible for painting the caret
109 // (which is either the layoutObject we just found, or one of its containers). 109 // (which is either the layoutObject we just found, or one of its containers).
110 LayoutBlockItem caretPainterItem = 110 LayoutBlockItem caretPainterItem =
111 LayoutBlockItem(caretLayoutBlock(caretPosition.anchorNode())); 111 LayoutBlockItem(caretLayoutBlock(caretPosition.anchorNode()));
112 LayoutRect caretLocalRectWithWritingMode = caretLocalRect; 112 LayoutRect caretLocalRectWithWritingMode = caretLocalRect;
113 caretPainterItem.flipForWritingMode(caretLocalRectWithWritingMode); 113 caretPainterItem.flipForWritingMode(caretLocalRectWithWritingMode);
114 return mapCaretRectToCaretPainter(LayoutItem(layoutObject), caretPainterItem, 114 return mapCaretRectToCaretPainter(LayoutItem(layoutObject), caretPainterItem,
115 caretLocalRectWithWritingMode); 115 caretLocalRectWithWritingMode);
116 } 116 }
117 117
118 void CaretDisplayItemClient::updateStyleAndLayoutIfNeeded( 118 void CaretDisplayItemClient::updateForPaintInvalidation(
119 const PositionWithAffinity& caretPosition) { 119 const PositionWithAffinity& caretPosition) {
120 m_previousLayoutBlock = m_layoutBlock; 120 m_previousLayoutBlock = m_layoutBlock;
121 m_previousVisualRect = m_visualRect; 121 m_previousVisualRect = m_visualRect;
122 122
123 LayoutBlock* newLayoutBlock = caretLayoutBlock(caretPosition.anchorNode()); 123 LayoutBlock* newLayoutBlock = caretLayoutBlock(caretPosition.anchorNode());
124 if (newLayoutBlock != m_layoutBlock) { 124 if (newLayoutBlock != m_layoutBlock) {
125 if (m_layoutBlock) 125 if (m_layoutBlock)
126 m_layoutBlock->setMayNeedPaintInvalidation(); 126 m_layoutBlock->setMayNeedPaintInvalidation();
127 m_layoutBlock = newLayoutBlock; 127 m_layoutBlock = newLayoutBlock;
128 if (newLayoutBlock) 128 if (newLayoutBlock)
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 247
248 String CaretDisplayItemClient::debugName() const { 248 String CaretDisplayItemClient::debugName() const {
249 return "Caret"; 249 return "Caret";
250 } 250 }
251 251
252 LayoutRect CaretDisplayItemClient::visualRect() const { 252 LayoutRect CaretDisplayItemClient::visualRect() const {
253 return m_visualRect; 253 return m_visualRect;
254 } 254 }
255 255
256 } // namespace blink 256 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698