| Index: third_party/WebKit/Source/core/editing/CaretBase.cpp
|
| diff --git a/third_party/WebKit/Source/core/editing/CaretBase.cpp b/third_party/WebKit/Source/core/editing/CaretBase.cpp
|
| index c3e64a223da90e036e741bba2d716dd11e1dca2f..9781217137343403d52c8a7a8792b44c9c4e04f2 100644
|
| --- a/third_party/WebKit/Source/core/editing/CaretBase.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/CaretBase.cpp
|
| @@ -34,10 +34,7 @@
|
| #include "core/layout/api/LayoutBlockItem.h"
|
| #include "core/layout/api/LayoutItem.h"
|
| #include "core/paint/PaintInfo.h"
|
| -#include "core/paint/PaintLayer.h"
|
| #include "platform/graphics/GraphicsContext.h"
|
| -#include "platform/graphics/GraphicsLayer.h"
|
| -#include "platform/graphics/paint/DrawingRecorder.h"
|
|
|
| namespace blink {
|
|
|
| @@ -142,21 +139,13 @@
|
| return caretPainter->localToAbsoluteQuad(FloatRect(localRect)).enclosingBoundingBox();
|
| }
|
|
|
| -DisplayItemClient* CaretBase::displayItemClientForCaret(Node* node)
|
| -{
|
| - LayoutBlock* caretLayoutBlock = caretLayoutObject(node);
|
| - if (caretLayoutBlock->usesCompositedScrolling())
|
| - return static_cast<DisplayItemClient*>(caretLayoutBlock->layer()->graphicsLayerBackingForScrolling());
|
| - return caretLayoutBlock;
|
| -}
|
| -
|
| // TODO(yoichio): |node| is FrameSelection::m_previousCaretNode and this is bad
|
| // design. We should use only previous layoutObject or Rectangle to invalidate
|
| // old caret.
|
| void CaretBase::invalidateLocalCaretRect(Node* node, const LayoutRect& rect)
|
| {
|
| - LayoutBlock* caretLayoutBlock = caretLayoutObject(node);
|
| - if (!caretLayoutBlock)
|
| + LayoutBlockItem caretPainter = LayoutBlockItem(caretLayoutObject(node));
|
| + if (!caretPainter)
|
| return;
|
|
|
| // FIXME: Need to over-paint 1 pixel to workaround some rounding problems.
|
| @@ -164,10 +153,12 @@
|
| LayoutRect inflatedRect = rect;
|
| inflatedRect.inflate(LayoutUnit(1));
|
|
|
| + // FIXME: We should use mapLocalToAncestor() since we know we're not un-rooted.
|
| + mapCaretRectToCaretPainter(LayoutItem(node->layoutObject()), caretPainter, inflatedRect);
|
| +
|
| // FIXME: We should not allow paint invalidation out of paint invalidation state. crbug.com/457415
|
| DisablePaintInvalidationStateAsserts disabler;
|
| -
|
| - node->layoutObject()->invalidatePaintRectangle(inflatedRect, displayItemClientForCaret(node));
|
| + caretPainter.invalidatePaintRectangle(inflatedRect);
|
| }
|
|
|
| bool CaretBase::shouldRepaintCaret(Node& node) const
|
| @@ -201,12 +192,9 @@
|
| }
|
| }
|
|
|
| -void CaretBase::paintCaret(Node* node, GraphicsContext& context, const LayoutPoint& paintOffset, DisplayItem::Type displayItemType) const
|
| +void CaretBase::paintCaret(Node* node, GraphicsContext& context, const LayoutPoint& paintOffset) const
|
| {
|
| if (m_caretVisibility == CaretVisibility::Hidden)
|
| - return;
|
| -
|
| - if (DrawingRecorder::useCachedDrawingIfPossible(context, *displayItemClientForCaret(node), displayItemType))
|
| return;
|
|
|
| LayoutRect drawingRect = localCaretRectWithoutUpdate();
|
| @@ -225,8 +213,6 @@
|
| if (element && element->layoutObject())
|
| caretColor = element->layoutObject()->resolveColor(CSSPropertyColor);
|
|
|
| - DrawingRecorder drawingRecorder(context, *displayItemClientForCaret(node), DisplayItem::Caret, FloatRect(drawingRect));
|
| -
|
| context.fillRect(FloatRect(drawingRect), caretColor);
|
| }
|
|
|
|
|