Commit 61fc2540 authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

[PE] Don't paint composited resizer twice

The bug was exposed by removal of cache generation mechanism of paint
controller. Before that, objects painted onto different paint
controllers were always implicitly invalidated in one of the paint
controllers due to cache generation mismatch. The bug exposed because we
don't invalidate resizer in the main graphics layer on container resize
if the resizer is composited.

We should not paint composited resizer on the main graphics layer.

Bug: 902697
Change-Id: Ia6eefe687d79a4a787528c3ccb391c57f649a911
Reviewed-on: https://chromium-review.googlesource.com/c/1329803
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: default avatarChris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607094}
parent a3e348a8
<!DOCTYPE html>
<iframe id="iframe" style="width: 400px; height: 200px; resize: both"></iframe>
<!DOCTYPE html>
<iframe id="iframe" style="width: 200px; height: 200px; resize: both; will-change: transform"></iframe>
<script src="../../../resources/run-after-layout-and-paint.js"></script>
<script>
runAfterLayoutAndPaint(function() {
iframe.style.width = '400px';
}, true);
</script>
......@@ -12,6 +12,7 @@
#include "third_party/blink/renderer/core/paint/object_painter.h"
#include "third_party/blink/renderer/core/paint/paint_info.h"
#include "third_party/blink/renderer/core/paint/paint_layer.h"
#include "third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h"
#include "third_party/blink/renderer/core/paint/scoped_paint_state.h"
#include "third_party/blink/renderer/core/paint/scrollable_area_painter.h"
#include "third_party/blink/renderer/core/paint/selection_painting_utils.h"
......@@ -152,10 +153,15 @@ void ReplacedPainter::Paint(const PaintInfo& paint_info) {
}
if (layout_replaced_.CanResize()) {
ScrollableAreaPainter(*layout_replaced_.Layer()->GetScrollableArea())
auto* scrollable_area = layout_replaced_.GetScrollableArea();
DCHECK(scrollable_area);
if (!scrollable_area->HasLayerForScrollCorner()) {
ScrollableAreaPainter(*scrollable_area)
.PaintResizer(local_paint_info.context, RoundedIntPoint(paint_offset),
local_paint_info.GetCullRect());
}
// Otherwise the resizer will be painted by the scroll corner layer.
}
// The selection tint never gets clipped by border-radius rounding, since we
// want it to run right up to the edges of surrounding content.
......
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