Avoid falling back to legacy if |CanTraversePhysicalFragments|
This is a re-land of r824316 <crrev.com/c/2515429>, which was reverted for <crbug.com/1146797>, with following changes in |NGBoxFragmentPainter::HitTestChildBoxFragment|: * When |!FragmentRequiresLegacyFallback|, check |IsPaintedAtomically| before |IsInline|. I'm not sure why we do so for legacy, but this was the root cause of the regression in <crbug.com/1146797>. * No code changes when |FragmentRequiresLegacyFallback|. * Test for crbug.com/1146797 paasses. Original description follows: When painting and hit-testing NG fragments, |NGBoxFragmentPainter| falls back to |LayoutObject| at the BFC boundary, because we already have a logic in |LayoutObject| to switch painters for NG and legacy. This patch changes to do so only when |!CanTraverse|, because |LayoutObject| cannot handle block fragmented NG objects. This patch eliminates |CurrentFragment| from |LayoutNGBlockFlowMixin::Paint| by making sure it is not block fragmented. Also changes |HitTestChildBoxFragment| so that it can handle atomically-painted objects in NG code path. Due to the change in |FragmentRequiresLegacyFallback|, such objects go to NG code path without going through |LayoutObject|. Bug: 1061423, 829028 Change-Id: Ie795d5ab091b60535f4ee83ed548287e158cfaab Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2526874Reviewed-by:Yoshifumi Inoue <yosin@chromium.org> Commit-Queue: Yoshifumi Inoue <yosin@chromium.org> Commit-Queue: Koji Ishii <kojii@chromium.org> Cr-Commit-Position: refs/heads/master@{#827170}
Showing
Please register or sign in to comment