[LayoutNG] Only use box painter for box fragments
Add debug checks to NGBoxFragmentPainter ensuring it's only used for box fragments, as the implementation assumes the NGPhysicalFragment supplied to the NGBoxFragmentPainter constructor is a true NGPhysicalBoxFragment. Fixing this uncovered another issue where InlinePainter assumes that all LayoutNG formatting contexts are boxes, using NGInlineBoxFragmentPainter to paint them. This mostly works as the fragment types are quite similar but involves incorrect type casts and can potentially read uninitialized memory with unpredictable results. This change updates the InlinePainter Paint method to use the LayoutNG painter appropriate for every fragment. Bug: 962004, 962338 Change-Id: I28e21544da423a21a2bb41a692052feace71d90f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1610092Reviewed-by:Christian Biesinger <cbiesinger@chromium.org> Commit-Queue: Christian Biesinger <cbiesinger@chromium.org> Commit-Queue: Emil A Eklund <eae@chromium.org> Auto-Submit: Emil A Eklund <eae@chromium.org> Cr-Commit-Position: refs/heads/master@{#659685}
Showing
Please register or sign in to comment