[LayoutNG] Caching of text paining broken? |
|||||
Issue descriptionIf a dynamic change moves a block that contains text (inline children), without triggering layout, we fail to repaint that text at the new position. So this only seems to happen if we manage to skip layout of some object. Since NG currently just re-lays out everything every time it needs to lay out anything at all, I guess it's only reproducible when re-entering NG from legacy layout, e.g. table cells or flex items. Attaching two tests. If I remove the DrawingRecorder::UseCachedDrawingIfPossible() check in NGBoxFragmentPainter::PaintTextChild(), I get (a bunch of DCHECK failures, and) text repainted correctly at the new position. https://chromium-review.googlesource.com/c/chromium/src/+/773791 seems interesting here. So are we using cached items when we shouldn't, or is it something else? This bug is responsible for a few flakes (depending on image loading timing), such as LayoutTests/tables/mozilla/bugs/ bug25074 .html (and probably some pure failures as well).
,
Feb 22 2018
I think I already had that CL in my tree when reporting this, but anyway, the problem is still there. It's pretty much impossible for me to run through LayoutTests/tables/ without any failures.
,
Mar 6 2018
It looks like background images not being painted is from the same reason; UseCachedDrawingIfPossible() calls PaintController::ClientCacheIsValid(), at which point somehow the current_cache_generation_ is not updated.
,
Mar 6 2018
atotic@, when you're working on paint invalidation, does that include LayoutObject::InvalidateDisplayItemClients()? It looks like background-image is from this function, and I guess Morten's problem as well. /cc yoichio@, as he made partial changes for selection in https://chromium-review.googlesource.com/821394
,
Mar 6 2018
,
Mar 6 2018
I am looking at all invalidation bugs. Have not learned enough yet to classify failures into different buckets. The cache is not turned on by default, so this is invalidation bug.
,
Mar 7 2018
My change is invalidating NGPaintFragment of a LayoutText when selection is updated because we paint text with the NGPaintFragments. FYI, NGPaintFragment inherits DisplayItemClinent.
,
Mar 7 2018
yoichio@: thanks, yeah, that was a good work, and I think the CL https://chromium-review.googlesource.com/c/chromium/src/+/951522 covers other cases than selection painting as well that it might be good to review and merge your changes.
,
Mar 7 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/b2756c9c2a6fb21f37e1cac78c5d283f97029fc1 commit b2756c9c2a6fb21f37e1cac78c5d283f97029fc1 Author: Koji Ishii <kojii@chromium.org> Date: Wed Mar 07 05:13:33 2018 [LayoutNG] Implement LayoutObject::InvalidateDisplayItemClients This patch implements LayoutObject::InvalidateDisplayItemClients for LayoutText, LayoutInline, and LayoutBlockFlow. These are the all classes that implement this virtual functions. For one, this fixes background-image to be painted when images are loaded. Before this patch, invalidating LayoutObject does call painters, but NGPaintFragment is not invalidated and that CachedDrawing was used to paint. Note that not all logic LayoutBlockFlow does for LayoutObject are not examined. They probably need to be examined and some of them are needed to be ported to LayoutNG, in its own invalidator. That part is not included in this patch. Bug: 636993, 811479 Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Change-Id: Icf6fabc4ecc30687c1a5cd21c0c3db268e3c7e3f Reviewed-on: https://chromium-review.googlesource.com/951522 Commit-Queue: Koji Ishii <kojii@chromium.org> Reviewed-by: Aleks Totic <atotic@chromium.org> Reviewed-by: Emil A Eklund <eae@chromium.org> Cr-Commit-Position: refs/heads/master@{#541353} [modify] https://crrev.com/b2756c9c2a6fb21f37e1cac78c5d283f97029fc1/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG [modify] https://crrev.com/b2756c9c2a6fb21f37e1cac78c5d283f97029fc1/third_party/WebKit/Source/core/layout/LayoutInline.cpp [modify] https://crrev.com/b2756c9c2a6fb21f37e1cac78c5d283f97029fc1/third_party/WebKit/Source/core/layout/LayoutText.cpp [modify] https://crrev.com/b2756c9c2a6fb21f37e1cac78c5d283f97029fc1/third_party/WebKit/Source/core/layout/ng/layout_ng_mixin.cc [modify] https://crrev.com/b2756c9c2a6fb21f37e1cac78c5d283f97029fc1/third_party/WebKit/Source/core/layout/ng/layout_ng_mixin.h [modify] https://crrev.com/b2756c9c2a6fb21f37e1cac78c5d283f97029fc1/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp [modify] https://crrev.com/b2756c9c2a6fb21f37e1cac78c5d283f97029fc1/third_party/WebKit/Source/core/paint/ng/ng_paint_fragment.cc [modify] https://crrev.com/b2756c9c2a6fb21f37e1cac78c5d283f97029fc1/third_party/WebKit/Source/core/paint/ng/ng_paint_fragment.h [modify] https://crrev.com/b2756c9c2a6fb21f37e1cac78c5d283f97029fc1/third_party/WebKit/Source/core/paint/ng/ng_paint_fragment_test.cc
,
Mar 7 2018
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by kojii@chromium.org
, Feb 19 2018