Commit 0985a37c authored by Philip Rogers's avatar Philip Rogers Committed by Commit Bot

[RLS] Correct non-composited fixed background clip

We prefer to paint background-attachment: fixed into the scrolling
contents layer if text quality is important (at the cost of repainting
on every scroll). This approach had a bug for the LayoutView if there
turned out to be no scrolling layer (e.g., in a non-composited iframe).
Without a scrolling layer, a fixed background will not be clipped. This
patch ensures the background is clipped in ViewPainter.

Bug: 835755
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I6c19406fdacb64c5319709f9495e4fc8d608ae33
Reviewed-on: https://chromium-review.googlesource.com/1042266Reviewed-by: default avatarSteve Kobes <skobes@chromium.org>
Commit-Queue: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#555827}
parent 55bbec5e
<!DOCTYPE html>
<div style='background: green; width: 100px; height: 100px;'></div>
<!DOCTYPE html>
<iframe frameborder='0' srcdoc="<!DOCTYPE html>
<style>
::-webkit-scrollbar { display: none; }
body {
background: url('data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\' width=\'600\' height=\'600\'><rect width=\'100%\' height=\'100%\' fill=\'green\'></rect></svg>') no-repeat fixed;
min-height: 600px;
min-width: 600px;
}
</style>" style="width: 100px; height: 100px;"></iframe>
......@@ -244,8 +244,8 @@ void ViewPainter::PaintBoxDecorationBackground(const PaintInfo& paint_info) {
bool should_paint_in_viewport_space =
(*it)->Attachment() == EFillAttachment::kFixed;
if (should_paint_in_viewport_space) {
box_model_painter.PaintFillLayer(
paint_info, Color(), **it, LayoutRect(LayoutRect::InfiniteIntRect()),
box_model_painter.PaintFillLayer(paint_info, Color(), **it,
LayoutRect(background_rect),
kBackgroundBleedNone, geometry);
} else {
context.Save();
......
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