Get border/padding from fragment when painting background. #46252
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since @page border box layout objects aren't in the the layout tree, any
code that wants to walk up the tree to find the containing block will be
in for a surprise.
This would happen if percentage-based @page padding was used [1].
Recomputing padding during painting when we have already done it during
layout is rather pointless anyway. Read it out directly from the
fragment.
[1] #1 blink::LayoutBox::ContainingBlockLogicalWidthForContent()
#2 blink::LayoutBoxModelObject::ComputedCSSPadding()
#3 blink::LayoutBoxModelObject::PaddingTop()
#4 blink::LayoutBoxModelObject::PaddingOutsets()
#5 blink::BoxPainterBase::PaintFillLayer()
#6 blink::BoxPainterBase::PaintFillLayers()
#7 blink::BoxFragmentPainter::PaintBackground()
Bug: 40286153
Change-Id: I1e6e92c2ce1d81aab2673ec9a877eac455534102
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5526469
Commit-Queue: Morten Stenshorne <[email protected]>
Reviewed-by: Xianzhu Wang <[email protected]>
Reviewed-by: Ian Kilpatrick <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1300711}