New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 787666 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Mar 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac , Fuchsia
Pri: 1
Type: Bug

Blocking:
issue 417782



Sign in to add a comment

Scrollers with vertical-rl backgrounds are not fully painted

Project Member Reported by pdr@chromium.org, Nov 22 2017

Issue description

Scrollers with vertical-rl writing mode do not fully paint their backgrounds into the scrolling contents layer.

See the attached testcase: vertical-rl-scrollable-area-bug.html, or visit http://output.jsbin.com/weyuteb/1/quiet

This affects scrollable areas but not the frameview. When root layer scrolls is enabled, the root background does not paint properly with vertical-rl (see minimized rls-vertical-rl-bug.html, or paint/invalidation/window-resize/window-resize-vertical-writing-mode.html).
 
vertical-rl-scrollable-area-bug.html
652 bytes View Download
rls-vertical-rl-bug.html
359 bytes View Download
Cc: -skobes@chromium.org
Owner: skobes@chromium.org
Status: Started (was: Available)
Owner: chrishtr@chromium.org
FYI here is a minimization of the layout test that I made.  I think there may be different issues going on in pdr's testcase.
vrlbg.html
507 bytes View Download
Blocking: -781419 417782
Cc: skobes@chromium.org
Owner: trchen@chromium.org
Tien-Ren is going to take this one. Steve, I heard you got somewhere with
it and might have some idea on how to fix? If so, it would help Tien-Ren
get to the bottom of it quicker.

Comment 6 by skobes@chromium.org, Feb 28 2018

It has something to do with the rects that are used to paint the background into the scrolling contents layer in ViewPainter::PaintBoxDecorationBackground:

https://pastebin.com/raw/SVTJrX5c

The layer's paint record has a "translate" for the scroll offset, followed by a "drawRect" for the background itself, whose rect is positioned to negate the translation.  That kinda makes sense, because the background should cover the layer?  But it means the scroll offset is baked into the paint ops which is weird since the layer's pixels don't depend on the scroll offset.

Then the window gets resized which changes the scroll offset and PaintController sees that the paint ops are different and gets mad that we didn't issue a paint invalidation.  Except we shouldn't need a paint invalidation because the scrolling contents layer's pixels are all the same?

That's as far as I got.
Turns out it is just one missing FlipForWritingMode(). :D

The scroll + counter-scroll thing you observed probably won't affect correctness, but yea I agree it's so lame and it triggers a DCHECK we really should fix it too.
Can you check the following page with your fix:
https://output.jsbin.com/farupod/quiet

In particular, when you resize the window to be wider, do you see corruption like the attached screenshot?

ViewPainter uses a separate path from BoxPainter so I want to make sure we are fixing RLS and not just the non-root overflow scrollers.
Screen Shot 2018-02-28 at 6.40.02 PM.png
727 KB View Download
Project Member

Comment 10 by bugdroid1@chromium.org, Mar 5 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6834d228deef92b4708bfac0c5ed8d33bcbbe51b

commit 6834d228deef92b4708bfac0c5ed8d33bcbbe51b
Author: Tien-Ren Chen <trchen@chromium.org>
Date: Mon Mar 05 08:04:38 2018

[Blink/Paint] Fix scrolling content background with writing mode

The paint rect for background in scrolling content layer should be
expanded to the full scrollable rect, i.e. layout overflow rect.

This CL fixes a bug in BoxPainter and BoxPaintInvalidator that we
forgot to convert LayoutBox::LayoutOverflowRect() from flipped
coordinates to physical coordinates for painting and invalidation.

BUG= 787666 

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I4b4c45e910ea1d860e61eece6005263d0a8c708e
Reviewed-on: https://chromium-review.googlesource.com/942485
Commit-Queue: Tien-Ren Chen <trchen@chromium.org>
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: Steve Kobes <skobes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#540791}
[modify] https://crrev.com/6834d228deef92b4708bfac0c5ed8d33bcbbe51b/third_party/WebKit/LayoutTests/TestExpectations
[add] https://crrev.com/6834d228deef92b4708bfac0c5ed8d33bcbbe51b/third_party/WebKit/LayoutTests/fast/writing-mode/flipped-block-with-local-background-expected.html
[add] https://crrev.com/6834d228deef92b4708bfac0c5ed8d33bcbbe51b/third_party/WebKit/LayoutTests/fast/writing-mode/flipped-block-with-local-background.html
[modify] https://crrev.com/6834d228deef92b4708bfac0c5ed8d33bcbbe51b/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/window-resize/window-resize-vertical-writing-mode-expected.txt
[modify] https://crrev.com/6834d228deef92b4708bfac0c5ed8d33bcbbe51b/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/window-resize/window-resize-vertical-writing-mode-expected.txt
[copy] https://crrev.com/6834d228deef92b4708bfac0c5ed8d33bcbbe51b/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/window-resize/window-resize-vertical-writing-mode-expected.txt
[rename] https://crrev.com/6834d228deef92b4708bfac0c5ed8d33bcbbe51b/third_party/WebKit/LayoutTests/virtual/disable-spv175/paint/invalidation/window-resize/window-resize-vertical-writing-mode-expected.txt
[modify] https://crrev.com/6834d228deef92b4708bfac0c5ed8d33bcbbe51b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
[modify] https://crrev.com/6834d228deef92b4708bfac0c5ed8d33bcbbe51b/third_party/WebKit/Source/core/layout/LayoutBox.h
[modify] https://crrev.com/6834d228deef92b4708bfac0c5ed8d33bcbbe51b/third_party/WebKit/Source/core/paint/BoxPaintInvalidator.cpp
[modify] https://crrev.com/6834d228deef92b4708bfac0c5ed8d33bcbbe51b/third_party/WebKit/Source/core/paint/BoxPainter.cpp

