Commit b3ea2018 authored by wangxianzhu's avatar wangxianzhu Committed by Commit bot

Fix wrong display item type for drag caret

The bug seems to have been there since we added DisplayItem::kCaret.
This breaks under-invalidation checking itself only. It won't cause
any visible issue to release builds, except small performance
penalty that the drag caret is always repainted because of no match
in the cache with the wrong id.

BUG=699480

Review-Url: https://codereview.chromium.org/2742693002
Cr-Commit-Position: refs/heads/master@{#455778}
parent 136423e8
<!DOCTYPE html>
Passes if no crash.
<input id="fileinput" type="file">
<script src="../../resources/run-after-layout-and-paint.js"></script>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script>
if (window.testRunner && window.eventSender) {
internals.runtimeFlags.paintUnderInvalidationCheckingEnabled = true;
document.designMode="on";
async_test(t => {
runAfterLayoutAndPaint(t.step_func_done(() => {
eventSender.beginDragWithFiles(['testpath1/testfile1.txt']);
var centerX = fileinput.offsetLeft + fileinput.offsetWidth / 2;
var centerY = fileinput.offsetTop + fileinput.offsetHeight / 2;
eventSender.mouseMoveTo(centerX, centerY);
eventSender.mouseUp();
}));
});
}
</script>
......@@ -260,8 +260,7 @@ void CaretDisplayItemClient::paintCaret(
drawingRect.moveBy(paintOffset);
IntRect paintRect = pixelSnappedIntRect(drawingRect);
DrawingRecorder drawingRecorder(context, *this, DisplayItem::kCaret,
paintRect);
DrawingRecorder drawingRecorder(context, *this, displayItemType, paintRect);
context.fillRect(paintRect, m_color);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment