New issue
Advanced search Search tips

Issue 861623 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Sep 13
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android , Windows , Mac
Pri: 3
Type: Bug



Sign in to add a comment

[LayoutNG] 'overflow: auto' is broken when 'background' is set and on hi-dpi display

Project Member Reported by tkent@chromium.org, Jul 9

Issue description

Chrome Version:  69.0.3485.0 with chrome://flags/#enable-layout-ng enabled
OS: macOS 10.13

What steps will reproduce the problem?
(1) Open https://ja.stackoverflow.com/questions/45438/%E3%81%93%E3%81%AE%E3%82%B3%E3%83%BC%E3%83%89%E3%81%AE%E9%87%8F%E3%82%92%E6%B8%9B%E3%82%89%E3%81%97%E3%81%9F%E3%81%84

What is the expected result?
the page is rendered same as non-layoutng.

What happens instead?
A <pre> block is broken.
 - Background-color of the PRE is not painted on whole lines
 - Hooter part, [javascript] Share Edit Close..., is duplicated.



Please use labels and text to provide additional information.

 
Screen Shot 2018-07-09 at 12.49.21.png
211 KB View Download
Labels: Needs-Feedback
Summary: [LayoutNG] PRE block in stackoverlfow.com is broken (was: NG: PRE block in stackoverlfow.com is broken)
Thanks for the report. Can you still reproduce this? Looks correct for me on ToT.

Labels: OS-Mac
Still reproducible with 69.0.3494.0 canary on macOS Retina.

Not reproducible on Windows.
Status: Fixed (was: Untriaged)
No longer reproduces on linux either. Marking as fixed.
Labels: -Needs-Feedback
Status: Untriaged (was: Fixed)
Still reproducible with 70.3500.0 canary + macOS 10.3 *Retina*.

Not reproducible with non-Retina setting.

Owner: kojii@chromium.org
Status: Assigned (was: Untriaged)
Ah, thanks tkent!
English page example:
https://stackoverflow.com/questions/51605578/angularjs-http-cors-and-basic-authentication-with-jersey

PRE + scroll + probably some CSS properties used in stackoverflow.com, havenY't narrowed down what the property is yet.
Cc: atotic@chromium.org kojii@chromium.org
Owner: e...@chromium.org
Emil, I suspect this happens because NG computes VisualRect, overflow rect, or one of these paint-related rects, but hard to diagnose further for me.

Happen to know anyone who can advise which rects are likely to be wrong?
Cc: cbiesin...@chromium.org e...@chromium.org
Owner: ----
Status: Available (was: Assigned)
Hmm, interesting. Any ideas Christian?
Summary: [LayoutNG] PRE block in stackoverflow.com is broken (was: [LayoutNG] PRE block in stackoverlfow.com is broken)
Hm... we use legacy to compute the overflow rect (we just call ComputeOverflow), so presumably that one is correct? So I guess maybe it's the visual rect?
Cc: mstensho@chromium.org
Aleks points out that this is not true (we do override AddOverflowFromChildren in the mixin)

Comment 12 Deleted

Comment 13 Deleted

This is what I see on hidpi windows on the stackoverflow link
hidpi-windows.png
182 KB View Download
I found I can reproduce this on my Huawei P20 Pro, screen shot attached.

Also on another URL:
https://drafts.css-houdini.org/font-metrics-api-1/
Screenshot_20180903-223435.jpg
729 KB View Download
Labels: OS-Android
Screenshot_20180903-223820.jpg
653 KB View Download

Comment 17 Deleted

Labels: OS-Windows
Reproduced on Windows too.
1. Set device-per-pixel to 150% or larger. Doesn't happen with 125%.
2. Open attached minimized file.

scroll-861623.html
1.3 KB View Download
scroll-861623.png
2.4 KB View Download
Summary: [LayoutNG] 'overflow: auto' is broken when 'background' is set and on hi-dpi display (was: [LayoutNG] PRE block in stackoverflow.com is broken)
Reproduces on local chrome but not on content_shell.

VisualRect and scroll_width/_height look the same as legacy. Whatelse could cause symptom like this?

Comment 21 Deleted

Comment 22 Deleted

Found how code path is different, need to investigate why. Here's a memo.

In NGBoxFragmentPainter::PaintBoxDecorationBackground, when running chrome.exe on 150% display v.s. 100% display:
* IsPaintingBackgroundOfPaintContainerIntoScrollingContentsLayer returns true on 150% while false on 100%, so paint_rect is empty on 150%.
* Then paint_info.SkipRootBackground() is true on 150%, and that should_paint_background becomes false.

Because should_paint_background is false on 150% display, NGBoxFragmentPainter doesn't call PaintBackground.
Project Member

Comment 24 by bugdroid1@chromium.org, Sep 9

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

commit 1160492e162ce25d33ba67bf738f6e28e33d8b20
Author: Koji Ishii <kojii@chromium.org>
Date: Sun Sep 09 21:09:35 2018

[LayoutNG] Fix NGBoxFragmentPainter to paint background of scrolling contents layer

The code to paint the background of scrolling contents layer
was missing in NGBoxFragmentPainter. This patch copies the
logic from BoxPainter.

 Issue 861623  found that this code path runs when all of the
following conditions are true:
* In Chrome (not in content_shell).
* When display / CSS pixel >= 1.5.
* When background is set to 'overflow: auto' box.

This patch also fixes 3 CSS contain tests that has 'contain:
paint', 'overflow-[xy]: scroll', and background color to an
inline formatting context.

Bug:  861623 
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng;luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I31d0b407e794409552dcf89f5c8005fafc5f99a6
Reviewed-on: https://chromium-review.googlesource.com/1215143
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589809}
[modify] https://crrev.com/1160492e162ce25d33ba67bf738f6e28e33d8b20/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
[modify] https://crrev.com/1160492e162ce25d33ba67bf738f6e28e33d8b20/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc

Owner: kojii@chromium.org
Status: Started (was: Available)
Canary got much better, but still has some issues. Will sync more recent paint changes to NG.
Project Member

Comment 27 by bugdroid1@chromium.org, Sep 12

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

commit 07172170d6f94704bd47389e39251e24b905baaa
Author: Koji Ishii <kojii@chromium.org>
Date: Wed Sep 12 17:30:23 2018

[LayoutNG] Sync PaintBoxDecorationBackground with BoxPainter

Following r589809 (CL:1215143), this patch synchronizes
NGBoxFragmentPainter::PaintBoxDecorationBackground with the
current BoxPainter. These functions in BoxPainter has had
several changes. Also, features not implemented before such
as theme painting are implemented in this patch.

Not much efforts to eliminate LayoutObject dependency
were done in this patch yet.

Bug:  861623 
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng;luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ia965fc0f466b15517702b78096d40e9788219cf3
Reviewed-on: https://chromium-review.googlesource.com/1218187
Commit-Queue: Emil A Eklund <eae@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#590740}
[modify] https://crrev.com/07172170d6f94704bd47389e39251e24b905baaa/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
[modify] https://crrev.com/07172170d6f94704bd47389e39251e24b905baaa/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/paint/invalidation/svg/add-background-property-on-root-expected.txt
[modify] https://crrev.com/07172170d6f94704bd47389e39251e24b905baaa/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/paint/invalidation/svg/remove-background-property-on-root-expected.txt
[modify] https://crrev.com/07172170d6f94704bd47389e39251e24b905baaa/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc
[modify] https://crrev.com/07172170d6f94704bd47389e39251e24b905baaa/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.h

Sign in to add a comment