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

Side by Side Diff: third_party/WebKit/Source/core/editing/DragCaret.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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 void DragCaret::layoutBlockWillBeDestroyed(const LayoutBlock& block) { 48 void DragCaret::layoutBlockWillBeDestroyed(const LayoutBlock& block) {
49 m_displayItemClient->layoutBlockWillBeDestroyed(block); 49 m_displayItemClient->layoutBlockWillBeDestroyed(block);
50 } 50 }
51 51
52 void DragCaret::updateStyleAndLayoutIfNeeded() { 52 void DragCaret::updateStyleAndLayoutIfNeeded() {
53 m_displayItemClient->updateStyleAndLayoutIfNeeded( 53 m_displayItemClient->updateStyleAndLayoutIfNeeded(
54 rootEditableElementOf(m_position.position()) ? m_position 54 rootEditableElementOf(m_position.position()) ? m_position
55 : PositionWithAffinity()); 55 : PositionWithAffinity());
56 } 56 }
57 57
58 void DragCaret::invalidatePaintIfNeeded(const LayoutBlock& block, 58 void DragCaret::invalidatePaintIfNeeded(
59 const PaintInvalidatorContext& context, 59 const LayoutBlock& block,
60 PaintInvalidationReason reason) { 60 const PaintInvalidatorContext& context) {
61 m_displayItemClient->invalidatePaintIfNeeded(block, context, reason); 61 m_displayItemClient->invalidatePaintIfNeeded(block, context);
62 } 62 }
63 63
64 bool DragCaret::isContentRichlyEditable() const { 64 bool DragCaret::isContentRichlyEditable() const {
65 return isRichlyEditablePosition(m_position.position()); 65 return isRichlyEditablePosition(m_position.position());
66 } 66 }
67 67
68 void DragCaret::setCaretPosition(const PositionWithAffinity& position) { 68 void DragCaret::setCaretPosition(const PositionWithAffinity& position) {
69 m_position = createVisiblePosition(position).toPositionWithAffinity(); 69 m_position = createVisiblePosition(position).toPositionWithAffinity();
70 Document* document = nullptr; 70 Document* document = nullptr;
71 if (Node* node = m_position.anchorNode()) { 71 if (Node* node = m_position.anchorNode()) {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 void DragCaret::paintDragCaret(const LocalFrame* frame, 110 void DragCaret::paintDragCaret(const LocalFrame* frame,
111 GraphicsContext& context, 111 GraphicsContext& context,
112 const LayoutPoint& paintOffset) const { 112 const LayoutPoint& paintOffset) const {
113 if (m_position.anchorNode()->document().frame() != frame) 113 if (m_position.anchorNode()->document().frame() != frame)
114 return; 114 return;
115 m_displayItemClient->paintCaret(context, paintOffset, 115 m_displayItemClient->paintCaret(context, paintOffset,
116 DisplayItem::kDragCaret); 116 DisplayItem::kDragCaret);
117 } 117 }
118 118
119 } // namespace blink 119 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/DragCaret.h ('k') | third_party/WebKit/Source/core/editing/FrameCaret.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698