Labels: -Pri-2 ReleaseBlock-Stable M-66 Merge-Request-66 Pri-1
Let's merge this to 66.
Please add affected OSs.
Labels: OS-Android OS-Chrome OS-Fuchsia OS-Linux OS-Mac OS-Windows
Project Member

Comment 14 by sheriffbot@chromium.org, Mar 6 2018

Labels: -Merge-Request-66 Merge-Approved-66 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M66. Please go ahead and merge the CL to branch 3359 manually. Please contact milestone owner if you have questions.
Owners: cmasso@(Android), cmasso@(iOS), josafat@(ChromeOS), abdulsyed@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 15 by bugdroid1@chromium.org, Mar 6 2018

Labels: -merge-approved-66 merge-merged-3359
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/735a07310308af9e01c89a436341d0502a3b1f97

commit 735a07310308af9e01c89a436341d0502a3b1f97
Author: Tien-Ren Chen <trchen@chromium.org>
Date: Tue Mar 06 20:22:03 2018

[Blink/Paint] Fix scrolling content background with writing mode

The paint rect for background in scrolling content layer should be
expanded to the full scrollable rect, i.e. layout overflow rect.

This CL fixes a bug in BoxPainter and BoxPaintInvalidator that we
forgot to convert LayoutBox::LayoutOverflowRect() from flipped
coordinates to physical coordinates for painting and invalidation.

BUG= 787666 
TBR=trchen@chromium.org

(cherry picked from commit 6834d228deef92b4708bfac0c5ed8d33bcbbe51b)

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I4b4c45e910ea1d860e61eece6005263d0a8c708e
Reviewed-on: https://chromium-review.googlesource.com/942485
Commit-Queue: Tien-Ren Chen <trchen@chromium.org>
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: Steve Kobes <skobes@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#540791}
Reviewed-on: https://chromium-review.googlesource.com/952029
Reviewed-by: Tien-Ren Chen <trchen@chromium.org>
Cr-Commit-Position: refs/branch-heads/3359@{#38}
Cr-Branched-From: 66afc5e5d10127546cc4b98b9117aff588b5e66b-refs/heads/master@{#540276}
[modify] https://crrev.com/735a07310308af9e01c89a436341d0502a3b1f97/third_party/WebKit/LayoutTests/TestExpectations
[add] https://crrev.com/735a07310308af9e01c89a436341d0502a3b1f97/third_party/WebKit/LayoutTests/fast/writing-mode/flipped-block-with-local-background-expected.html
[add] https://crrev.com/735a07310308af9e01c89a436341d0502a3b1f97/third_party/WebKit/LayoutTests/fast/writing-mode/flipped-block-with-local-background.html
[modify] https://crrev.com/735a07310308af9e01c89a436341d0502a3b1f97/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/window-resize/window-resize-vertical-writing-mode-expected.txt
[modify] https://crrev.com/735a07310308af9e01c89a436341d0502a3b1f97/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/window-resize/window-resize-vertical-writing-mode-expected.txt
[copy] https://crrev.com/735a07310308af9e01c89a436341d0502a3b1f97/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/window-resize/window-resize-vertical-writing-mode-expected.txt
[rename] https://crrev.com/735a07310308af9e01c89a436341d0502a3b1f97/third_party/WebKit/LayoutTests/virtual/disable-spv175/paint/invalidation/window-resize/window-resize-vertical-writing-mode-expected.txt
[modify] https://crrev.com/735a07310308af9e01c89a436341d0502a3b1f97/third_party/WebKit/Source/core/layout/LayoutBox.cpp
[modify] https://crrev.com/735a07310308af9e01c89a436341d0502a3b1f97/third_party/WebKit/Source/core/layout/LayoutBox.h
[modify] https://crrev.com/735a07310308af9e01c89a436341d0502a3b1f97/third_party/WebKit/Source/core/paint/BoxPaintInvalidator.cpp
[modify] https://crrev.com/735a07310308af9e01c89a436341d0502a3b1f97/third_party/WebKit/Source/core/paint/BoxPainter.cpp

Status: Fixed (was: Started)

Sign in to add a comment